forked from JabbyPanda/InputAssist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
111 lines (106 loc) · 5.2 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
<?xml version="1.0"?>
<project name="InputAssist" basedir="." default="build-library">
<!-- identify properties file -->
<property file="build.properties"/>
<fail>
<condition>
<not>
<isset property="FLEX_HOME" />
</not>
</condition>
Error!
You need to set FLEX_HOME property (path to Flex SDK)
in build.properties file
located in the same dir as build.xml!
For example:
FLEX_HOME = C:\\flex\\sdk\\
</fail>
<!-- Set up Flex Ant tasks -->
<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
<target name="usage">
<echo message=""/>
<echo message="InputAssist Build Usage"/>
<echo message="-----------------------------------"/>
<echo message=""/>
<echo message="Available targets are:"/>
<echo message=""/>
<echo message="build-library --> Build InputAssist SWC"/>
<echo message="clean --> Remove all folders created by build script"/>
<echo message="init --> Clean and create build folders"/>
<echo message=""/>
</target>
<!-- Clean Distrib files -->
<target name="clean">
<!-- Remove all directories created during the build process -->
<echo>[clean] Removing the contents of Distrib directory</echo>
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${dist.loc}" defaultexcludes="false">
<include name="**/*"/>
</fileset>
</delete>
<echo>[clean] The contents of Distrib directory are removed</echo>
</target>
<!-- Create directories needed for the build process -->
<target name="init" depends="clean">
<echo>[init] Creating Bin directory</echo>
<mkdir dir="${bin.loc}"/>
<echo>[init] Bin directory is created</echo>
</target>
<!-- Compile InputAssist SWC with a versioned name.-->
<target name="build-library" depends="init">
<echo>[build-core] Compiling InputAssist SWC</echo>
<echo>[build-core] Using Flex SDK at: ${FLEX_HOME}</echo>
<compc output="${bin.loc}/${project.name.versioned}.swc"
defaults-css-url="${basedir}/defaults.css">
<incremental>true</incremental>
<accessible>true</accessible>
<debug>false</debug>
<optimize>true</optimize>
<strict>true</strict>
<namespace uri="http://www.jabbypanda.com/2010/controls" manifest="${basedir}/manifest.xml" />
<namespace uri="library://ns.adobe.com/flex/spark" manifest="${FLEX_HOME}/frameworks/spark-manifest.xml"/>
<namespace uri="http://ns.adobe.com/mxml/2009" manifest="${FLEX_HOME}/frameworks/mxml-2009-manifest.xml"/>
<namespace uri="http://www.adobe.com/2006/mxml" manifest="${FLEX_HOME}/frameworks/mxml-manifest.xml"/>
<include-namespaces>http://www.jabbypanda.com/2010/controls</include-namespaces>
<include-file name="defaults.css" path="${basedir}/defaults.css"/>
<include-file name="manifest.xml" path="${basedir}/manifest.xml"/>
<include-file name="InputAssistSkin.mxml" path="${basedir}/src/com/jabbypanda/skins/InputAssistSkin.mxml"/>
<source-path path-element="${basedir}/src"/>
<external-library-path dir="${FLEX_HOME}/frameworks/libs/" append="true">
<include name="*.swc"/>
</external-library-path>
</compc>
</target>
<!-- Package the Build -->
<target name="package">
<tstamp>
<format property="touch.time" pattern="MM/dd/yyyy hh:mm aa" unit="hour"/>
</tstamp>
<!-- Assemble -->
<echo>[package] Packaging Release</echo>
<mkdir dir="${dist.loc}"/>
<copy file="${bin.loc}/${project.name.versioned}.swc" todir="${dist.loc}"/>
<!-- Copy README -->
<copy file="${template.loc}/README.tmpl" tofile="${dist.loc}/README" overwrite="true">
<filterchain>
<replacetokens>
<token key="date" value="${touch.time}"/>
<token key="libraryVersion" value="${InputAssist.ver.num}"/>
<token key="releaseName" value="${project.name.versioned}"/>
<token key="inputAssistSourceLink" value="${InputAssist.project.sourceLink}"/>
</replacetokens>
</filterchain>
</copy>
<!-- Copy LICENSE -->
<copy file="LICENSE" todir="${dist.loc}" overwrite="true"/>
<!-- Zip It -->
<zip destfile="${dist.loc}/${project.name.versioned}.zip">
<fileset dir="${dist.loc}"/>
</zip>
<!-- Clean Up -->
<delete file="${dist.loc}/${project.name.versioned}.swc"/>
<delete file="${dist.loc}/README"/>
<delete file="${dist.loc}/LICENSE"/>
<echo>[package] Release package successfully</echo>
</target>
</project>