-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.xml
160 lines (140 loc) · 6.47 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
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="MakeApacheFlexForFlashBuilder" basedir="." default="build">
<!--load environment variables prefixed with env -->
<property environment="env"/>
<!--location of property file -->
<property file="${basedir}/build.properties" description="Properties for MakeApacheFlexForFlashBuilder project" />
<!-- additional tasks - mxmlc tag -->
<path id="flexTasks.path">
<fileset dir="${FLEX_HOME}">
<include name="lib/flexTasks.jar" />
<include name="ant/lib/flexTasks.jar" />
</fileset>
</path>
<taskdef resource="flexTasks.tasks" classpathref="flexTasks.path"/>
<target name="build" description="compiles application">
<antcall target="init"/>
<antcall target="cleanup"/>
</target>
<target name="init" depends="determineOS, clean,createDirs" description="Creates the deploy folders and sets app extension">
<available file="${KEYSTORE}" property="CERTIFICATE_FLAG"/>
<antcall target="packagenative"/>
<antcall target="abortBuild"/>
</target>
<target name="createDirs" unless="unsupportedOS">
<mkdir dir="${BUILD_DIR}"/>
<mkdir dir="${RELEASE_DIR}"/>
</target>
<target name="determineOS" description="Determine OS on which build is running so that we can create the correct native installer">
<condition property="unsupportedOS">
<and>
<os family="unix" />
<not>
<os family="mac" />
</not>
</and>
</condition>
<condition property="extension" value="exe">
<os family="windows" />
</condition>
<condition property="extension" value="dmg">
<os family="mac" />
</condition>
</target>
<target name="packagenative" depends="compile, certificate, packageair" unless="unsupportedOS"
description="Packages the AIR file from the build directory to create a native installer (exe/dmg) file">
<java jar="${ADT}" fork="true"
failonerror="true"
maxmemory="512m">
<arg value="-package"/>
<arg value="-target"/>
<arg value="native"/>
<arg value="${RELEASE_DIR}/${APP_NAME}.${extension}"/>
<arg value="${RELEASE_DIR}/${APP_NAME}.air"/>
</java>
</target>
<target name="abortBuild" if="unsupportedOS">
<echo>Unable to create a .exe or a .dmg file on this operating system.</echo>
<echo>You must use ADT on the same operating system as that of the native installer file you want to generate.
So, to create an EXE file for Windows, run this build on Windows. To create a DMG file for Mac OS, run this
build on Mac OS.
</echo>
</target>
<target name="compile" unless="unsupportedOS"
description="Compiles the AIR application to a SWF file and places SWF in a temp directory to be packaged.">
<mxmlc file="${SOURCE_DIR}/${APP_NAME}.${APP_EXTENSION}"
output="${BUILD_DIR}/${APP_NAME}.swf"
static-rsls="true"
accessible="true"
configname="air"
debug="${DEBUG_FLAG}"
failonerror="true"
fork="true"
maxmemory="512m">
<source-path path-element="${SOURCE_DIR}"/>
<external-library-path file="${FLEX_HOME}/frameworks/libs/air/airglobal.swc" append="true"/>
<library-path dir="${LIBRARY_DIR}" includes="*.swc" append="true"/>
</mxmlc>
</target>
<target name="certificate" unless="CERTIFICATE_FLAG,unsupportedOS">
<java jar="${ADT}" fork="true"
failonerror="true">
<arg value="-certificate"/>
<arg value="-cn"/>
<arg value="${CERT_NAME}"/>
<arg value="-ou"/>
<arg value="${CERT_ORG_UNIT}"/>
<arg value="-o"/>
<arg value="${CERT_ORG_NAME}"/>
<arg value="-c"/>
<arg value="${CERT_COUNTRY}"/>
<arg value="${CERT_KEY_TYPE}"/>
<arg value="${KEYSTORE}"/>
<arg value="${CERT_PASSWORD}"/>
</java>
</target>
<target name="packageair" unless="unsupportedOS"
description="Packages the build SWF file from a temp directory to create an AIR file">
<java jar="${ADT}" fork="true"
failonerror="true"
maxmemory="512m">
<arg value="-package"/>
<arg value="-storetype"/>
<arg value="${STORETYPE}"/>
<arg value="-keystore"/>
<arg value="${KEYSTORE}"/>
<arg value="-storepass"/>
<arg value="${CERT_PASSWORD}"/>
<arg value="${RELEASE_DIR}/${APP_NAME}.air"/>
<arg value="${SOURCE_DIR}/${APP_NAME}-app.xml"/>
<arg value="-C"/>
<arg value="${BUILD_DIR}"/>
<arg value="${BUILD_DIR}/${APP_NAME}.swf"/>
<arg value="-C"/>
<arg value="${SOURCE_DIR}"/>
<arg value="${SOURCE_DIR}/${APP_CONFIG_XML_NAME}.xml"/>
<arg value="${ASSETS_DIR}"/>
</java>
</target>
<target name="clean" unless="unsupportedOS" description="Cleans up old files.">
<delete dir="${BUILD_DIR}" failOnError="false" includeEmptyDirs="true" />
<delete dir="${RELEASE_DIR}" failOnError="false" includeEmptyDirs="true" />
</target>
<target name="cleanup" description="Cleans up old files.">
<delete dir="${BUILD_DIR}" failOnError="false" includeEmptyDirs="true" />
</target>
</project>