-
Notifications
You must be signed in to change notification settings - Fork 8
/
default.build
263 lines (238 loc) · 9.45 KB
/
default.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE cruisecontrol [
<!ENTITY SomeEntity 'ploop'>
]>
<!--
PLEASE NOTE: This NAnt script only carries out the "install"
tasks for BooLangStudio (that is, building up and deploying
project templates
-->
<project xmlns="http://nant.sf.net/schemas/nant.xsd" name="BooLangStudio nant script" default="install">
<property name="BLS_VERSION" value="1.0_r2971"/>
<property name="CurrentDirectory" value="dummy"/>
<property name="PostDir" value="Install\Post"/>
<property name="PreDir" value="Install\Pre"/>
<property name="BoocToolPath" value="dummy"/>
<property name="CurrentFolder" value="dummy"/>
<property name="ZipFileName" value="dummy"/>
<property name="BlsBinPath_RegSafe" value="dummy"/>
<property name="BoocToolPath_RegSafe" value="dummy"/>
<property name="BooLangStudioDllPath" value="Bin"/>
<property name="MyDocsTemplatesPath" value="dummy"/>
<!-- install stuff -->
<target name="install">
<echo message="Installing BooLangStudio ${BLS_VERSION}"/>
<call target="setupProperties"/>
<call target="clean"/>
<call target="deployTemplateZips"/>
<call target="mergeBLSRegistrySettings"/>
<description>
Main task to install BooLangStudio
</description>
</target>
<target name="buildProjectTemplates">
<call target="buildProjectItemZips"/>
<description>
Build up the zips files for project templates,
also doing token substitutions to put the location
of the boo msbuild stuff in there
</description>
</target>
<target name="setupProperties">
<boo>
import System
currentDir = System.Environment.CurrentDirectory
Project.Properties['CurrentDirectory'] = currentDir
Project.Properties['BoocToolPath'] = currentDir + """\Dependencies\boo\build"""
</boo>
<echo message="CurrentDirectory: ${CurrentDirectory}"/>
<echo message="BoocToolPath: ${BoocToolPath}"/>
<description>
Setup folder paths for later steps
</description>
</target>
<target name="cleanPostFolders" depends="setupProperties">
<delete dir="${CurrentDirectory}\${PostDir}" failonerror="false"/>
<description>
Delete and recreate the folders containing
the modified zips and raw stuff
</description>
</target>
<target name="makePostFolders" depends="cleanPostFolders">
<mkdir dir="${CurrentDirectory}\${PostDir}\Zips\Projects" failonerror="true"/>
<mkdir dir="${CurrentDirectory}\${PostDir}\Zips\ProjectItems" failonerror="true"/>
<mkdir dir="${CurrentDirectory}\${PostDir}\Raw" failonerror="true"/>
</target>
<target name="clean" depends="cleanPostFolders,cleanMyDocsTemplatesDirs">
<echo message="doing folder clean-up"/>
</target>
<target name="moveAndDoTokenSubstitutionOnProjectFiles" depends="makePostFolders,setupProperties">
<foreach item="Folder" in="${CurrentDirectory}\${PreDir}\Projects" property="folder">
<boo>
Project.Properties['CurrentFolder'] = Project.Properties['folder'].Replace("Pre","""Post\Raw""")
</boo>
<mkdir dir="${CurrentFolder}"/>
<copy todir="${CurrentFolder}">
<fileset basedir="${folder}">
<include name="*.*"/>
</fileset>
<filterchain>
<replacetokens>
<token key="BOOCTOOLPATH" value="${BoocToolPath}"/>
</replacetokens>
</filterchain>
</copy>
</foreach>
<description>
Copy "pre" templates files to "post" location,
doing token substitutions in the process for
folder locations
</description>
</target>
<target name="buildProjectZips" depends="moveAndDoTokenSubstitutionOnProjectFiles">
<foreach item="Folder" in="${CurrentDirectory}\${PostDir}\Raw\Projects" property="folder">
<boo>
import System.IO
Project.Properties['ZipFileName'] = DirectoryInfo(Project.Properties['folder']).Name + ".zip"
</boo>
<zip zipfile="${CurrentDirectory}\${PostDir}\Zips\Projects\${ZipFileName}">
<fileset basedir="${folder}">
<include name="*.*"/>
</fileset>
</zip>
</foreach>
<description>
Build the Project template zip
files from the modified "post" templates
files
</description>
</target>
<target name="buildProjectItemZips" depends="buildProjectZips">
<foreach item="Folder" in="${CurrentDirectory}\${PreDir}\ProjectItems" property="folder">
<boo>
import System.IO
Project.Properties['ZipFileName'] = DirectoryInfo(Project.Properties['folder']).Name + ".zip"
</boo>
<zip zipfile="${CurrentDirectory}\${PostDir}\Zips\ProjectItems\${ZipFileName}">
<fileset basedir="${folder}">
<include name="*.*"/>
</fileset>
</zip>
</foreach>
<description>
Build the ProjectItem template zip
files for the ProjectItem files
</description>
</target>
<target name="buildModifiedRegistrySettings">
<call target="moveAndDoTokenSubstituionOnRegistryFile"/>
<description>
Does token substitutions on our "base" registry file
and copies it into the Post directory for subsequent
use
</description>
</target>
<target name="setupRegistryTokens" depends="setupProperties">
<boo>
boobinpath = Project.Properties['CurrentDirectory'] + """\""" + Project.Properties['BooLangStudioDllPath']
Project.Properties['BlsBinPath_RegSafe'] = boobinpath.Replace("""\""","""\\""")
Project.Properties['BoocToolPath_RegSafe'] = Project.Properties['BoocToolPath'].Replace("""\""","""\\""")
</boo>
<echo message="BLSBINPATH_REGSAFE: ${BlsBinPath_RegSafe}"/>
<echo message="BOOCTOOLPATH_REGSAFE: ${BoocToolPath_RegSafe}"/>
<description>
Sets up the properties items that we need in order to
do token substitution in the registry file... mainly, we have
to create of paths, and also escape all of the '\' items that
seperate folders
</description>
</target>
<target name="moveAndDoTokenSubstituionOnRegistryFile" depends="setupRegistryTokens">
<copy todir="${CurrentDirectory}\${PostDir}">
<fileset basedir="${CurrentDirectory}\${PreDir}">
<include name="BooLangStudio_install.reg"/>
</fileset>
<filterchain>
<replacetokens>
<token key="BOOCTOOLPATH_REGSAFE" value="${BoocToolPath_RegSafe}"/>
<token key="BLSBINSPATH_REGSAFE" value="${BlsBinPath_RegSafe}"/>
<token key="BLS_VERSION" value="${BLS_VERSION}"/>
</replacetokens>
</filterchain>
</copy>
<description>
Copy the "pre" registry file to our "post" folder and, in the process,
do the token substitutions
</description>
</target>
<target name="setupMyDocsProps">
<boo>
myDocs = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
Project.Properties['MyDocsTemplatesPath'] = myDocs + """\Visual Studio 2008\Templates"""
</boo>
</target>
<target name="cleanMyDocsTemplatesDirs" depends="setupMyDocsProps">
<delete dir="${MyDocsTemplatesPath}\ProjectTemplates\Boo" failonerror="false"/>
<delete dir="${MyDocsTemplatesPath}\ItemTemplates\Boo" failonerror="false"/>
</target>
<target name="makeMyDocsTemplatesDirs" depends="cleanMyDocsTemplatesDirs">
<mkdir dir="${MyDocsTemplatesPath}\ItemTemplates\Boo" failonerror="true"/>
<mkdir dir="${MyDocsTemplatesPath}\ProjectTemplates\Boo" failonerror="true"/>
</target>
<target name="deployTemplateZips" depends="buildProjectTemplates,makeMyDocsTemplatesDirs">
<copy todir="${MyDocsTemplatesPath}\ItemTemplates\Boo">
<fileset basedir="${CurrentDirectory}\${PostDir}\Zips\ProjectItems">
<include name="*.zip"/>
</fileset>
</copy>
<copy todir="${MyDocsTemplatesPath}\ProjectTemplates\Boo">
<fileset basedir="${CurrentDirectory}\${PostDir}\Zips\Projects">
<include name="*.zip"/>
</fileset>
</copy>
</target>
<target name="mergeBLSRegistrySettings" depends="moveAndDoTokenSubstituionOnRegistryFile">
<exec program="regedit.exe">
<arg line='/s "${CurrentDirectory}\${PostDir}\BooLangStudio_install.reg"'/>
</exec>
</target>
<!-- uninstall stuff -->
<target name="uninstall">
<echo message="This task currently does nothing. Good day, sir!"/>
<description>
Main task to uninstall BooLangStudio. Currently useless.
</description>
</target>
<!-- installer zip stuff -->
<target name="cleanInstallZip" depends="setupProperties">
<delete>
<fileset basedir="${CurrentDirectory}">
<include name="*.zip"/>
</fileset>
</delete>
</target>
<target name="buildInstallZip" depends="cleanInstallZip,clean">
<zip zipfile="BooLangStudio_${BLS_VERSION}.zip">
<fileset basedir="${CurrentDirectory}\Bin" prefix="Bin">
<include name="**/*"/>
</fileset>
<fileset basedir="${CurrentDirectory}">
<include name=".\*.txt"/>
<include name=".\install.bat"/>
<include name=".\default.build"/>
</fileset>
<fileset basedir="${CurrentDirectory}\Dependencies\boo\build" prefix="Dependencies\boo\build">
<include name="**/*"/>
</fileset>
<fileset basedir="${CurrentDirectory}\Dependencies\nant" prefix="Dependencies\nant">
<include name="**/*"/>
</fileset>
<fileset basedir="${CurrentDirectory}\Install\Pre" prefix="Install\Pre">
<include name="**/*"/>
</fileset>
</zip>
<description>
Build the standalone installer zip file
</description>
</target>
</project>