-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.xml
100 lines (76 loc) · 3.09 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
<?xml version="1.0" encoding="UTF-8"?>
<project default="build" name="apm"
xmlns:if="ant:if"
xmlns:unless="ant:unless">
<dirname property="apm.basedir" file="${ant.file.apm}" />
<property file="${apm.basedir}/build.config" description="build properties" />
<property name="apm.clientdir" value="${apm.basedir}/client" />
<property name="apm.builddir" value="${apm.basedir}/client/out" />
<property name="codetmpl" value="${apm.basedir}/client/_codetmpl" />
<property name="AIR_SDK_HOME" value="${air.sdk}" />
<taskdef resource="flexTasks.tasks" classpath="${air.sdk}/ant/lib/flexTasks.jar" />
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
<target name="bootstrap">
<mkdir dir="${user.home}/.ant/lib"/>
<get dest="${user.home}/.ant/lib/ant-contrib.jar" src="https://search.maven.org/remotecontent?filepath=ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar"/>
</target>
<!-- PLATFORM INFORMATION -->
<condition property="isWindows" else="false">
<os family="windows" />
</condition>
<condition property="isMacOS" else="false">
<os family="mac" />
</condition>
<!-- VERSIONING -->
<target name="version">
<antcall target="version_increment" />
</target>
<target name="version_increment" >
<propertyfile file="version.config">
<entry key="version_build" type="int" operation="+" value="1" />
</propertyfile>
</target>
<!-- CLEAN -->
<target name="clean" >
<delete dir="${apm.builddir}" />
</target>
<!-- BUILD -->
<target name="build" >
<property file="version.config" />
<var name="version" value="${version_major}.${version_minor}.${version_build}${version_preview}" />
<echo message="Building apm... ${version}"/>
<mxmlc
output="${apm.builddir}/apm.swf"
file="${apm.clientdir}/src/APMConsoleApp.as"
failonerror="true"
maxmemory="1024m">
<load-config filename="${air.sdk}/frameworks/air-config.xml" />
<compiler.define name="CONFIG::DEBUG" value="false" />
<compiler.define name="CONFIG::VERSION" value="'${version}'" />
<source-path path-element="${apm.clientdir}/src" />
<library-path dir="${apm.clientdir}/libs" append="true">
<include name="*.swc" />
</library-path>
</mxmlc>
<echo message="Copying apm scripts..."/>
<copy overwrite="true" todir="${apm.builddir}">
<fileset dir="${apm.clientdir}/src">
<include name="apm" />
<include name="apm.bat" />
<include name="apm.xml" />
</fileset>
</copy>
<exec executable="/bin/chmod" failonerror="false" if:true="${isMacOS}">
<arg line="+x ${apm.builddir}/apm" />
</exec>
<echo message="done"/>
</target>
<!-- PACKAGE -->
<target name="package" depends="clean, build" >
<property file="version.config" />
<var name="version" value="${version_major}.${version_minor}.${version_build}${version_preview}" />
<zip destfile="${apm.basedir}/apm_${version}.zip">
<fileset dir="${apm.builddir}" />
</zip>
</target>
</project>