forked from mdvorak/phoenix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Phoenix.build
227 lines (192 loc) · 8.08 KB
/
Phoenix.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
<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://nant.sf.net/release/0.86-beta1/nant.xsd"
name="Phoenix 0.7" default="build" basedir=".">
<!-- System Properties -->
<property name="debug" value="true" overwrite="false" />
<!-- User Properties -->
<property name="dir.sandcastle" value="C:\Program Files (x86)\EWSoftware\Sandcastle Help File Builder" />
<!-- Support properties -->
<property name="build.config" value="Debug" if="${debug}" />
<property name="build.config" value="Release" unless="${debug}" />
<property name="dir.solution" value="${directory::get-current-directory()}" />
<property name="dir.src" value="${dir.solution}\src" />
<property name="dir.output" value="${dir.solution}\out\bin" />
<property name="dir.help" value="${dir.solution}\out\help" />
<property name="dir.tmp" value="${dir.solution}\out\build" />
<property name="file.build" value="${project::get-buildfile-path()}" />
<property name="delete.tmp" value="true" />
<!-- Public targets -->
<target name="release" description="Builds all projects to their respective folders">
<nant buildfile="${file.build}" target="clean generate_tlb build help" inheritall="true">
<properties>
<property name="debug" value="false" />
</properties>
</nant>
<nant target="generate_changelog pack"/>
</target>
<target name="build" depends="clean,compile" description="Builds all projects to their respective folders">
<!-- Remove pdb files for release build -->
<delete unless="${debug}">
<fileset basedir="${dir.tmp}">
<include name="*.pdb" />
</fileset>
</delete>
<copy todir="${dir.output}">
<fileset basedir="${dir.tmp}">
<include name="Boo.Lang*.dll" />
<include name="MagicLibrary.dll" />
<include name="XPTable.dll" />
<include name="ICSharpCode.TextEditor.dll" />
<include name="Phoenix.dll" />
<include name="Phoenix.pdb" />
<include name="Phoenix.dll.xml" />
<include name="Phoenix.dll.config" />
<include name="PhoenixShared.dll" />
<include name="PhoenixShared.pdb" />
<include name="PhoenixShared.dll.xml" />
<include name="MulLib.dll" />
<include name="MulLib.pdb" />
<include name="MulLib.dll.xml" />
<include name="Native.dll" />
<include name="UOEncryption.dll" />
<include name="UOEncryption.NET.dll" />
<include name="PhoenixLauncher.exe" />
<include name="PhoenixLauncher.exe.config" />
<include name="UOKeys.cfg" />
<include name="SharpEditor.exe" />
<include name="SharpEditor.exe.config" />
<include name="*.xshd" />
</fileset>
</copy>
<copy todir="${dir.output}/cs-CZ">
<fileset basedir="${dir.tmp}/cs-CZ">
<include name="*.dll" />
</fileset>
</copy>
<!-- Plugins -->
<mkdir dir="${dir.output}\Plugins" />
<copy todir="${dir.output}\Plugins">
<fileset basedir="${dir.tmp}">
<include name="Phoenix.SkillsTab.dll" />
<include name="Phoenix.Speech.dll" />
<include name="Phoenix.Speech.dll.xml" />
<include name="Phoenix.Mp3.dll" />
<include name="Phoenix.Mp3.dll.xml" />
</fileset>
</copy>
<!-- Rest -->
<mkdir dir="${dir.output}\Profiles" />
<mkdir dir="${dir.output}\Scripts" />
<copy file="${dir.solution}\UOKeys.cfg" todir="${dir.output}" />
<!-- Delete tmp directory -->
<delete dir="${dir.tmp}" if="${delete.tmp}" includeemptydirs="true" failonerror="false" />
</target>
<target name="clean" description="Deletes current output directory">
<delete failonerror="false">
<fileset basedir="${dir.output}">
<include name="**\*"/>
</fileset>
</delete>
<delete failonerror="false">
<fileset basedir="${dir.help}">
<include name="**\*"/>
</fileset>
</delete>
<delete dir="${dir.tmp}" failonerror="false" />
<mkdir dir="${dir.output}" />
</target>
<target name="clean-all" description="Deletes output directory and all intermediate build files">
<delete failonerror="false">
<fileset basedir="${dir.solution}\out">
<include name="**\*" />
</fileset>
</delete>
<mkdir dir="${dir.solution}\out" failonerror="false" />
<delete failonerror="false">
<fileset>
<include name="${dir.src}\**\bin\**\*" />
<include name="${dir.src}\**\obj\**\*" />
</fileset>
</delete>
</target>
<target name="tlb" depends="clean,generate_tlb" description="Generates Phoenix.tlb from .NET assembly">
<!-- Delete tmp directory -->
<delete dir="${dir.tmp}" if="${delete.tmp}" includeemptydirs="true" failonerror="false" />
</target>
<target name="help" depends="clean,build" description="Builds web help">
<fail message="Use -D:debug=false" if="${debug}" />
<msbuild project="${dir.solution}\Phoenix.shfbproj" target="Rebuild">
<property name="Configuration" value="Release" />
<property name="Platform" value="x86" />
<property name="OutputPath" value="${dir.help}" />
<property name="SHFBROOT" value="${dir.sandcastle}" />
</msbuild>
</target>
<!-- Private targets -->
<target name="compile" depends="compile_net,compile_native,compile_editor">
</target>
<target name="compile_net" depends="prepare_libs">
<msbuild project="${dir.solution}\PhoenixCS.sln" target="Rebuild">
<property name="Configuration" value="${build.config}" />
<property name="Platform" value="x86" />
<property name="OutputPath" value="${dir.tmp}" />
</msbuild>
</target>
<target name="compile_native" depends="prepare_libs">
<property name="file.vcprops" value="${dir.tmp}\vc.vsprops" />
<echo file="${file.vcprops}" message="<?xml version="1.0"?>" append="false" />
<echo file="${file.vcprops}" message="<VisualStudioPropertySheet ProjectType="Visual C++" Version="8.00" Name="nant"" append="true" />
<echo file="${file.vcprops}" message=" OutputDirectory="${dir.tmp}"> </VisualStudioPropertySheet>" append="true" />
<msbuild project="${dir.solution}\PhoenixC.sln" target="Rebuild">
<property name="Configuration" value="${build.config}" />
<property name="Platform" value="x86" />
<property name="OutputPath" value="${dir.tmp}" />
<property name="VCBuildOverride" value="${file.vcprops}" />
</msbuild>
</target>
<target name="compile_editor" depends="prepare_libs">
<msbuild project="${dir.solution}\SharpEditor.sln" target="Rebuild">
<property name="Configuration" value="${build.config}" />
<property name="Platform" value="x86" />
<property name="OutputPath" value="${dir.tmp}" />
<property name="BooBinPath" value="${dir.solution}\lib" />
</msbuild>
</target>
<target name="prepare_libs">
<!-- Copy libraries to tmp dir -->
<copy todir="${dir.tmp}">
<fileset basedir="${dir.solution}\lib">
<include name="*" />
</fileset>
</copy>
</target>
<target name="generate_tlb" depends="compile_net" description="Generates Phoenix.tlb from .NET assembly">
<exec program="${dir.tmp}\tlbexp.exe" workingdir="${dir.tmp}">
<arg value="Phoenix.dll" />
</exec>
<copy file="${dir.tmp}\Phoenix.tlb" tofile="${dir.solution}\Phoenix.tlb" overwrite="true" />
</target>
<target name="generate_changelog">
<script language="C#" failonerror="true">
<references>
<include name="System.dll" />
</references>
<code>
<![CDATA[
public static void ScriptMain(Project project) {
System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("git", "log > out/bin/changelog.txt");
psi.UseShellExecute = true;
System.Diagnostics.Process.Start(psi).WaitForExit();
}
]]>
</code>
</script>
</target>
<target name="pack">
<zip zipfile="${dir.solution}/out/phoenix.zip">
<fileset basedir="${dir.output}" prefix="Phoenix">
<include name="**/*" />
</fileset>
</zip>
</target>
</project>