forked from snorkel123/google-play-game-services-ane
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
98 lines (78 loc) · 3.59 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
<project name="Google-Play-Game-Services-ANE" default="main">
<!-- Write your Flex SDK path-->
<property name="FLEX_HOME" value="C:\Program Files (x86)\FlashDevelop\Tools\flexsdk"/>
<!-- Write your android.jar path-->
<property name="android.lib" value="C:\Program Files\adt-bundle-windows\sdk\platforms\android-19\android.jar" />
<!-- Write your JDK rt.jar path-->
<property name="java_rt.lib" value="C:\Program Files\Java\jdk1.7.0_45\jre\lib\rt.jar" />
<property name="fre.lib" value="${FLEX_HOME}/lib/android/FlashRuntimeExtensions.jar" />
<property name="java.classes" value="Android/src" />
<property name="as.classes" value="as3/src" />
<property name="extension.id" value="com.google.api.games" />
<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
<target name="make.dirs" description="Making temp folders">
<delete dir="ane_ready_for_use"/>
<mkdir dir="ane_ready_for_use"/>
<mkdir dir="temp"/>
<mkdir dir="temp/java_classes/"/>
<mkdir dir="temp/libs/"/>
<mkdir dir="temp/ane/"/>
<mkdir dir="temp/ane/android/"/>
<mkdir dir="temp/ane/default/"/>
</target>
<target name="compile.jar" description="Making jar lib">
<javac
failonerror="true"
destdir="temp/java_classes"
classpath="${fre.lib}:${android.lib}:Android/libs/google-play-services.jar:Android/libs/android-support-v4.jar"
source="1.6" target="1.6"
includeantruntime="false"
bootclasspath="${java_rt.lib}">
<src path="${java.classes}"/>
</javac>
<jar basedir="temp/java_classes" destfile="temp/ane/android/lib.jar"/>
</target>
<target name="compile.swc" description="Making swc lib">
<compc
failonerror="true"
use-network="false"
debug="false"
swf-version="16"
output="temp/libs/lib.swc">
<load-config filename="${FLEX_HOME}/frameworks/air-config.xml" />
<include-sources dir="${as.classes}">
<include name="**/*.as*" />
</include-sources>
</compc>
</target>
<target name="copy.files" description="Files operations">
<copy file="extension.xml" tofile="temp/ane/extension.xml"/>
<copy file="Dependencies/android/android-depends.xml" tofile="temp/ane/android/android-depends.xml"/>
<copy file="Android/libs/android-support-v4.jar" tofile="temp/ane/android/android-support-v4.jar"/>
<copy file="Android/libs/google-play-services.jar" tofile="temp/ane/android/google-play-services.jar"/>
<copy todir="temp/ane/android/google-play-services-res">
<fileset dir="Dependencies/android/google-play-services-res"/>
</copy>
<unzip src="temp/libs/lib.swc" dest="temp/libs/"/>
<copy file="temp/libs/library.swf" tofile="temp/ane/android/library.swf"/>
<move file="temp/libs/library.swf" tofile="temp/ane/default/library.swf"/>
<move file="temp/libs/lib.swc" tofile="temp/ane/lib.swc"/>
</target>
<target name="build.ane" description="Making ane file">
<exec executable="${FLEX_HOME}/bin/adt.bat" failonerror="true">
<arg value="-package"/>
<arg value="-target"/>
<arg value="ane"/>
<arg value="ane_ready_for_use/${extension.id}.ane"/>
<arg value="temp/ane/extension.xml"/>
<arg line="-swc"/>
<arg line="temp/ane/lib.swc"/>
<arg line="-platform Android-ARM -C temp/ane/android/ -platformoptions temp/ane/android/android-depends.xml ."/>
<arg line="-platform default -C temp/ane/default/ ."/>
</exec>
<echo file="ane_ready_for_use/extension_id.txt">${extension.id}</echo>
<delete dir="temp"/>
<echo message="Your extension located in ane_ready_for_use folder."/>
</target>
<target name="main" description="Run all targets" depends="make.dirs, compile.jar, compile.swc, copy.files, build.ane" />
</project>