-
Notifications
You must be signed in to change notification settings - Fork 203
/
SharpArch.build
119 lines (104 loc) · 5.01 KB
/
SharpArch.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?xml version="1.0" ?>
<!--EXTERNAL_PROPERTIES: build.number -->
<!--EXTERNAL_PROPERTIES: build.vcs.number.1 -->
<project name="SharpArch" default="build-and-package" xmlns="http://nant.sf.net/schemas/nant.xsd">
<property name="nant.settings.currentframework" value="net-3.5" />
<property name="project.config" value="debug" />
<property name="company.name" value="Codai, LLC"/>
<!-- Version -->
<property name="version.major" value="1"/>
<property name="version.minor" value="0"/>
<property name="version.build" value="0"/>
<property name="version.revision" value="0" />
<property name="project.fullversion" value="${version.major}.${version.minor}.${version.revision}" dynamic="true" />
<!-- Directories and files -->
<property name="build.dir" value="build" />
<property name="solution.dir" value="src\${project::get-name()}"/>
<property name="solution.file" value="${solution.dir}\${project::get-name()}.sln"/>
<property name="results.dir" value="${build.dir}\results" />
<property name="docs.dir" value="docs" />
<!-- Assemblies -->
<property name="test.assembly" value="${project::get-name()}.Tests.dll" />
<!-- User targets -->
<target name="build-and-package" depends="build, package"></target>
<target name="build" depends="compile, test"></target>
<target name="clean" description="Delete Automated Build artifacts">
<delete dir="${build.dir}" if="${directory::exists(build.dir)}"/>
</target>
<target name="version" description="Generate AssemblyInfo">
<property name="version.build" value="${build.number}" if="${property::exists('build.number')}"/>
<property name="version.revision" value="${build.vcs.number.1}" if="${property::exists('build.vcs.number.1')}" />
<echo message="Marking build with version ${project.fullversion}" />
<delete file="${solution.dir}/CommonAssemblyInfo.cs" failonerror="false"/>
<asminfo output="${solution.dir}/CommonAssemblyInfo.cs" language="CSharp">
<imports>
<import namespace="System.Reflection" />
<import namespace="System.Runtime.InteropServices" />
</imports>
<attributes>
<attribute type="ComVisibleAttribute" value="false" />
<attribute type="AssemblyVersionAttribute" value="${project.fullversion}" />
<attribute type="AssemblyFileVersionAttribute" value="${project.fullversion}" />
<attribute type="AssemblyInformationalVersionAttribute" value="${project.fullversion}" />
<attribute type="AssemblyCopyrightAttribute" value="Copyright © ${company.name} ${datetime::get-year(datetime::now())}" />
<attribute type="AssemblyCompanyAttribute" value="${company.name}" />
<attribute type="AssemblyConfigurationAttribute" value="${project.config}" />
<attribute type="AssemblyTrademarkAttribute" value="" />
<attribute type="AssemblyCultureAttribute" value="" />
</attributes>
<references>
<include name="System.dll" />
</references>
</asminfo>
</target>
<target name="compile" description="Compiles the solution" depends="clean, version">
<exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
commandline='${solution.file} /t:Clean /p:Configuration=${project.config} /p:Platform="Any CPU" /v:q'
workingdir="." />
<exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
commandline='${solution.file} /t:Rebuild /p:Configuration=${project.config} /p:Platform="Any CPU" /v:q'
workingdir="." />
</target>
<target name="move-for-test" depends="compile">
<copy todir="${build.dir}" flatten="true">
<fileset basedir="${solution.dir}">
<include name="/**/bin/${project.config}/**" />
</fileset>
</copy>
</target>
<target name="test" depends="move-for-test">
<nunit2 failonerror="true" verbose="true">
<formatter type="Xml" outputdir="${results.dir}" usefile="true" extension=".xml"/>
<formatter type="Plain" />
<test assemblyname="${build.dir}/${test.assembly}" />
</nunit2>
</target>
<target name="package" depends="compile">
<zip zipfile="${build.dir}\${project::get-name()}-bin-${project.config}-${project.fullversion}.zip">
<fileset basedir="${build.dir}" prefix="bin">
<include name="*.*" />
</fileset>
<fileset basedir="${docs.dir}" prefix="doc">
<include name="*.*" />
</fileset>
</zip>
<zip zipfile="${build.dir}\${project::get-name()}-source-${project.fullversion}.zip">
<fileset basedir=".">
<include name="*.*" />
<include name="src/**/*.*" />
<include name="bin/**/*.*" />
<exclude name="**/*.user" />
<exclude name="**/*.cache" />
<exclude name="**/*.suo" />
<exclude name="src/**/bin/**" />
<exclude name="**/obj/**" />
<exclude name="**/_ReSharper.*/**" />
</fileset>
</zip>
<zip zipfile="${build.dir}\${project::get-name()}-VSTemplate-${project.config}-${project.fullversion}.zip">
<fileset basedir=".">
<include name="VisualStudioTemplate/**/*.*" />
</fileset>
</zip>
</target>
</project>