-
Notifications
You must be signed in to change notification settings - Fork 4
/
ExcelMapper.build
147 lines (125 loc) · 5.45 KB
/
ExcelMapper.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
139
140
141
142
143
144
145
146
147
<?xml version="1.0" ?>
<project name="ExcelMapper" default="build" xmlns="http://nant.sf.net/schemas/nant.xsd">
<!-- PROPERTIES -->
<property name ="current.dir" value="${directory::get-current-directory()}" />
<property name="build.dir" value="build" />
<property name="release.dir" value="release" />
<property name="nunit-console.exe" value="tools\nunit\bin\nunit-console-x86.exe" />
<property name="excel.dir" value="Excel" />
<property name="include.dir" value="Templates\Include" />
<property name="lib.dir" value="lib" />
<property name="BuildDTOsFromExcel.exe" value="BuildDTOsFromExcel.exe" />
<property name="Excel.dir" value="src\Samples.Tests\Excel" />
<property name="tools.dir" value="tools" />
<property name="config" value="Debug" />
<!-- User targets -->
<target name="clean" description="Delete Automated Build artifacts">
<delete dir="${build.dir}" if="${directory::exists(build.dir)}"/>
<mkdir dir="${build.dir}" />
</target>
<target name="compile" depends="clean" description="Builds project">
<msbuild project="src\ExcelMapper.sln" target="Rebuild" verbosity="quiet">
<property name="Configuration" value="debug"/>
<property name="SolutionDir" value=".." />
<arg value="/nologo"/>
</msbuild>
<copy todir="${build.dir}" overwrite="true">
<fileset basedir="src\ExcelMapper\bin\${config}">
<include name="*.*" />
</fileset>
</copy>
<copy todir="${build.dir}" overwrite="true">
<fileset basedir="src\BuildDTOsFromExcel\bin\${config}">
<include name="*.*" />
</fileset>
</copy>
<copy todir="${build.dir}" overwrite="true">
<fileset basedir="src\ExcelMapper.Tests\bin\${config}">
<include name="*" />
<include name="**\*.*" />
</fileset>
</copy>
<copy todir="${build.dir}" overwrite="true">
<fileset basedir="src\BuildDTOsFromExcel.Tests\bin\${config}">
<include name="*" />
<include name="**\*.*" />
</fileset>
</copy>
<copy todir="${build.dir}" overwrite="true">
<fileset basedir="src\Samples.Tests\bin\${config}">
<include name="*" />
<include name="**\*.*" />
</fileset>
</copy>
</target>
<target name="ExcelMapperTests">
<exec program="${nunit-console.exe}" workingdir="${build.dir}">
<arg value="ExcelMapper.Tests.dll" />
<arg value="/xml:ExcelMapperTests.xml" />
<arg value="/nologo" />
</exec>
</target>
<target name="BuildDTOsFromExcelTests">
<exec program="${nunit-console.exe}" workingdir="${build.dir}">
<arg value="BuildDTOsFromExcel.Tests.dll" />
<arg value="/xml:BuildDTOsFromExcelTests.xml" />
<arg value="/nologo" />
</exec>
</target>
<target name="SamplesTests">
<exec program="${nunit-console.exe}" workingdir="${build.dir}">
<arg value="Samples.Tests.dll" />
<arg value="/xml:SamplesTests.xml" />
<arg value="/nologo" />
</exec>
</target>
<target name="updateSampleExcel" description="Update lib folder">
<exec program="${build.dir}\${BuildDTOsFromExcel.exe}" workingdir="${build.dir}">
<arg value="..\${Excel.dir}\*.xls" />
<arg value="..\${Excel.dir}\*.xlsx" />
</exec>
<copy todir="${lib.dir}" overwrite="true">
<fileset basedir="${build.dir}">
<include name="ExcelToDTOMapper.DTO.dll" />
</fileset>
</copy>
</target>
<target name="test" depends="ExcelMapperTests, BuildDTOsFromExcelTests, SamplesTests" />
<target name="build" depends="clean, compile, test, updateSampleExcel" description="Clean, Compile, run tests" />
<target name="full" depends="build, unmerged-release, release" description="Build and zip the distributable files" />
<target name="unmerged-release" depends="build">
<mkdir dir="${build.dir}\unmerged-release" />
<copy todir="${build.dir}\unmerged-release">
<fileset basedir="${build.dir}">
<include name="BuildDTOsFromExcel.exe" />
<include name="StructureMap.dll" />
<include name="Microsoft.Practices.ServiceLocation.dll" />
<include name="RunTimeCodeGenerator.dll" />
</fileset>
</copy>
<exec program="${tools.dir}\ILMerge\ilmerge.exe"
commandline="/log /out:"${build.dir}\unmerged-release\ExcelMapper.dll" "${build.dir}\ExcelMapper.dll" /keyfile:"${current.dir}\ExcelMapper.snk"" workingdir="." />
<delete file="${build.dir}\unmerged-release\ExcelMapper.pdb" />
<zip zipfile="${release.dir}\unmerged-excelmapper.zip">
<fileset basedir="${build.dir}\unmerged-release" prefix="unmerged-release">
<include name="**/*" />
</fileset>
</zip>
</target>
<target name="release" depends="build">
<mkdir dir="${build.dir}\release" />
<exec program="${tools.dir}\ILMerge\ilmerge.exe"
commandline="/log /out:"${build.dir}\release\ExcelMapper.dll" "${build.dir}\ExcelMapper.dll" "${build.dir}\StructureMap.dll" "${build.dir}\Microsoft.Practices.ServiceLocation.dll" "${build.dir}\RunTimeCodeGenerator.dll" /keyfile:"${current.dir}\ExcelMapper.snk"" workingdir="." />
<copy todir="${build.dir}\release">
<fileset basedir="${build.dir}">
<include name="BuildDTOsFromExcel.exe" />
</fileset>
</copy>
<delete file="${build.dir}\release\ExcelMapper.pdb" />
<zip zipfile="${release.dir}\excelmapper.zip">
<fileset basedir="${build.dir}\release" prefix="release">
<include name="**/*" />
</fileset>
</zip>
</target>
</project>