Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 1.2.0.GA
Fetching contributors…

Cannot retrieve contributors at this time

353 lines (319 sloc) 17.423 kb
<?xml version="1.0" ?>
<project name="Spring.Social.Dropbox" default="build" xmlns="http://nant.sf.net/release/0.91/nant.xsd">
<property name="datetime.now" value="${datetime::now()}" />
<property name="root.dir" value="${project::get-base-directory()}" />
<property name="deploy.dir" value="${root.dir}\..\deploy" />
<property name="build.dir" value="${root.dir}\build" />
<property name="package.dir" value="${build.dir}\package" />
<property name="bin.dir" value="${root.dir}\bin" />
<property name="doc.dir" value="${root.dir}\doc" />
<property name="tools.dir" value="${root.dir}\tools" />
<property name="setup.dir" value="${root.dir}\setup" />
<property name="product.name" value="Spring.NET Social Framework extension for Dropbox" />
<property name="product.company" value="SpringSource" />
<property name="product.copyright" value="Copyright ${datetime::get-year(datetime.now)} ${product.company}" />
<property name="product.url" value="http://www.springframework.net/" />
<property name="product.description" value="Allows you to connect your applications with Dropbox" />
<property name="product.version" value="1.2.0" />
<!-- alpha / beta# / rc# -->
<property name="product.releasetype" value="" />
<property name="product.fullname" value="${product.name} ${product.version}" if="${(product.releasetype == '')}" />
<property name="product.fullname" value="${product.name} ${product.version} (${product.releasetype})" if="${(product.releasetype != '')}" />
<property name="project.buildnumber" value="${math::abs(math::floor(timespan::get-total-days(datetime::now() - datetime::parse('7/01/2012'))))}" />
<property name="project.version" value="${product.version}.${project.buildnumber}" />
<property name="project.buildtype" value="dev" />
<property name="project.sign" value="false" overwrite="false" />
<if test="${project.sign and not(file::exists(root.dir + '/Spring.Net.snk'))}">
<fail message="project.sign='true' but keyfile ${root.dir+'/Spring.Net.snk'} is missing" />
</if>
<readregistry property="net40.install.dir" key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\InstallPath" hive="LocalMachine" failonerror="true" />
<property name="msbuild.exe" value="${net40.install.dir}\msbuild.exe" />
<!-- MAIN TARGETS -->
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${bin.dir}" />
</target>
<target name="ncoverexplorer" depends="clean">
<property name="product.fullname.temp" value="${product.fullname}"/>
<property name="project.buildconfiguration" value="Debug" />
<call target="build-net-3.5" />
<exec program="${tools.dir}/NCoverExplorer/NCoverExplorer.exe" workingdir="${project.buildoutputdir}">
<arg path="${project.buildoutputdir}/Spring.Social.Dropbox.Tests.dll-TestCoverage.xml" />
</exec>
</target>
<target name="build" depends="clean">
<echo message="NAnt current .NET Framework = ${nant.settings.currentframework}" />
<property name="product.fullname.temp" value="${product.fullname}"/>
<copy file="${root.dir}\src\CommonAssemblyInfo.cs" tofile="${root.dir}\src\CommonAssemblyInfo.cs.temp" />
<property name="project.buildconfiguration" value="Debug" />
<call target="build-all" />
<property name="project.buildconfiguration" value="Release" />
<call target="build-all" />
<copy file="${root.dir}\src\CommonAssemblyInfo.cs.temp" tofile="${root.dir}\src\CommonAssemblyInfo.cs" overwrite="true" />
<delete file="${root.dir}\src\CommonAssemblyInfo.cs.temp" />
</target>
<target name="daily">
<property name="project.buildtype" value="daily" />
<property name="product.fullname" value="${product.name} (Daily build from ${datetime::get-month(datetime.now)}/${datetime::get-day(datetime.now)}/${datetime::get-year(datetime.now)})" />
<property name="project.zip-filename" value="Spring.Social.Dropbox-${datetime::get-year(datetime.now)}${string::pad-left(datetime::get-month(datetime.now), 2, '0')}${string::pad-left(datetime::get-day(datetime.now), 2, '0')}-${string::pad-left(datetime::get-hour(datetime.now), 2, '0')}${string::pad-left(datetime::get-minute(datetime.now), 2, '0')}.zip" />
<call target="package-deploy"/>
</target>
<target name="release">
<property name="project.buildtype" value="release" />
<property name="project.zip-filename" value="Spring.Social.Dropbox-${product.version}.zip" if="${(product.releasetype == '')}" />
<property name="project.zip-filename" value="Spring.Social.Dropbox-${product.version}-${product.releasetype}.zip" if="${(product.releasetype != '')}" />
<call target="package-deploy"/>
<call target="nuget-deploy"/>
</target>
<!-- TARGETS -->
<target name="update-common-assemblyinfo">
<echo message="Generating common AssemblyInfo file..." />
<!-- ensure src/CommonAssemblyInfo.cs is writable if it already exists -->
<attrib file="${root.dir}\src\CommonAssemblyInfo.cs" readonly="false" if="${file::exists('${root.dir}\src\CommonAssemblyInfo.cs')}" />
<!-- generate the source file holding the common assembly-level attributes -->
<asminfo output="${root.dir}\src\CommonAssemblyInfo.cs" language="CSharp">
<imports>
<import namespace="System" />
<import namespace="System.Reflection" />
<import namespace="System.Runtime.InteropServices" />
</imports>
<attributes>
<attribute type="CLSCompliantAttribute" value="true" />
<attribute type="ComVisibleAttribute" value="false" />
<attribute type="AssemblyProductAttribute" value="${product.fullname}" />
<attribute type="AssemblyCompanyAttribute" value="${product.url}" />
<attribute type="AssemblyCopyrightAttribute" value="${product.copyright}" />
<attribute type="AssemblyTrademarkAttribute" value="Apache License, Version 2.0" />
<attribute type="AssemblyCultureAttribute" value="" />
<attribute type="AssemblyVersionAttribute" value="${project.version}" />
<attribute type="AssemblyConfigurationAttribute" value="${project.framework}; ${project.version}; ${project.buildtype}" />
</attributes>
</asminfo>
</target>
<target name="build-all">
<call target="build-net-2.0" />
<call target="build-net-3.5" />
<call target="build-net-4.0" />
<call target="build-wp-7.0" />
<call target="build-wp-7.1" />
</target>
<target name="build-net-2.0">
<echo message="Building for .NET 2.0 with '${project.buildconfiguration}' configuration" />
<property name="product.fullname" value="${product.fullname.temp} for .NET 2.0" />
<property name="project.framework" value="net-2.0"/>
<property name="project.version" value="${product.version}.${project.buildnumber}20" />
<property name="project.buildoutputdir" value="${bin.dir}\net\2.0\${project.buildconfiguration}" />
<property name="project.buildsolutionfile" value="${root.dir}\Spring.Social.Dropbox.2008-NET20.sln" />
<call target="update-common-assemblyinfo" />
<call target="rebuild-solution"/>
<call target="testcover-assemblies"/>
</target>
<target name="build-net-3.5">
<echo message="Building for .NET 3.5 with '${project.buildconfiguration}' configuration" />
<property name="product.fullname" value="${product.fullname.temp} for .NET 3.5" />
<property name="project.framework" value="net-3.5"/>
<property name="project.version" value="${product.version}.${project.buildnumber}35" />
<property name="project.buildoutputdir" value="${bin.dir}\net\3.5\${project.buildconfiguration}" />
<property name="project.buildsolutionfile" value="${root.dir}\Spring.Social.Dropbox.2008-NET35.sln" />
<call target="update-common-assemblyinfo" />
<call target="rebuild-solution"/>
<call target="testcover-assemblies"/>
</target>
<target name="build-net-4.0">
<echo message="Building for .NET 4.0 with '${project.buildconfiguration}' configuration" />
<property name="product.fullname" value="${product.fullname.temp} for .NET 4.0" />
<property name="project.framework" value="net-4.0"/>
<property name="project.version" value="${product.version}.${project.buildnumber}40" />
<property name="project.buildoutputdir" value="${bin.dir}\net\4.0\${project.buildconfiguration}" />
<property name="project.buildsolutionfile" value="${root.dir}\Spring.Social.Dropbox.2010-NET40.sln" />
<call target="update-common-assemblyinfo" />
<call target="rebuild-solution"/>
<call target="test-assemblies"/>
</target>
<target name="build-wp-7.0">
<echo message="Building for Windows Phone 7.0 with '${project.buildconfiguration}' configuration" />
<property name="product.fullname" value="${product.fullname.temp} for Windows Phone 7.0" />
<property name="project.framework" value="wp-7.0"/>
<property name="project.version" value="${product.version}.${project.buildnumber}70" />
<property name="project.buildoutputdir" value="${bin.dir}\wp\7.0\${project.buildconfiguration}" />
<property name="project.buildsolutionfile" value="${root.dir}\Spring.Social.Dropbox.2010-WP70.sln" />
<call target="update-common-assemblyinfo" />
<call target="rebuild-solution"/>
</target>
<target name="build-wp-7.1">
<echo message="Building for Windows Phone 7.1 with '${project.buildconfiguration}' configuration" />
<property name="product.fullname" value="${product.fullname.temp} for Windows Phone 7.1" />
<property name="project.framework" value="wp-7.1"/>
<property name="project.version" value="${product.version}.${project.buildnumber}71" />
<property name="project.buildoutputdir" value="${bin.dir}\wp\7.1\${project.buildconfiguration}" />
<property name="project.buildsolutionfile" value="${root.dir}\Spring.Social.Dropbox.2010-WP71.sln" />
<call target="update-common-assemblyinfo" />
<call target="rebuild-solution"/>
</target>
<target name="doc">
<echo message="Generating reference documentation" />
<nant buildfile="${doc.dir}/reference/docbook.build" target="all" />
<echo message="Generating API documentation" />
<nant buildfile="${doc.dir}/api/sandcastle.build" target="all" />
</target>
<target name="package" depends="build,doc" description="Builds all modules and documentation">
<!-- Copy release files -->
<!-- Copy binaries -->
<copy todir="${package.dir}\bin">
<fileset basedir="${bin.dir}">
<include name="**\Spring.Rest.dll"/>
<include name="**\Spring.Rest.pdb"/>
<include name="**\Spring.Rest.xml"/>
<include name="**\Spring.Social.Core.dll"/>
<include name="**\Spring.Social.Core.pdb"/>
<include name="**\Spring.Social.Core.xml"/>
<include name="**\Spring.Social.Dropbox.dll"/>
<include name="**\Spring.Social.Dropbox.pdb"/>
<include name="**\Spring.Social.Dropbox.xml"/>
<include name="**\Common.Logging.dll"/>
<include name="**\Common.Logging.xml"/>
</fileset>
</copy>
<!-- Copy sources -->
<copy todir="${package.dir}">
<fileset basedir="${root.dir}">
<include name="*.sln"/>
<include name="readme.txt"/>
<include name="changelog.txt"/>
<include name="breaking-changes.txt"/>
<include name="license.txt"/>
<include name="examples\**"/>
<include name="lib\**"/>
<include name="src\**"/>
<include name="test\**"/>
<exclude name="*.snk"/>
<exclude name="**\.git*"/>
<exclude name="**\*.build"/>
<exclude name="**\*.bat"/>
<exclude name="**\*.suo"/>
<exclude name="**\*.user"/>
<exclude name="**\*.cache"/>
<exclude name="**\*.xap"/>
<exclude name="src\Spring.Social.Dropbox\Spring.Social.Dropbox.xml"/>
<exclude name="src\**\bin\**"/>
<exclude name="src\**\obj\**"/>
<exclude name="test\**\bin\**"/>
<exclude name="test\**\obj\**"/>
<exclude name="examples\**\bin\**"/>
<exclude name="examples\**\obj\**"/>
</fileset>
</copy>
<!-- Copy docs -->
<copy todir="${package.dir}\doc\reference">
<fileset basedir="${doc.dir}\reference\target">
<include name="**\*" />
</fileset>
</copy>
<copy todir="${package.dir}\doc\api">
<fileset basedir="${doc.dir}\api\target">
<include name="**\*.chm" />
</fileset>
</copy>
</target>
<target name="nuget">
<if test="${not(directory::exists(bin.dir))}">
<fail message="'bin' directory is missing. Call 'build', 'daily' or 'release' target first." />
</if>
<echo message="Generating NuGet package..." />
<if test="${property::exists('product.version')}">
<xmlpoke file="${setup.dir}\NuGet\src\Spring.Social.Dropbox.nuspec" xpath="/n:package/n:metadata/n:version" value="${product.version}">
<namespaces>
<namespace prefix="n" uri="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd" />
</namespaces>
</xmlpoke>
</if>
<mkdir dir="${build.dir}"/>
<exec program="${setup.dir}\NuGet\lib\NuGet.exe" workingdir="${build.dir}" verbose="true">
<arg value="pack" />
<arg value="${setup.dir}\NuGet\src\Spring.Social.Dropbox.nuspec" />
</exec>
</target>
<target name="package-deploy" depends="package" description="Deploy Package distribution as .zip file">
<echo message="Zipping package..." />
<zip zipfile="${deploy.dir}\${project.zip-filename}">
<fileset basedir="${package.dir}">
<include name="**\*" />
<exclude name="*.zip" />
</fileset>
</zip>
</target>
<target name="nuget-deploy" depends="nuget">
<copy todir="${deploy.dir}">
<fileset basedir="${build.dir}">
<include name="*.nupkg" />
</fileset>
</copy>
</target>
<target name="rebuild-solution" description="Rebuilds a given solution file">
<echo message="Rebuilding solution '${project.buildsolutionfile}'" />
<exec program="${msbuild.exe}">
<arg value="${project.buildsolutionfile}"/>
<arg value="/nologo" />
<arg value="/target:Rebuild" />
<arg value="/verbosity:minimal" />
<arg value="/property:OutDir=${project.buildoutputdir}/"/>
<arg value="/property:Configuration=${project.buildconfiguration}" />
<arg value="/property:DefineExtraConstants=STRONG" if="${project.sign}" />
<arg value="/property:SignAssembly=true" if="${project.sign}" />
<arg value="/property:AssemblyOriginatorKeyFile=..\..\Spring.Net.snk" if="${project.sign}" />
</exec>
</target>
<target name="test-assemblies" description="Unit tests given assemblies">
<echo message="Unit testing in '${project.buildoutputdir}'" />
<foreach item="File" property="filename">
<in>
<items basedir="${project.buildoutputdir}">
<include name="**\*.Tests.dll" />
</items>
</in>
<do>
<property name="test.assemblyname" value="${path::get-file-name(filename)}" />
<exec program="${tools.dir}\NUnit\bin\net-2.0\nunit-console-x86.exe" workingdir="${project.buildoutputdir}" verbose="true">
<arg line="${test.assemblyname}" />
<arg value="/xml:${test.assemblyname}-TestResults.xml" />
<arg value="/nologo" />
<arg value="/noshadow" />
<arg value="/framework:${project.framework}" />
</exec>
</do>
</foreach>
</target>
<target name="testcover-assemblies" description="Code coverage given assemblies">
<echo message="Coverage Testing in '${project.buildoutputdir}'" />
<foreach item="File" property="filename">
<in>
<items basedir="${project.buildoutputdir}">
<include name="**\*.Tests.dll" />
</items>
</in>
<do>
<property name="test.assemblyname" value="${path::get-file-name(filename)}" />
<property name="src.assemblyname" value="${string::substring(test.assemblyname,0,string::last-index-of(test.assemblyname, '.Tests') )}" />
<exec program="${tools.dir}/NCover/ncover.console.exe" workingdir="${project.buildoutputdir}" verbose="true">
<arg value="//q" />
<arg value="//reg" />
<arg value="//w" />
<arg path="${project.buildoutputdir}" />
<arg value="//x" />
<arg path="${project.buildoutputdir}/${test.assemblyname}-TestCoverage.xml" />
<arg value="//a" />
<arg value="${src.assemblyname}" />
<arg value="//ea" />
<arg value="CoverageExcludeAttribute" />
<arg value="//q" />
<arg path="${tools.dir}\NUnit\bin\net-2.0\nunit-console-x86.exe" />
<arg line="${test.assemblyname}" />
<arg value="/xml:${test.assemblyname}-TestResults.xml" />
<arg value="/nologo" />
<arg value="/noshadow" />
<arg value="/framework:${project.framework}" />
</exec>
</do>
</foreach>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.