forked from pjvds/ncqrs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMAIN.build
138 lines (127 loc) · 5.37 KB
/
MAIN.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?xml version="1.0" ?>
<project name="NAnt Examples" xmlns="http://nant.sf.net/release/0.91-alpha1/nant.xsd" default="build">
<property name="nant.settings.currentframework" value="net-4.0" />
<property name="root.dir" value="" />
<property name="project.version" value="0.8.0" />
<property name="project.config" value="debug" />
<property name="project.framework.bin" value="Framework\src\Ncqrs\bin\${project.config}" />
<property name="msbuild" value="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe" dynamic="true" />
<property name="release.dir" value="release" />
<property name="release.version" value="${project.version}" />
<if test="${property::exists('build.number')}">
<property name="release.version" value="${project.version}.${build.number}"/>
</if>
<target name="build">
<echo message="Building release ${release.version}" />
<call target="BuildFramework" />
<call target="RunTestsForFramework" />
<call target="UpdateLibForExtensions" />
<call target="BuildExtensions" />
<call target="UpdateLibForMyNotesSample" />
<call target="MakeRelease" />
</target>
<target name="BuildFramework">
<echo message="START BUILDING FRAMEWORK" />
<!-- TODO: Solution target does not support 4.0 yet -->
<!-- <solution solutionfile="Framework\NcqrsFramework.sln" configuration="debug" />-->
<asminfo output="Framework\AssemblyInfo.cs" language="CSharp">
<imports>
<import namespace="System" />
<import namespace="System.Reflection" />
<import namespace="System.Runtime.CompilerServices" />
<import namespace="System.Runtime.InteropServices " />
</imports>
<attributes>
<attribute type="AssemblyTitleAttribute" value="Ncqrs" />
<attribute type="AssemblyDescriptionAttribute" value="The CQRS Framework for .NET" />
<attribute type="AssemblyVersionAttribute" value="${project.version}" />
<attribute type="CLSCompliantAttribute" value="true" />
<attribute type="ComVisibleAttribute" value="false" />
<attribute type="AssemblyCopyrightAttribute" value="Copyright (c) 2010, Ncqrs.org" />
<attribute type="InternalsVisibleToAttribute" value="Ncqrs.Tests" />
<attribute type="InternalsVisibleToAttribute" value="Ncqrs.Spec" />
</attributes>
<references>
<include name="System.dll" />
<include name="System.Core.dll" />
</references>
</asminfo>
<exec program="${msbuild}">
<arg value="Framework\NcqrsFramework.sln" />
<arg value="/p:Configuration=${project.config}" />
</exec>
<copy todir="${release.dir}">
<fileset basedir="Framework\src\Ncqrs\bin\${project.config}">
<include name="Ncqrs.dll" />
<include name="Ncqrs.pdb" />
<include name="Ncqrs.xml" />
<include name="Newtonsoft.Json.dll" />
<include name="Newtonsoft.Json.pdb" />
<include name="log4net.dll" />
</fileset>
</copy>
</target>
<target name="BuildExtensions" depends="UpdateLibForExtensions">
<exec program="${msbuild}">
<arg value="Extensions\NcqrsExtensions.sln" />
<arg value="/p:Configuration=${project.config}" />
<!--<arg value="/t:rebuild" />-->
</exec>
</target>
<target name="RunTestsForFramework" depends="BuildFramework">
<echo message="START RUNNING TESTS FOR FRAMEWORK" />
<nunit2>
<formatter type="Plain" />
<test assemblyname="Framework\src\Ncqrs.Tests\bin\Debug\Ncqrs.Tests.dll" />
</nunit2>
</target>
<target name="UpdateLibForExtensions" depends="BuildFramework">
<echo message="Updating Extensions lib folder" />
<copy todir="Extensions\lib\Ncqrs" flatten="false" overwrite="true">
<fileset basedir="Framework\src\Ncqrs\bin\${project.config}">
<include name="**/*" />
</fileset>
</copy>
</target>
<target name="UpdateLibForMyNotesSample" depends="BuildFramework">
<echo message="Updating MyNotes lib folder" />
<copy todir="Samples\MyNotes\lib\Ncqrs" flatten="false" overwrite="true">
<fileset basedir="Framework\src\Ncqrs\bin\${project.config}">
<include name="**/*" />
</fileset>
</copy>
<copy todir="Samples\MyNotes\lib\Ncqrs.Config.StructureMap" flatten="false" overwrite="true">
<fileset basedir="Extensions\src\Ncqrs.Config.StructureMap\bin\${project.config}">
<include name="**/*" />
</fileset>
</copy>
</target>
<target name="MakeRelease" depends="BuildFramework">
<!-- Start with a new release directory -->
<delete dir="${release.dir}" />
<copy todir="${release.dir}\Framework">
<fileset basedir="Framework\src\Ncqrs\bin\${project.config}">
<include name="Ncqrs.dll" />
<include name="Ncqrs.pdb" />
<include name="Ncqrs.xml" />
<include name="Newtonsoft.Json.dll" />
<include name="Newtonsoft.Json.pdb" />
<include name="log4net.dll" />
</fileset>
</copy>
<copy todir="${release.dir}\Spec">
<fileset basedir="Framework\src\Ncqrs.Spec\bin\${project.config}">
<include name="Ncqrs.Spec.dll" />
<include name="Ncqrs.Spec.pdb" />
<include name="Ncqrs.Spec.xml" />
<include name="nunit.framework.dll" />
<include name="nunit.framework.xml" />
</fileset>
</copy>
<zip zipfile="${release.dir}\Ncqrs${release.version}.zip">
<fileset basedir="${release.dir}">
<include name="**/*" />
</fileset>
</zip>
</target>
</project>