-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
100 lines (85 loc) · 2.94 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
<project name="ANE" basedir="." default="compile">
<!-- Load variables -->
<property file="build.properties"/>
<!-- Clean binaries folder -->
<target name="cleanBinaries">
<delete dir="${BINARIES_FOLDER}"/>
<mkdir dir="${BINARIES_FOLDER}"/>
<mkdir dir="${BINARIES_FOLDER}/Default"/>
<mkdir dir="${BINARIES_FOLDER}/iOS"/>
</target>
<!-- Build SWC library -->
<target name="buildSwc" depends="cleanBinaries">
<fileset dir="AS/src" casesensitive="yes" id="classfiles">
<include name="**/*.as"/>
</fileset>
<pathconvert property="classlist" refid="classfiles" pathsep=" " dirsep=".">
<regexpmapper from=".*src.(.*)\.as" to="\1"/>
</pathconvert>
<exec executable="${AIR_SDK_PATH}/bin/compc" failonerror="true">
<arg line='-source-path AS/src'/>
<arg line='-output ${SWC_PATH}'/>
<arg line='-swf-version=14'/>
<arg line='-external-library-path+="${AIR_SDK_PATH}/frameworks/libs/air/airglobal.swc"'/>
<arg line='-include-classes ${classlist}'/>
</exec>
</target>
<!-- Clean iOS project -->
<target name="iOSClean" depends="buildSwc">
<exec executable="xcodebuild" dir="." failonerror="true">
<arg line="-project ${IOS_PROJECT_PATH}"/>
<arg line="-alltargets clean"/>
</exec>
</target>
<!-- Compile iOS project -->
<target name="iOSCompile" depends="iOSClean">
<exec executable="xcodebuild" dir="." failonerror="true">
<arg line="-project ${IOS_PROJECT_PATH}"/>
<arg line="-sdk iphoneos"/>
<arg line="-alltargets"/>
<arg line="-configuration Release"/>
</exec>
</target>
<!-- Copy iOS lib in binaries folder -->
<target name="iOSCopy" depends="iOSCompile">
<copy file="${IOS_LIB_PATH}" todir="${BINARIES_FOLDER}/iOS"/>
</target>
<!-- Unzip SWF file and copy it to binaries folders -->
<target name="unzipSwf" depends="iOSCopy">
<mkdir dir="temp"/>
<unzip src="${SWC_PATH}" dest="temp"/>
<copy file="temp/library.swf" todir="${BINARIES_FOLDER}/Default"/>
<copy file="temp/library.swf" todir="${BINARIES_FOLDER}/iOS"/>
<copy file="temp/library.swf" todir="${BINARIES_FOLDER}/Android"/>
<delete dir="temp"/>
</target>
<!-- Compile ANE -->
<target name="compile" depends="unzipSwf">
<java jar="${ADT.JAR}" fork="true" failonerror="true">
<arg value="-package"/>
<arg value="-target"/>
<arg value="ane"/>
<arg value="${ANE_PATH}"/>
<arg value="${EXTENSION.XML}"/>
<arg value="-swc"/>
<arg value="${SWC_PATH}"/>
<arg value="-platform"/>
<arg value="iPhone-ARM"/>
<arg value="-platformoptions"/>
<arg value="${IOS_PLATFORM_OPTIONS}"/>
<arg value="-C"/>
<arg value="${BINARIES_FOLDER}/iOS"/>
<arg value="."/>
<arg value="-platform"/>
<arg value="Android-ARM"/>
<arg value="-C"/>
<arg value="${BINARIES_FOLDER}/Default"/>
<arg value="library.swf"/>
<arg value="-platform"/>
<arg value="default"/>
<arg value="-C"/>
<arg value="${BINARIES_FOLDER}/Android"/>
<arg value="library.swf"/>
</java>
</target>
</project>