-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
144 lines (111 loc) · 4.88 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="ANE" default="all" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<!-- Support Files -->
<property file="project.properties"/>
<property name="support.home" location="support"/>
<import file="${support.home}/ant/air.xml"/>
<property file="${support.home}/build.properties"/>
<!-- Paths -->
<property name="src.root" location="src"/>
<property name="lib.root" location="lib"/>
<property name="build.root" location="build"/>
<property name="build.package" location="build/package"/>
<property name="build.ane" location="build/ane"/>
<!-- All -->
<target name="all" depends="clean, package" description="Full build of extension"/>
<target name="native-all" depends="clean, native-android, package" description="Full build of extension (incl. compilation of native code)"/>
<!-- Init -->
<target name="init">
<mkdir dir="${build.root}"/>
<mkdir dir="${build.package}"/>
</target>
<!-- Clean -->
<target name="clean">
<delete dir="${build.root}"/>
</target>
<!-- Third Party Libraries -->
<target name="dependencies">
<path id="src.path">
<pathelement location='${src.root}/as3'/>
</path>
</target>
<!-- Compile -->
<target name="compile" depends="init,dependencies" description="Build SWC library">
<compc
pathRef="src.path"
configxml="${src.root}/resources/lib.xml"
sdkConfig="air"
sdkPath="${air.sdk.home}"
debug="true"
output="${build.package}/${project.artifactId}-${project.version}.swc">
</compc>
<!-- Extract the SWF needed to build the ANE -->
<unzip src="${build.package}/${project.artifactId}-${project.version}.swc" dest="${build.package}">
<patternset>
<include name="library.swf"/>
</patternset>
</unzip>
</target>
<!-- Package -->
<target name="package" depends="compile" description="Create the extension package">
<mkdir dir="${build.ane}"/>
<copy todir="${build.ane}/default">
<fileset dir="${build.package}">
<include name="library.swf"/>
</fileset>
</copy>
<copy todir="${build.ane}/android">
<fileset dir="${lib.root}/android"/>
<fileset dir="${build.package}">
<include name="library.swf"/>
</fileset>
</copy>
<adt
sign.args=""
target="ane"
output="${build.package}/${project.artifactId}-${project.version}.ane"
descriptor="${src.root}/resources/extension.xml">
<arg line="-swc ${build.package}/${project.artifactId}-${project.version}.swc"/>
<arg line="-platform Android-ARM -C ${build.ane}/android/ ."/>
<arg line="-platform Android-x86 -C ${build.ane}/android/ ."/>
<arg line="-platform default -C ${build.ane}/default/ ."/>
</adt>
</target>
<!-- Android -->
<target name="native-android" description="Build Android">
<ant dir="android" inheritAll="true" inheritRefs="true" target="all">
<property name="build.root" value="${build.root}/android"/>
</ant>
<copy todir="${lib.root}/android">
<fileset dir="build/android/jar"/>
</copy>
</target>
<!-- Repository -->
<target name="install">
<artifact:pom
id="ane.pom"
groupId="${project.groupId}"
artifactId="${project.artifactId}"
version="${project.version}"
packaging="ane">
</artifact:pom>
<!-- Workaround for https://jira.codehaus.org/browse/MANTTASKS-170 -->
<artifact:writepom pomRefId="ane.pom" file="${build.package}/${project.artifactId}-pom.xml"/>
<artifact:pom id="build.pom" file="${build.package}/${project.artifactId}-pom.xml"/>
<artifact:install file="${build.package}/${project.artifactId}-${project.version}.ane" pomRefId="build.pom"/>
</target>
<!-- Repository-SWC -->
<target name="install-swc">
<artifact:pom
id="swc.pom"
groupId="${project.groupId}"
artifactId="${project.artifactId}"
version="${project.version}"
packaging="swc">
</artifact:pom>
<!-- Workaround for https://jira.codehaus.org/browse/MANTTASKS-170 -->
<artifact:writepom pomRefId="swc.pom" file="${build.package}/${project.artifactId}-pom.xml"/>
<artifact:pom id="build.pom" file="${build.package}/${project.artifactId}-pom.xml"/>
<artifact:install file="${build.package}/${project.artifactId}-${project.version}.swc" pomRefId="build.pom"/>
</target>
</project>