-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_gen.xml
More file actions
183 lines (164 loc) · 6.54 KB
/
Copy pathbuild_gen.xml
File metadata and controls
183 lines (164 loc) · 6.54 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<project>
<target name="auto_gen_library">
<if>
<and>
<not>
<equals arg1="${library.name}" arg2="" />
</not>
<not>
<available file="${config.dir.src}/${library.name}" type="dir" />
</not>
</and>
<then>
<property name="project.dir" value="${config.dir.src}/${library.name}" />
<copy todir="${project.dir}" includeemptydirs="true">
<fileset dir="${config.dir.template}/library_project">
<include name="bin" />
<include name="lib" />
<include name="rsl" />
<include name=".lib" />
<include name=".rsl" />
<include name="src" />
<include name=".islibrary" />
<include name=".dependlib" />
<include name=".dependrsl" />
<include name="template.xml" />
</fileset>
</copy>
<move file="${project.dir}/template.xml" tofile="${project.dir}/${library.name}.xml" />
<replace file="${project.dir}/${library.name}.xml" token="@@project_name@@" value="${library.name}" />
<move todir="${project.dir}/src/${library.name}">
<fileset dir="${project.dir}/src">
<include name="**/*" />
</fileset>
</move>
<antcall target="auto_gen_library_setting">
<param name="project.dir" value="${project.dir}" />
</antcall>
</then>
<elseif>
<available file="${config.dir.src}/${library.name}" type="dir" />
<then>
<echo>The project "${library.name}" is exist!!</echo>
</then>
</elseif>
<else>
<echo>You have to enter a name</echo>
</else>
</if>
</target>
<target name="auto_gen_project">
<if>
<and>
<not>
<equals arg1="${project.name}" arg2="" />
</not>
<not>
<available file="${config.dir.src}/${project.name}" type="dir" />
</not>
</and>
<then>
<property name="project.dir" value="${config.dir.src}/${project.name}" />
<copy todir="${project.dir}" includeemptydirs="true">
<fileset dir="${config.dir.template}/project">
<exclude name="src/.*" />
<include name="bin" />
<include name="lib" />
<include name="rsl" />
<include name=".lib" />
<include name=".rsl" />
<include name="src" />
<include name="src/" />
<include name=".dependlib" />
<include name=".dependrsl" />
<include name="template.xml" />
</fileset>
</copy>
<move file="${project.dir}/template.xml" tofile="${project.dir}/${project.name}.xml" />
<replace file="${project.dir}/${project.name}.xml" token="@@project_name@@" value="${project.name}" />
<move todir="${project.dir}/src/${project.name}">
<fileset dir="${project.dir}/src">
<exclude name="**/template.as" />
<include name="**/*" />
</fileset>
</move>
<move file="${project.dir}/src/template.as" tofile="${project.dir}/src/${project.name}.as" />
<replace file="${project.dir}/src/${project.name}.as" token="@@project_name@@" value="${project.name}" />
<antcall target="auto_gen_project_setting">
<param name="project.dir" value="${project.dir}" />
</antcall>
</then>
<elseif>
<available file="${config.dir.src}/${project.name}" type="dir" />
<then>
<echo>The project "${project.name}" is exist!!</echo>
</then>
</elseif>
<else>
<echo>You have to enter a name</echo>
</else>
</if>
</target>
<target name="auto_gen_setting">
<if>
<available file="${project.dir}/.islibrary"/>
<then>
<antcall target="auto_gen_library_setting">
<param name="project.dir" value="${project.dir}" />
</antcall>
</then>
<else>
<antcall target="auto_gen_project_setting">
<param name="project.dir" value="${project.dir}" />
</antcall>
</else>
</if>
</target>
<target name="auto_gen_library_setting">
<basename file="${project.dir}" property="project.name" />
<copy todir="${project.dir}">
<fileset dir="${config.dir.template}/library_project">
<include name=".settings/" />
<include name=".actionScriptProperties" />
<include name=".flexLibProperties" />
<include name=".project" />
</fileset>
</copy>
<replace file="${project.dir}/.project" token="@@project_name@@" value="${config.library_project.prefix}${project.name}" />
<replace file="${project.dir}/.actionScriptProperties" token="@@project_name@@" value="${config.library_project.prefix}${project.name}" />
<replace file="${project.dir}/.actionScriptProperties" token="@@player_version@@" value="${config.player.version}" />
<replace file="${project.dir}/.actionScriptProperties" token="@@swf_version@@" value="${config.swf.version}" />
<replace file="${project.dir}/.actionScriptProperties" token="@@flex_config@@" value="${config.flex_config.file}" />
<replace file="${project.dir}/.actionScriptProperties" token="@@playerglobal@@" value="${config.dir.playerglobal}" />
<replace file="${project.dir}/.actionScriptProperties" token="@@lib@@" value="${config.dir.lib}" />
<replace file="${project.dir}/.actionScriptProperties" token="@@rsl@@" value="${config.dir.rsl}" />
<java jar="${config.dir.ext}/util_setting/main.jar" fork="true">
<arg value="${project.dir}"/>
<arg value="${config.library_project.prefix}"/>
</java>
</target>
<target name="auto_gen_project_setting">
<basename file="${project.dir}" property="project.name" />
<copy todir="${project.dir}">
<fileset dir="${config.dir.template}/project">
<include name=".settings/" />
<include name=".actionScriptProperties" />
<include name=".flexProperties" />
<include name=".project" />
</fileset>
</copy>
<replace file="${project.dir}/.project" token="@@project_name@@" value="${config.project.prefix}${project.name}" />
<replace file="${project.dir}/.actionScriptProperties" token="@@project_name@@" value="${project.name}" />
<replace file="${project.dir}/.actionScriptProperties" token="@@player_version@@" value="${config.player.version}" />
<replace file="${project.dir}/.actionScriptProperties" token="@@swf_version@@" value="${config.swf.version}" />
<replace file="${project.dir}/.actionScriptProperties" token="@@flex_config@@" value="${config.flex_config.file}" />
<replace file="${project.dir}/.actionScriptProperties" token="@@playerglobal@@" value="${config.dir.playerglobal}" />
<replace file="${project.dir}/.actionScriptProperties" token="@@lib@@" value="${config.dir.lib}" />
<replace file="${project.dir}/.actionScriptProperties" token="@@rsl@@" value="${config.dir.rsl}" />
<java jar="${config.dir.ext}/util_setting/main.jar" fork="true">
<arg value="${project.dir}"/>
<arg value="${config.library_project.prefix}"/>
</java>
</target>
</project>