-
Notifications
You must be signed in to change notification settings - Fork 0
/
woofy.build
158 lines (133 loc) · 6.46 KB
/
woofy.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
148
149
150
151
152
153
154
155
156
157
158
<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://nant.sf.net/release/0.91-alpha2/nant.xsd"
name="Woofy"
default="all">
<property name="configuration" value="Release"/>
<property name="version.Major" value="1" />
<property name="version.Minor" value="2" />
<property name="version.BuildNumber" value="5" />
<property name="version.Revision" value="0" />
<property name="dir.Current" value="${directory::get-current-directory()}"/>
<property name="dir.App" value="${dir.Current}\src\Woofy"/>
<property name="dir.Build" value="${dir.Current}\build" />
<property name="dir.Source" value="${dir.Build}\src" />
<property name="dir.BuildTemplates" value="${dir.Current}\build-files"/>
<property name="dir.ComicDefinitions" value="${dir.Current}\src\ComicDefinitions" />
<property name="dir.Woofy" value="${dir.Source}\bin\${configuration}" />
<property name="file.PlaintextChangelog" value="${dir.Build}\changelog.txt"/>
<property name="date.Now" value="${datetime::now()}"/>
<property name="date.Today" value="${datetime::get-year(date.Now)}-${string::pad-left(int::to-string(datetime::get-month(date.Now)), 2, '0')}-${string::pad-left(int::to-string(datetime::get-day(date.Now)), 2, '0')}"/>
<property name="woofy.Version" value="${version.Major}.${version.Minor}${version.BuildNumber}" />
<property name="woofy.ZipFileName" value="Woofy-${woofy.Version}.zip"/>
<property name="woofy.ZipFile" value="${dir.Build}\${woofy.ZipFileName}"/>
<property name="woofy.ExeFileName" value="Woofy-${woofy.Version}-setup.exe"/>
<property name="woofy.ExeFile" value="${dir.Build}\${woofy.ExeFileName}" />
<target name="recreate-build-folder">
<delete dir="${dir.Build}" />
<mkdir dir="${dir.Build}"/>
</target>
<target name="read-hg-revision" depends="recreate-build-folder">
<exec program="hg" commandline="tip -g --template {rev}" output="${dir.Build}\hg-rev.txt" />
<loadfile file="${dir.Build}\hg-rev.txt" property="version.Revision" />
</target>
<target name="copy-sources-to-intermediary-folder" depends="recreate-build-folder">
<copy todir="${dir.Source}">
<fileset basedir="${dir.App}" >
<include name="**.*" />
<exclude name="bin\**" />
<exclude name="obj\**" />
</fileset>
</copy>
<copy todir="${dir.Build}\packages">
<fileset basedir="${dir.Current}\src\packages">
<include name="**.*"/>
</fileset>
</copy>
<copy file="${dir.BuildTemplates}\AssemblyInfo.template" tofile="${dir.Source}\Properties\AssemblyInfo.cs" overwrite="true">
<filterchain>
<replacetokens>
<token key="MAJOR" value="${version.Major}" />
<token key="MINOR" value="${version.Minor}" />
<token key="BUILDNUMBER" value="${version.BuildNumber}" />
<token key="REVISION" value="${string::trim(version.Revision)}" />
</replacetokens>
</filterchain>
</copy>
</target>
<target name="compile" depends="copy-sources-to-intermediary-folder" >
<msbuild project="${dir.Source}\Woofy.csproj" target="Clean"/>
<msbuild project="${dir.Source}\Woofy.csproj" target="Build">
<property name="Configuration" value="${configuration}" />
</msbuild>
</target>
<target name="copyToBuild" depends="compile">
<copy todir="${dir.Build}\definitions">
<fileset basedir="${dir.ComicDefinitions}">
<include name="*.def"/>
</fileset>
</copy>
<copy todir="${dir.Build}\Woofy">
<fileset basedir="${dir.Woofy}">
<include name="**.*"/>
<exclude name="*.xml"/>
<exclude name="*.pdb"/>
</fileset>
<filterchain>
<replacetokens>
<token key="WOOFYVERSION" value="${woofy.Version}" />
</replacetokens>
</filterchain>
</copy>
<copy todir="${dir.Build}\Woofy\definitions">
<fileset basedir="${dir.ComicDefinitions}">
<include name="*.def"/>
</fileset>
</copy>
<copy todir="${dir.Build}">
<fileset basedir="${dir.BuildTemplates}">
<include name="*.*" />
</fileset>
<filterchain>
<replacetokens>
<token key="APPVERSION" value="${woofy.Version}" />
<token key="APPFULLVERSION" value="${woofy.Version}" />
<!--<token key="WOOFYEXEFILENAME" value="${woofy.ExeFileName}" />
<token key="TODAY" value="${date.Today}" />-->
</replacetokens>
</filterchain>
</copy>
</target>
<target name="zipFiles" depends="copyToBuild" >
<zip zipfile="${woofy.ZipFile}">
<fileset basedir="${dir.Build}">
<include name="Woofy\**.*"/>
</fileset>
</zip>
</target>
<target name="createInstallers" depends="zipFiles"
>
<exec program="tools\Inno Setup\ISCC.exe" commandline='"${dir.Build}\setup.iss"' />
</target>
<target name="updateAutoUpdateFiles" depends="createInstallers">
<property name="woofy.ExeFileSize" value="${file::get-length(woofy.ExeFile)}"/>
<!-- After the installers are created, copy the auto-update files again because we now have the the file size tokens -->
<copy todir="${dir.Build}" overwrite="true">
<fileset basedir="${dir.BuildTemplates}">
<include name="updatesDescriptionFile.xml" />
<include name="pad_file.xml" />
</fileset>
<filterchain>
<replacetokens>
<token key="WOOFYVERSION" value="${woofy.Version}" />
<token key="WOOFYEXEFILESIZE" value="${woofy.ExeFileSize}" />
<token key="TODAY" value="${date.Today}" />
<token key="TODAYYEAR" value="${datetime::get-year(date.Now)}" />
<token key="TODAYMONTH" value="${datetime::get-month(date.Now)}" />
<token key="TODAYDAY" value="${datetime::get-day(date.Now)}" />
</replacetokens>
</filterchain>
</copy>
</target>
<target name="all" depends="createInstallers">
</target>
</project>