-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
163 lines (147 loc) · 6.15 KB
/
build.xml
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
<project
name="2027"
xmlns:ac="antlib:net.sf.antcontrib"
>
<property file="build.properties" />
<property name="DIR_ANT" value="${SOURCE_PATH}/ant" />
<property name="DIR_LOCALE" value="${SOURCE_PATH}/locale" />
<property name="DIR_SRC" value="${SOURCE_PATH}/src" />
<property name="DIR_UTILS" value="${SOURCE_PATH}/utils" />
<property name="DIR_TEMP" value="${WORK_PATH}/temp" />
<path id="antlibs.classpath">
<fileset dir="${DIR_ANT}">
<include name="*.jar" />
</fileset>
</path>
<typedef uri="antlib:net.sf.antcontrib" classpathref="antlibs.classpath" />
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="antlibs.classpath" />
<!-- Build package ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<target name="UpdatePackage" description="Update package">
<input
message="Package name:"
addproperty="UCC_PACKAGE"
validargs="Game,GameSFX,SupportBots,DeusEx"
defaultvalue="Game" />
<ucc package="${UCC_PACKAGE}" />
<copy file="${WORK_PATH}/System/${UCC_PACKAGE}.u" tofile="${WORK_PATH}/2027/System/${UCC_PACKAGE}.u" />
</target>
<!-- Build game texts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<target name="UpdateTexts" description="Update texts">
<!-- Build texts -->
<ucc package="GameTextRus" />
<copy file="${WORK_PATH}/System/GameTextRus.u" tofile="${WORK_PATH}/2027/System/GameText.rus_u" />
<ucc package="GameTextEng" />
<copy file="${WORK_PATH}/System/GameTextEng.u" tofile="${WORK_PATH}/2027/System/GameText.eng_u" />
<!-- Build conversations -->
<delete>
<fileset dir="${WORK_PATH}/System">
<include name="GameConversations*" />
</fileset>
</delete>
<delete>
<fileset dir="${WORK_PATH}/2027/System">
<include name="GameConversations*" />
</fileset>
</delete>
<ucc package="GameConversationsRus" />
<copy todir="${DIR_TEMP}">
<fileset dir="${WORK_PATH}/System">
<include name="GameConversationsRus*" />
</fileset>
</copy>
<move file="${DIR_TEMP}/GameConversationsRus.u" tofile="${WORK_PATH}/2027/System/GameConversations.rus_u"/>
<move file="${DIR_TEMP}/GameConversationsRusText.u" tofile="${WORK_PATH}/2027/System/GameConversationsText.rus_u"/>
<ucc package="GameConversationsEng" />
<copy todir="${DIR_TEMP}">
<fileset dir="${WORK_PATH}/System">
<include name="GameConversationsEng*" />
</fileset>
</copy>
<move file="${DIR_TEMP}/GameConversationsEng.u" tofile="${WORK_PATH}/2027/System/GameConversations.eng_u"/>
<move file="${DIR_TEMP}/GameConversationsEngText.u" tofile="${WORK_PATH}/2027/System/GameConversationsText.eng_u"/>
<move file="${DIR_TEMP}/GameConversationsEngAudioChapter1.u" tofile="${WORK_PATH}/2027/System/GameConversationsAudioChapter1.u"/>
<move file="${DIR_TEMP}/GameConversationsEngAudioChapter2.u" tofile="${WORK_PATH}/2027/System/GameConversationsAudioChapter2.u"/>
<move file="${DIR_TEMP}/GameConversationsEngAudioChapter3.u" tofile="${WORK_PATH}/2027/System/GameConversationsAudioChapter3.u"/>
<move file="${DIR_TEMP}/GameConversationsEngAudioChapter4.u" tofile="${WORK_PATH}/2027/System/GameConversationsAudioChapter4.u"/>
<move file="${DIR_TEMP}/GameConversationsEngAudioChapter5.u" tofile="${WORK_PATH}/2027/System/GameConversationsAudioChapter5.u"/>
<move file="${DIR_TEMP}/GameConversationsEngAudioChapter6.u" tofile="${WORK_PATH}/2027/System/GameConversationsAudioChapter6.u"/>
<move file="${DIR_TEMP}/GameConversationsEngAudioCutScenes.u" tofile="${WORK_PATH}/2027/System/GameConversationsAudioCutScenes.u"/>
<move file="${DIR_TEMP}/GameConversationsEngAudioNPCBarks.u" tofile="${WORK_PATH}/2027/System/GameConversationsAudioNPCBarks.u"/>
<!-- Localization -->
<delete>
<fileset dir="${DIR_TEMP}">
<include name="*.rus" />
<include name="*.eng" />
</fileset>
</delete>
<copy todir="${DIR_TEMP}" overwrite="true">
<fileset dir="${DIR_LOCALE}">
<include name="**/*" />
</fileset>
</copy>
<iconv dir="${DIR_TEMP}" locale="rus" />
<iconv dir="${DIR_TEMP}" locale="eng" />
<copy todir="${WORK_PATH}/System" preservelastmodified="true" failonerror="false" verbose="true">
<fileset dir="${DIR_TEMP}">
<include name="*.rus" />
<include name="*.eng" />
</fileset>
</copy>
<delete>
<fileset dir="${WORK_PATH}/System">
<include name="GameConversations*" />
<include name="GameText*" />
</fileset>
</delete>
<delete>
<fileset dir="${DIR_TEMP}">
<include name="GameConversations*" />
</fileset>
</delete>
<delete>
<fileset dir="${DIR_TEMP}">
<include name="*.rus" />
<include name="*.eng" />
</fileset>
</delete>
</target>
<!-- Macroses ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<macrodef name="iconv">
<attribute name="dir" />
<attribute name="locale" />
<sequential>
<delete file="${DIR_TEMP}/locale.temp" failonerror="false" />
<ac:for param="file">
<fileset dir="@{dir}">
<include name="*.@{locale}" />
</fileset>
<sequential>
<exec executable="${DIR_UTILS}/iconv.exe" output="${DIR_TEMP}/locale.temp" failonerror="true">
<arg line='-f UTF-8'/>
<arg line='-t CP1251'/>
<arg line='-c'/>
<arg line='"@{file}"'/>
</exec>
<copy tofile="@{file}" file="${DIR_TEMP}/locale.temp" />
<delete file="${DIR_TEMP}/locale.temp" failonerror="false" />
</sequential>
</ac:for>
</sequential>
</macrodef>
<macrodef name="ucc">
<attribute name="package"/>
<sequential>
<echo message="Building package @{package}.u" />
<copy todir="${WORK_PATH}" preservelastmodified="true">
<fileset dir="${DIR_SRC}">
<include name="**/*" />
</fileset>
</copy>
<delete file="${WORK_PATH}/System/@{package}.u" includeemptydirs="true" />
<delete file="${WORK_PATH}/2027/System/@{package}.u" includeemptydirs="true" />
<exec executable="${WORK_PATH}/System/ucc.exe" failonerror="false">
<arg line='make'/>
</exec>
</sequential>
</macrodef>
</project>