-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
134 lines (116 loc) · 4.65 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="eq2aa" default="current-version" basedir=".">
<property name="src.dir" location="src" />
<property name="trees.dir" location="${src.dir}/definitions/output_min" />
<property name="lib.dir" location="lib" />
<property name="js.dir" location="${src.dir}/webui/js" />
<property name="build.dir" location="build" />
<property name="dist.dir" location="dist" />
<property name="web.dir" location="web" />
<property file="build_info.properties" />
<property name="build.number" value="${build.major.number}.${build.minor.number}.${build.revision.number}" />
<property name="test-server" value="192.168.1.27" />
<taskdef name="jscomp" classname="com.google.javascript.jscomp.ant.CompileTask" classpath="${lib.dir}/compiler.jar" />
<path id="js.fileset">
<filelist dir="${js.dir}/util" files="utils.js, shims.js, XmlBuilder.js" />
<filelist dir="${web.dir}" files="fingerprint.min.js" />
<fileset dir="${js.dir}">
<include name="Constants.js" />
<include name="GameVersions.js" />
<include name="io/**/*.js" />
<include name="lib/**/*.js" />
<include name="model/**/*.js" />
<include name="ui/**/*.js" />
</fileset>
<filelist dir="${js.dir}" files="Main.js, eq2aa_entry.js" />
</path>
<path id="print.js.fileset">
<filelist dir="${js.dir}/util" files="utils.js, shims.js" />
<fileset dir="${js.dir}">
<include name="Constants.js" />
<include name="GameVersions.js" />
<include name="io/**/*.js" />
<include name="lib/**/*.js" />
<include name="model/**/*.js" />
<include name="ui/**/*.js" />
</fileset>
<filelist dir="${js.dir}" files="print_entry.js" />
</path>
<macrodef name="compile-js">
<attribute name="destfile" />
<element name="paths" implicit="true" />
<sequential>
<jscomp compilationLevel="simple" output="@{destfile}">
<paths />
</jscomp>
</sequential>
</macrodef>
<target name="init">
<tstamp />
<mkdir dir="${build.dir}" />
<mkdir dir="${dist.dir}" />
</target>
<target name="current-version">
<echo>Current build number:${build.number}</echo>
</target>
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
</target>
<target name="build">
<compile-js destfile="${build.dir}/eq2aa_compiled.js">
<path refid="js.fileset" />
</compile-js>
<compile-js destfile="${build.dir}/eq2aa_print_compiled.js">
<path refid="print.js.fileset" />
</compile-js>
</target>
<target name="dist" depends="build">
<copy todir="${dist.dir}/eq2aa">
<fileset dir="${web.dir}">
<include name="**/*" />
</fileset>
</copy>
<copy todir="${dist.dir}/eq2aa/css/sprites">
<fileset dir="${build.dir}/sprites">
<include name="*.css" />
</fileset>
</copy>
<copy todir="${dist.dir}/eq2aa/css/icons">
<fileset dir="${build.dir}/sprites">
<include name="*.png" />
</fileset>
</copy>
<mkdir dir="${dist.dir}/eq2aa/js" />
<copy file="${build.dir}/eq2aa_compiled.js" tofile="${dist.dir}/eq2aa/js/eq2aa.js" />
<copy file="${build.dir}/eq2aa_print_compiled.js" tofile="${dist.dir}/eq2aa/js/eq2aa_print.js" />
<copy todir="${dist.dir}/eq2aa/js/trees">
<fileset dir="${trees.dir}" />
</copy>
</target>
<target name="deploy-test" depends="dist">
<scp trust="true" sftp="true" todir="bitnami:bitnami@${test-server}:/opt/bitnami/nginx">
<fileset dir="${dist.dir}">
<include name="**/*" />
</fileset>
</scp>
</target>
<target name="inc-revision">
<propertyfile file="build_info.properties">
<entry key="build.revision.number" type="int" operation="+" value="1" pattern="00" />
</propertyfile>
</target>
<target name="inc-minor">
<propertyfile file="build_info.properties">
<entry key="build.minor.number" type="int" operation="+" value="1" pattern="00" />
<entry key="build.revision.number" type="int" value="0" pattern="00" />
</propertyfile>
</target>
<target name="inc-major">
<propertyfile file="build_info.properties">
<entry key="build.major.number" type="int" operation="+" value="1" pattern="00" />
<entry key="build.minor.number" type="int" value="0" pattern="00" />
<entry key="build.revision.number" type="int" value="0" pattern="00" />
</propertyfile>
</target>
</project>