-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.xml
157 lines (135 loc) · 6.58 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Bullet Physics Lib ANE Build Scripts" default="package">
<!-- ANE properties -->
<property name="ane.id" value="ane.bulletphysics"/>
<property name="ane.file" value="Bullet.ane"/>
<property name="anedest.dir" value="as3/aneBulletTester/ane"/>
<!-- Source code locations and file names -->
<property name="anelib.file" value="aneBulletLib.swc"/>
<property name="anelib.dir" value="as3/aneBulletLib/bin"/>
<property name="anedefault.file" value="aneBulletDefault.swc"/>
<property name="anedefault.dir" value="as3/aneBulletDefault/bin"/>
<property name="extention.init" value="BulletExtensionInitializer"/>
<property name="iossrc.dir" value="native/ios/BulletANE"/>
<property name="ioslib.file" value="libBulletANE.a"/>
<property name="androidsrc.dir" value="native/android"/>
<property name="androidlib.file" value="libbullet.so"/>
<!-- SDK locations -->
<property name="airsdk.dir" value="/Applications/Adobe Flash Builder 4.7/sdks/4.9.1AIR3.9"/>
<property name="iossdk.dir" value="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk"/>
<!-- Derived locations -->
<property name="ioslib.dir" value="${iossrc.dir}/build/Products/Release-iphoneos"/>
<property name="iossimlib.dir" value="${iossrc.dir}/build/Products/Release-iphonesimulator"/>
<property name="androidlib.dir" value="${androidsrc.dir}/libs/armeabi"/>
<property name="jni.dir" value="${androidsrc.dir}/jni"/>
<!-- other stuff -->
<property name="build.dir" value="/tmp/aneBuild"/>
<target name="all" depends="package" description="Full build of extension"/>
<target name="actionscript" description="Build ActionScript wrapper and default lib projects">
<!-- TODO: this! preferrably without a dependency on Flash Builder -->
</target>
<target name="bullet-download" description="Download the Bullet lib from its SVN repository">
<!-- TODO: antify the bullet lib SVN checkout -->
</target>
<target name="ios" depends="bullet-download" description="iOS native lib">
<!-- The following isn't working yet, but I think it's on the right track. For now, just build in Xcode.
<exec executable="xcodebuild" dir="${iossrc.dir}" failonerror="true">
<arg line="ARCHS=i386 VALID_ARCHS=i386 -sdk iphonesimulator -configuration Release"/>
</exec>
<exec executable="xcodebuild" dir="${iossrc.dir}" failonerror="true">
<arg value="ARCHS=armv7 VALID_ARCHS=armv7 -sdk iphoneos -configuration Release"/>
</exec>
-->
</target>
<target name="android" depends="bullet-download" description="Android native lib">
<copy todir="${jni.dir}" verbose="true">
<fileset file="${airsdk.dir}/include/FlashRuntimeExtensions.h"/>
<fileset file="${airsdk.dir}/lib/android/FlashRuntimeExtensions.so"/>
</copy>
<exec executable="ndk-build" dir="${jni.dir}" failonerror="true">
<arg line="--jobs=8"/>
</exec>
<delete verbose="true">
<fileset file="${jni.dir}/FlashRuntimeExtensions.h"/>
<fileset file="${jni.dir}/FlashRuntimeExtensions.so"/>
</delete>
</target>
<target name="package" depends="actionscript,ios,android" description="Build full ANE">
<mkdir dir="${build.dir}"/>
<delete includeemptydirs="true">
<fileset dir="${build.dir}" includes="**/*"/>
</delete>
<mkdir dir="${build.dir}/ios"/>
<mkdir dir="${build.dir}/iossim"/>
<mkdir dir="${build.dir}/default"/>
<copy todir="${build.dir}" verbose="true">
<fileset file="${anelib.dir}/${anelib.file}"/>
</copy>
<unzip src="${anelib.dir}/${anelib.file}" dest="${build.dir}/unzipped"/>
<copy todir="${build.dir}/ios" verbose="true">
<fileset file="${ioslib.dir}/${ioslib.file}"/>
<fileset file="${build.dir}/unzipped/*.swf"/>
</copy>
<copy todir="${build.dir}/iossim" verbose="true">
<fileset file="${iossimlib.dir}/${ioslib.file}"/>
<fileset file="${build.dir}/unzipped/*.swf"/>
</copy>
<copy todir="${build.dir}/android" verbose="true">
<fileset file="${androidlib.dir}/${androidlib.file}"/>
<fileset file="${build.dir}/unzipped/*.swf"/>
</copy>
<unzip src="${anedefault.dir}/${anedefault.file}" dest="${build.dir}/unzipped"/>
<copy todir="${build.dir}/default" verbose="true">
<fileset file="${build.dir}/unzipped/*.swf"/>
</copy>
<echoxml file="${build.dir}/extension.xml" namespacePolicy="elementsOnly">
<extension xmlns="http://ns.adobe.com/air/extension/3.9">
<id>${ane.id}</id>
<versionNumber>0.0.1</versionNumber>
<platforms>
<platform name="iPhone-ARM">
<applicationDeployment>
<nativeLibrary>${ioslib.file}</nativeLibrary>
<initializer>${extention.init}</initializer>
</applicationDeployment>
</platform>
<platform name="iPhone-x86">
<applicationDeployment>
<nativeLibrary>${ioslib.file}</nativeLibrary>
<initializer>${extention.init}</initializer>
</applicationDeployment>
</platform>
<platform name="Android-ARM">
<applicationDeployment>
<nativeLibrary>${androidlib.file}</nativeLibrary>
<initializer>${extention.init}</initializer>
</applicationDeployment>
</platform>
<platform name="default">
<applicationDeployment/>
</platform>
</platforms>
</extension>
</echoxml>
<!-- NOTE: use <platform name="MacOS-x86"> for AIR sim on mac! -->
<echoxml file="${build.dir}/iosplatform.xml" namespacePolicy="elementsOnly">
<platform xmlns="http://ns.adobe.com/air/extension/3.9">
<sdkVersion>5.0.0</sdkVersion>
<linkerOptions>
<option>-ios_version_min 5.0</option>
<!-- <option>-lc++</option> -->
</linkerOptions>
</platform>
</echoxml>
<exec executable="${airsdk.dir}/bin/adt" dir="${build.dir}" failonerror="true">
<arg line="-package -target ane ${ane.file} extension.xml -swc ${anelib.file}"/>
<arg line="-platform iPhone-ARM -C ios . -platformoptions iosplatform.xml"/>
<arg line="-platform iPhone-x86 -C iossim . -platformoptions iosplatform.xml"/>
<arg line="-platform default -C default ."/>
<arg line="-platform Android-ARM -C android ."/>
</exec>
<copy todir="${anedest.dir}" verbose="true">
<fileset file="${build.dir}/${ane.file}"/>
</copy>
</target>
</project>