Former-commit-id:133dc97f67
[formerlya02aeb236c
] [formerly9f19e3f712
] [formerly06a8b51d6d
[formerly9f19e3f712
[formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]] Former-commit-id:06a8b51d6d
Former-commit-id:377dcd10b9
[formerly3360eb6c5f
] Former-commit-id:8e80217e59
275 lines
12 KiB
XML
275 lines
12 KiB
XML
<?xml version="1.0"?>
|
|
<!--
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one
|
|
or more contributor license agreements. See the NOTICE file
|
|
distributed with this work for additional information
|
|
regarding copyright ownership. The ASF licenses this file
|
|
to you under the Apache License, Version 2.0 (the
|
|
"License"); you may not use this file except in compliance
|
|
with the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing,
|
|
software distributed under the License is distributed on an
|
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, either express or implied. See the License for the
|
|
specific language governing permissions and limitations
|
|
under the License.
|
|
|
|
-->
|
|
|
|
<project name="Qpid.NET" default="build">
|
|
|
|
<!-- Determines the formatter to use to format output of test results. -->
|
|
<property name="nant.formatter" value="Plain" />
|
|
|
|
<!-- Determines whether a 'debug' or 'release' build is to be done. Defaults to 'debug' -->
|
|
<property name="build.config" value="debug" />
|
|
|
|
<!-- Sets build properties consistently accross all assemblies in the project. -->
|
|
<property name="build.version.major" value="0"/>
|
|
<property name="build.version.minor" value="5"/>
|
|
<property name="build.version.build" value="0"/>
|
|
<property name="build.version.revision" value="0"/>
|
|
<property name="build.company" value="Apache Software Foundation"/>
|
|
<property name="build.copyright" value="Apache Software Foundation"/>
|
|
<property name="build.description" value="Built from svn revision number: "/>
|
|
|
|
<!-- Fileset with build files for each 'core' assembly. -->
|
|
<fileset id="src.builds">
|
|
<include name="client/default.build" />
|
|
<include name="management/console/default.build" />
|
|
<include name="demo/default.build" />
|
|
</fileset>
|
|
|
|
<!-- Fileset with build files for each 'core' assembly. -->
|
|
<fileset id="examples.builds">
|
|
<include name="examples/request-response/example-request-response-Client/default.build" />
|
|
<include name="examples/request-response/example-request-response-Server/default.build" />
|
|
<include name="examples/direct/example-direct-Listener/default.build" />
|
|
<include name="examples/direct/example-direct-producer/default.build" />
|
|
<include name="examples/fanout/example-fanout-Listener/default.build" />
|
|
<include name="examples/fanout/example-fanout-Producer/default.build" />
|
|
<include name="examples/pub-sub/example-pub-sub-Listener/default.build" />
|
|
<include name="examples/pub-sub/example-pub-sub-Publisher/default.build" />
|
|
</fileset>
|
|
|
|
<!-- Fileset with build files for 'integration' test assemblies. -->
|
|
<fileset id="tests.builds">
|
|
<include name="test/default.build" />
|
|
</fileset>
|
|
|
|
<!-- Fileset with build files for 'performence' test assemblies. -->
|
|
<fileset id="perftest.builds">
|
|
<include name="perftest/default.build" />
|
|
</fileset>
|
|
|
|
<!-- Prepare environment for a debug build. -->
|
|
<target name="debug">
|
|
<property name="build.debug" value="true" />
|
|
<property name="build.defines" value="DEBUG;TRACE"/>
|
|
</target>
|
|
|
|
<!-- Prepare environment for a release build. -->
|
|
<target name="release">
|
|
<property name="build.debug" value="false" />
|
|
<property name="build.defines" value=""/>
|
|
</target>
|
|
|
|
<!-- Prepare environment for build. -->
|
|
<target name="init">
|
|
<property name="base.dir" value="${project::get-base-directory()}" />
|
|
<property name="build.dir" value="${base.dir}/bin/${framework::get-target-framework()}/${build.config}" />
|
|
<call target="${build.config}" />
|
|
</target>
|
|
|
|
<!-- Cleans up the build output directory. -->
|
|
<target name="clean" depends="init">
|
|
<delete dir="${build.dir}" failonerror="false" />
|
|
</target>
|
|
|
|
<!-- Runs 'svnversion' to get the repository revision into the build property 'build.svnversion'. -->
|
|
<target name="svnversion" description="Runs svnversion to get the current repository version into a build script property.">
|
|
<exec program="svnversion" output="svnversion_tmp.txt">
|
|
<arg value="-n"/>
|
|
</exec>
|
|
|
|
<loadfile file="svnversion_tmp.txt" property="build.svnversion"/>
|
|
<delete file="svnversion_tmp.txt"/>
|
|
|
|
<!-- For some competely retarted reason the '-n' parameter to svnversion doesn't really work under windows...
|
|
Here is some code to strip the unwanted newlines. -->
|
|
<script language="C#">
|
|
<code><![CDATA[
|
|
public static void ScriptMain(Project project)
|
|
{
|
|
project.Properties["build.svnversion"] = project.Properties["build.svnversion"].Trim("\n\r".ToCharArray());
|
|
}
|
|
]]>
|
|
</code>
|
|
</script>
|
|
|
|
</target>
|
|
|
|
<!-- Performs a regex find-and-replace on assembly info files, substituting fields defined as build properties. -->
|
|
<target name="setversion" description="Stamp the version info onto assemblyinfo.cs files" depends="svnversion">
|
|
|
|
<echo>build.svnversion = ${build.svnversion}</echo>
|
|
|
|
<foreach item="File" property="filename">
|
|
<in>
|
|
<items basedir=".">
|
|
<include name="**\AssemblyInfo.cs"></include>
|
|
</items>
|
|
</in>
|
|
<do>
|
|
<script language="C#">
|
|
<code><![CDATA[
|
|
public static void ScriptMain(Project project)
|
|
{
|
|
// Read in the entire file to perform the substitution in.
|
|
StreamReader reader = new StreamReader(project.Properties["filename"]);
|
|
string contents = reader.ReadToEnd();
|
|
reader.Close();
|
|
|
|
// Substitute the version numbers.
|
|
string replacement = string.Format("[assembly: AssemblyVersion(\"{0}.{1}.{2}.{3}\")]",
|
|
project.Properties["build.version.major"],
|
|
project.Properties["build.version.minor"],
|
|
project.Properties["build.version.build"],
|
|
project.Properties["build.version.revision"]);
|
|
contents = Regex.Replace(contents, @"\[assembly: AssemblyVersion\("".*""\)\]", replacement);
|
|
|
|
// Substitute the company name and copyright.
|
|
replacement = string.Format("[assembly: AssemblyCompany(\"{0}\")]",
|
|
project.Properties["build.company"]);
|
|
contents = Regex.Replace(contents, @"\[assembly: AssemblyCompany\("".*""\)\]", replacement);
|
|
|
|
replacement = string.Format("[assembly: AssemblyCopyright(\"{0}\")]",
|
|
project.Properties["build.copyright"]);
|
|
contents = Regex.Replace(contents, @"\[assembly: AssemblyCopyright\("".*""\)\]", replacement);
|
|
|
|
// Update the description.
|
|
//replacement = string.Format("[assembly: AssemblyDescription(\"{0} {1}\")]",
|
|
// project.Properties["build.description"],
|
|
// project.Properties["build.svnversion"]);
|
|
replacement = string.Format("[assembly: AssemblyDescription(\"{0}\")]",
|
|
project.Properties["build.description"]);
|
|
contents = Regex.Replace(contents, @"\[assembly: AssemblyDescription\("".*""\)\]", replacement);
|
|
|
|
// Write out the file with the substituted version.
|
|
StreamWriter writer = new StreamWriter(project.Properties["filename"], false);
|
|
writer.Write(contents);
|
|
writer.Close();
|
|
}
|
|
]]>
|
|
</code>
|
|
</script>
|
|
</do>
|
|
</foreach>
|
|
</target>
|
|
|
|
<!-- Do the build. -->
|
|
<target name="build" depends="init, setversion">
|
|
<echo message="Building all modules including tests."/>
|
|
|
|
<!-- Make sure output folder exists. -->
|
|
<mkdir dir="${build.dir}" />
|
|
|
|
<echo message="Output folder: ${build.dir}"/>
|
|
|
|
<!-- copy reference assemblies over to the output dir -->
|
|
<copy todir="${build.dir}" file="lib/log4net/log4net.dll"/>
|
|
<copy todir="${build.dir}" file="lib/nunit/nunit.framework.dll"/>
|
|
<copy todir="${build.dir}" file="lib/plossum/C5.dll"/>
|
|
<copy todir="${build.dir}" file="lib/plossum/Plossum CommandLine.dll"/>
|
|
|
|
<!-- Compile assemblies. -->
|
|
<nant target="build">
|
|
<buildfiles refid="src.builds" />
|
|
</nant>
|
|
|
|
<!-- Compile test assemblies. -->
|
|
<nant target="build">
|
|
<buildfiles refid="examples.builds" />
|
|
</nant>
|
|
|
|
<!-- Compile test assemblies. -->
|
|
<nant target="build">
|
|
<buildfiles refid="tests.builds" />
|
|
</nant>
|
|
|
|
<!-- Compile test assemblies. -->
|
|
<nant target="build">
|
|
<buildfiles refid="perftest.builds" />
|
|
</nant>
|
|
|
|
<!-- copy config files over to the output dir -->
|
|
<copy todir="${build.dir}" file="test/Qpid Test.dll.config"/>
|
|
<copy todir="${build.dir}" file="log.xml"/>
|
|
|
|
|
|
</target>
|
|
|
|
<!-- Runs all 'pure unit' tests. -->
|
|
<target name="test" depends="build">
|
|
<echo message="Running all pure unit tests."/>
|
|
<nant target="test">
|
|
<buildfiles refid="tests.builds" />
|
|
</nant>
|
|
</target>
|
|
|
|
<!-- Creates a release package. -->
|
|
<target name="release-pkg">
|
|
<echo message="Building and packaging a release."/>
|
|
|
|
<call target="clean"/>
|
|
<call target="build"/>
|
|
|
|
<property name="build.date" value="${datetime::now()}"/>
|
|
|
|
<zip zipfile="${build.dir}/Qpid.NET-${framework::get-target-framework()}-${datetime::get-year(build.date)}${datetime::get-month(build.date)}${datetime::get-day(build.date)}.zip">
|
|
<fileset basedir="${build.dir}" prefix="qpid/lib">
|
|
<include name="**/*.*"/>
|
|
<exclude name="**/*.tests.*"/>
|
|
<exclude name="**/example*.*"/>
|
|
<exclude name="**/nunit.framework.dll"/>
|
|
<exclude name="**/*.exe"/>
|
|
<exclude name="**/*.pdb"/>
|
|
</fileset>
|
|
|
|
<fileset basedir="${build.dir}" prefix="qpid/examples/direct">
|
|
<include name="**/example*direct*.exe"/>
|
|
</fileset>
|
|
|
|
<fileset basedir="${build.dir}" prefix="qpid/examples/fanout">
|
|
<include name="**/example*fanout*.exe"/>
|
|
</fileset>
|
|
|
|
<fileset basedir="${build.dir}" prefix="qpid/examples/pub-sub">
|
|
<include name="**/example*pub-sub*.exe"/>
|
|
</fileset>
|
|
|
|
<fileset basedir="${build.dir}" prefix="qpid/examples/request-response">
|
|
<include name="**/example*request-response*.exe"/>
|
|
</fileset>
|
|
|
|
<fileset basedir="${base.dir}/.." prefix="qpid">
|
|
<include name="LICENSE.txt"/>
|
|
<include name="NOTICE.txt"/>
|
|
<include name="RELEASE_NOTES.txt"/>
|
|
<include name="DISCLAIMER"/>
|
|
</fileset>
|
|
|
|
|
|
<fileset basedir="${base.dir}" prefix="qpid">
|
|
<include name="README.txt"/>
|
|
</fileset>
|
|
</zip>
|
|
</target>
|
|
|
|
</project>
|
|
|
|
|