Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

358 lines (310 sloc) 15.407 kB
<?xml version="1.0" encoding="utf-8"?>
<!--EXTERNAL_PROPERTIES: usdDatabaseVersion-->
<!--EXTERNAL_PROPERTIES: CCNetLabel-->
<project name="Spark" default="build" xmlns="http://nant.sf.net/release/0.85/nant.xsd">
<property name="solution.dir" value="src"/>
<property name="solution.file" value="${solution.dir}\Spark.sln"/>
<property name="trunk.dir" value="."/>
<property name="company.name" value="Louis DeJardin"/>
<property name="bin.dir" value="bin" />
<property name="build.base" value="build"/>
<property name="msbuild.dir" value="C:\Windows\Microsoft.NET\Framework\v4.0.30319" />
<property name="results.dir" value="${build.base}\results" />
<property name="samples.dir" value="${solution.dir}\samples"/>
<property name="version.major" value="1"/>
<property name="version.minor" value="8"/>
<property name="version.build" value="1"/>
<property name="version.revision" value="0"/>
<property name="project.version" value="${version.major}.${version.minor}" dynamic="true" />
<property name="project.fullversion" value="${version.major}.${version.minor}.${version.build}.${version.revision}" dynamic="true" />
<property name="nant.settings.currentframework" value="net-4.0" />
<property name="ncover.path" value="${bin.dir}\ncover" />
<property name="project.copyright" value="Copyright (c) ${company.name} 2008-${datetime::get-year(datetime::now())}"/>
<property name="package.dir" value="${build.base}\package" />
<property name="project.signassembly" value="true"/>
<!-- default configuration -->
<property name="project.config" value="release" />
<!-- debug|release -->
<property name="build.dir" value="${build.base}/${nant.settings.currentframework}.${platform::get-name()}-${project::get-name()}-${project.config}/"/>
<property name="out.dir" value="${project::get-base-directory()}\${build.dir}" />
<property name="dist.revision" value="${datetime::get-year(datetime::now())*10000+datetime::get-month(datetime::now())*100+ datetime::get-day(datetime::now())}"/>
<target name="build" depends="clean, version, init, commonassemblyinfo, compile, test, compile-samples"/>
<target name="cruise" depends="build, package"/>
<target name="cruise-coverage" depends="analyze"/>
<target name="commiter" depends="build, analyze, package"/>
<target name="tools" depends="init-tools, build"/>
<target name="compile-samples"/>
<target name="analyze"/>
<target name="init" description="Initializes build properties">
<tstamp>
<formatter property="datetime.buildtime" pattern="yyyy-MM-dd, HH:mm:ss" />
</tstamp>
<delete dir="${build.base}"/>
<mkdir dir="${build.dir}" />
<if test="${not file::exists(solution.dir + '\Tools\SparkLanguagePackage\PackageLoadKey.h')}">
<echo message="Creating placeholder PackageLoadKey.h file" />
<echo message="// this is an auto-generated placeholder file" file="${solution.dir}\Tools\SparkLanguagePackage\PackageLoadKey.h" />
</if>
<echo message="Current Directory: ${project::get-base-directory()}"/>
</target>
<target name="init-tools">
<property name="tools.solution.dir" value="src\Tools"/>
<property name="tools.solution.file" value="${tools.solution.dir}\Tools.sln"/>
</target>
<target name="clean" description="delete build artifacts">
<delete dir="${build.dir}" failonerror="false" />
</target>
<target name="version" description="mark AssemblyInfo builds with the build number">
<if test="${property::exists('CCNetLabel')}">
<property name="version.build" value="${CCNetLabel}"/>
<echo message="Using CruiseControl build number ${CCNetLabel}" />
</if>
<if test="${property::exists('build.number')}">
<property name="version.build" value="${build.number}"/>
<echo message="Using TeamCity build number ${build.number}" />
</if>
<property name="dist.revision" value="${project.fullversion}"/>
</target>
<target name="compile" depends="init">
<echo message="Build Directory is ${build.dir}" />
<exec program="${msbuild.dir}\msbuild.exe"
commandline="&quot;${solution.file}&quot; /p:VisualStudioVersion=12.0 /t:Clean &quot;/p:Configuration=${project.config};OutDir=${out.dir};SignAssembly=${project.signassembly}&quot; /v:q" workingdir="." />
<exec program="${msbuild.dir}\msbuild.exe"
commandline="&quot;${solution.file}&quot; /p:VisualStudioVersion=12.0 /t:Rebuild &quot;/p:Configuration=${project.config};OutDir=${out.dir};SignAssembly=${project.signassembly}&quot; /v:q" workingdir="." />
<if test="${property::exists('tools.solution.file')}">
<property name="wix-parameters" value="WixTargetsPath=..\..\..\bin\msbuild\Microsoft\WiX\v3.0\wix.targets;WixTasksPath=WixTasks.dll;WixToolPath=..\..\..\bin\wix"/>
<property name="communitytasks-parameters" value="MSBuildCommunityTasksPath=..\..\..\bin\msbuild\MSBuildCommunityTasks"/>
<exec program="${msbuild.dir}\msbuild.exe"
commandline="&quot;${tools.solution.file}&quot; /t:Clean &quot;/p:Configuration=${project.config};OutDir=${out.dir};${wix-parameters};${communitytasks-parameters}&quot; /v:q" workingdir="." />
<exec program="${msbuild.dir}\msbuild.exe"
commandline="&quot;${tools.solution.file}&quot; /t:Rebuild &quot;/p:Configuration=${project.config};OutDir=${out.dir};${wix-parameters};${communitytasks-parameters};ProjectFullVersion=${project.fullversion}&quot; /v:q" workingdir="." />
</if>
</target>
<target name="commonassemblyinfo" depends="version, init">
<echo message="MARKING THIS BUILD AS VERSION ${project.fullversion}" />
<delete file="${solution.dir}/CommonAssemblyInfo.cs" failonerror="false"/>
<asminfo output="${solution.dir}/CommonAssemblyInfo.cs" language="CSharp">
<imports>
<import namespace="System" />
<import namespace="System.Reflection" />
<import namespace="System.Runtime.InteropServices" />
</imports>
<attributes>
<attribute type="ComVisibleAttribute" value="false" />
<attribute type="AssemblyVersionAttribute" value="${project.version}" />
<attribute type="AssemblyFileVersionAttribute" value="${project.fullversion}" />
<attribute type="AssemblyCopyrightAttribute" value="${project.copyright}" />
<attribute type="AssemblyProductAttribute" value="${project::get-name()}" />
<attribute type="AssemblyCompanyAttribute" value="${company.name}" />
<attribute type="AssemblyConfigurationAttribute" value="${project.config}" />
<attribute type="AssemblyInformationalVersionAttribute" value="${project.fullversion}" />
</attributes>
<references>
<include name="System.dll" />
</references>
</asminfo>
<delete file="${solution.dir}/CommonVersionInfo.h" failonerror="false"/>
<echo message="// this is an auto-generated file" file="${solution.dir}/CommonVersionInfo.h" />
<echo message='#define VERSIONINFO_VERSIONSTRING "${project.fullversion}"' file="${solution.dir}/CommonVersionInfo.h" append="true" />
<echo message="#define VERSIONINFO_MAJOR ${version.major}" file="${solution.dir}/CommonVersionInfo.h" append="true" />
<echo message="#define VERSIONINFO_MINOR ${version.minor}" file="${solution.dir}/CommonVersionInfo.h" append="true" />
<echo message="#define VERSIONINFO_BUILD ${version.build}" file="${solution.dir}/CommonVersionInfo.h" append="true" />
<echo message="#define VERSIONINFO_REVISION ${version.revision}" file="${solution.dir}/CommonVersionInfo.h" append="true" />
<echo message='#define VERSIONINFO_COPYRIGHT "${project.copyright}"' file="${solution.dir}/CommonVersionInfo.h" append="true" />
<echo message='#define VERSIONINFO_COMPANY "${company.name}"' file="${solution.dir}/CommonVersionInfo.h" append="true" />
<echo message='#define VERSIONINFO_PRODUCT "${project::get-name()}"' file="${solution.dir}/CommonVersionInfo.h" append="true" />
</target>
<target name="test" depends="init">
<delete dir="${results.dir}" if="${directory::exists('${results.dir}')}" verbose="true" />
<mkdir dir="${results.dir}"/>
<if test="${not property::exists('outputType')}">
<property name="outputType" value="Plain"/>
</if>
<nunit2 failonerror="true" verbose="true">
<formatter type="Xml" outputdir="${results.dir}" usefile="true" extension=".xml"/>
<formatter type="${outputType}" />
<test assemblyname="${build.dir}/Spark.Tests.dll">
<categories>
<exclude name="Integration" />
</categories>
</test>
<test assemblyname="${build.dir}/Spark.Web.Mvc.Tests.dll">
<categories>
<exclude name="Integration" />
</categories>
</test>
<test assemblyname="${build.dir}/Castle.MonoRail.Views.Spark.Tests.dll">
<categories>
<exclude name="Integration" />
</categories>
</test>
<test assemblyname="${build.dir}/Spark.Ruby.Tests.dll">
<categories>
<exclude name="Integration" />
</categories>
</test>
<test assemblyname="${build.dir}/Spark.Python.Tests.dll">
<categories>
<exclude name="Integration" />
</categories>
</test>
<test assemblyname="${build.dir}/Spark.Web.Mvc.Ruby.Tests.dll">
<categories>
<exclude name="Integration" />
</categories>
</test>
</nunit2>
</target>
<target name="package">
<!--
make a new dir for release.
include subfolders
Bin
referenceDLLs
Docs
Samples
Tools
-->
<delete dir="${package.dir}"/>
<mkdir dir="${package.dir}/" />
<mkdir dir="${package.dir}/Bin" />
<mkdir dir="${package.dir}/Bin/Dependencies" />
<mkdir dir="${package.dir}/Bin/XparkSamples" />
<mkdir dir="${package.dir}/Docs" />
<copy todir="${package.dir}" >
<fileset basedir=".">
<include name="license.txt" />
</fileset>
</copy>
<copy file="${out.dir}/SparkVsIntegration.msi"
tofile="${package.dir}/SparkVsIntegration-${dist.revision}-${project.config}.msi"
if="${property::exists('tools.solution.file')}" />
<copy todir="${package.dir}/Bin" flatten="true">
<fileset basedir="${out.dir}">
<exclude name="*Tests*"/>
<exclude name="*Demo*"/>
<include name="*spark*.dll" />
<include name="*spark*.pdb" />
<include name="xpark.*" />
</fileset>
</copy>
<copy todir="${package.dir}/Bin/XparkSamples" flatten="true">
<fileset basedir="${out.dir}/XparkSamples">
<include name="*.*" />
</fileset>
</copy>
<copy todir="${package.dir}/Bin/Dependencies" flatten="true">
<fileset basedir="${bin.dir}">
<include name="aspnetmvc/*.*" />
<include name="ironpython/*.*" />
<include name="ironruby/*.*" />
<include name="itextsharp/*.*" />
<include name="castle/*.*" />
<include name="nunit/nunit.framework.dll" />
<include name="MvcIntegrationTestFramework/*.*" />
</fileset>
</copy>
<copy todir="${package.dir}/Bin/Dependencies MVC 2" flatten="true">
<fileset basedir="${bin.dir}">
<include name="aspnetmvc2/*.*" />
</fileset>
</copy>
<get src="http://sparkviewengine.com/book/export/html/4" dest="${package.dir}/Docs/index.html" failonerror="false"/>
<mkdir dir="${package.dir}/Samples" />
<copy todir="${package.dir}/Samples" >
<fileset basedir="${solution.dir}/">
<exclude name="**/bin/**"/>
<exclude name="**/obj/**"/>
<exclude name="/**xpark**/**"/>
<exclude name="**/samples/**"/>
<exclude name="**/*.resharper*"/>
<include name="/**samples**/**" />
</fileset>
</copy>
<copy todir="${package.dir}/Samples" >
<fileset basedir="${solution.dir}/Samples">
<exclude name="**/bin/**"/>
<exclude name="**/obj/**"/>
<exclude name="/**resharper**/**"/>
<exclude name="**/*.suo"/>
<exclude name="**/*.user"/>
<exclude name="**/*.resharper*"/>
<include name="/**/**" />
</fileset>
</copy>
<!-- tools will need to be packaged a different way -->
<!--<copy todir="${package.dir}/Tools" >
<fileset basedir="${solution.dir}/Tools">
<exclude name="**/bin/**"/>
<exclude name="**/obj/**"/>
<exclude name="*resharper*"/>
<exclude name="**resharper**/**"/>
<exclude name="**/*.suo"/>
<exclude name="**/*.sln"/>
<exclude name="**/*.user"/>
<exclude name="SparkVsPackage/**"/>
<include name="/**/**" />
</fileset>
</copy>-->
<foreach item="File" property="filename">
<in>
<items basedir="${package.dir}/Samples">
<include name="/**/*.csproj" />
</items>
</in>
<do>
<echo message="Altering ${filename}" />
<loadfile file="${filename}" property="sample.csproj.contents"/>
<property name="sample.csproj.contents" value="${string::replace(sample.csproj.contents, '..\..\..\build\package\Bin', '..\..\Bin')}"/>
<echo file="${filename}" append="false" message="${sample.csproj.contents}"/>
</do>
</foreach>
<!--
<copy todir="${package.dir}/Samples/bin" >
<fileset basedir="${solution.dir}/Samples/bin">
<include name="*.*"/>
</fileset>
</copy>
<mkdir dir="${package.dir}/Helpers/" />
<copy todir="${package.dir}/Helpers" >
<fileset basedir="extras">
<include name="/**/**" />
</fileset>
</copy>
-->
<copy todir="${package.dir}/" >
<fileset basedir="./build/help">
<include name="*.chm" />
</fileset>
</copy>
<delete dir="${build.base}/dist"/>
<mkdir dir="${build.base}/dist"/>
<zip zipfile="${build.base}/dist/${project::get-name()}-${dist.revision}-${project.config}.zip" includeemptydirs="false" >
<fileset basedir="${package.dir}/">
<include name="license.txt" />
<include name="*.msi" />
<include name="**/*.*"/>
<exclude name="**/*.CodeAnalysisLog.xml"/>
<exclude name="**/*.lastcodeanalysissucceeded"/>
</fileset>
</zip>
<zip zipfile="${build.base}/dist/${project::get-name()}-${dist.revision}-source.zip" includeemptydirs="false" >
<fileset basedir="${trunk.dir}" >
<exclude name="bin/ncover/**"/>
<exclude name="bin/ndepend/**"/>
<exclude name="**/build/**"/>
<exclude name="src/**/bin/**"/>
<exclude name="**/obj/**"/>
<exclude name="**/*.resharper*"/>
<exclude name="**/*.suo"/>
<exclude name="**/*.cache"/>
<exclude name="**/*.user"/>
<exclude name="**/_ReSharper.*/**"/>
<exclude name="**/*.CodeAnalysisLog.xml"/>
<exclude name="**/*.lastcodeanalysissucceeded"/>
<exclude name="**/*.ncb"/>
<include name="**/*.*"/>
</fileset>
</zip>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.