|
39 | 39 | <include name="**/*" /> |
40 | 40 | </fileset> |
41 | 41 | </delete> |
| 42 | + |
| 43 | +<echo message="Clean complete." /> |
42 | 44 | </target> |
43 | 45 |
|
44 | 46 | <target name="init" description="Initializes project and destination folders"> |
|
51 | 53 | <mkdir dir="${docs.loc}" /> |
52 | 54 | <mkdir dir="${dist.loc}" /> |
53 | 55 | <mkdir dir="${report.loc}" /> |
| 56 | +<mkdir dir="${bin.loc}/rsl" /> |
| 57 | +<mkdir dir="${bin.loc}/rsl/flex4" /> |
| 58 | +<mkdir dir="${bin.loc}/rsl/flex3" /> |
| 59 | + |
| 60 | +<echo message="Init complete." /> |
54 | 61 | </target> |
55 | 62 |
|
56 | 63 | <!-- ======================================= --> |
|
59 | 66 |
|
60 | 67 | <target name="compile" depends="init" description="Compile the library .swc file"> |
61 | 68 |
|
| 69 | +<antcall target="-compile-for-platform"> |
| 70 | +<param name="outputLocation" value="${bin.loc}/${swiz.name}.swc"/> |
| 71 | +<param name="isDirectoryCompile" value="false"/> |
| 72 | +<param name="isFlex4" value="true"/> |
| 73 | +<param name="isFlex3" value="false"/> |
| 74 | +</antcall> |
| 75 | + |
| 76 | +<echo message="${swiz.name}.swc has been created in ${bin.loc}" /> |
| 77 | + |
| 78 | +<antcall target="-compile-for-platform"> |
| 79 | +<param name="outputLocation" value="${bin.loc}/rsl/flex4"/> |
| 80 | +<param name="isDirectoryCompile" value="true"/> |
| 81 | +<param name="isFlex4" value="true"/> |
| 82 | +<param name="isFlex3" value="false"/> |
| 83 | +</antcall> |
| 84 | + |
| 85 | +<move file="${bin.loc}/rsl/flex4/library.swf" tofile="${bin.loc}/rsl/${swiz.name}.swf" /> |
| 86 | +<echo message="${swiz.name}.swf has been created in ${bin.loc}/rsl" /> |
| 87 | + |
| 88 | +<antcall target="-compile-for-platform"> |
| 89 | +<param name="outputLocation" value="${bin.loc}/${swiz.name.flex3}.swc"/> |
| 90 | +<param name="isDirectoryCompile" value="false"/> |
| 91 | +<param name="isFlex4" value="false"/> |
| 92 | +<param name="isFlex3" value="true"/> |
| 93 | +</antcall> |
| 94 | + |
| 95 | +<echo message="${swiz.name.flex3}.swc has been created in ${bin.loc}" /> |
| 96 | + |
| 97 | +<antcall target="-compile-for-platform"> |
| 98 | +<param name="outputLocation" value="${bin.loc}/rsl/flex3"/> |
| 99 | +<param name="isDirectoryCompile" value="true"/> |
| 100 | +<param name="isFlex4" value="false"/> |
| 101 | +<param name="isFlex3" value="true"/> |
| 102 | +</antcall> |
| 103 | + |
| 104 | +<move file="${bin.loc}/rsl/flex3/library.swf" tofile="${bin.loc}/rsl/${swiz.name.flex3}.swf"/> |
| 105 | +<echo message="${swiz.name.flex3}.swf has been created in ${bin.loc}/rsl" /> |
| 106 | + |
| 107 | +<!-- Remove extra RSL files --> |
| 108 | +<delete includeemptydirs="true" failonerror="false"> |
| 109 | +<fileset dir="${bin.loc}/rsl" defaultexcludes="false"> |
| 110 | +<include name="**/**" /> |
| 111 | +<exclude name="**/*.swf" /> |
| 112 | +</fileset> |
| 113 | +</delete> |
| 114 | + |
| 115 | +</target> |
| 116 | + |
| 117 | +<!-- Internal compile target to perform each compile run with options --> |
| 118 | +<target name="-compile-for-platform"> |
| 119 | + |
| 120 | +<!-- Default values for output location and directory compile. Normally passed as antcall params. --> |
| 121 | +<property name="outputLocation" value="${bin.loc}/${swiz.name}.swc"/> |
| 122 | +<property name="isDirectoryCompile" value="false"/> |
| 123 | +<property name="isFlex3" value="false"/> |
| 124 | +<property name="isFlex4" value="true"/> |
| 125 | + |
62 | 126 | <!-- set up list of classes to include in library --> |
63 | 127 | <fileset id="src.include.fileset" dir="${src.loc}"> |
64 | 128 | <include name="**/*.as" /> |
|
67 | 131 |
|
68 | 132 | <!-- Convert the test files into a compiler friendly format. --> |
69 | 133 | <pathconvert property="src.include.classes" pathsep=" " refid="src.include.fileset"> |
70 | | - <compositemapper> |
71 | | - <chainedmapper> |
72 | | - <globmapper from="${src.loc}/*" to="*" handledirsep="true" /> |
73 | | - <mapper type="package" from="*.as" to="*" /> |
74 | | - </chainedmapper> |
75 | | - </compositemapper> |
| 134 | + <compositemapper> |
| 135 | + <chainedmapper> |
| 136 | + <globmapper from="${src.loc}/*" to="*" handledirsep="true" /> |
| 137 | + <mapper type="package" from="*.as" to="*" /> |
| 138 | + </chainedmapper> |
| 139 | + </compositemapper> |
76 | 140 | </pathconvert> |
77 | | - |
78 | | -<compc output="${bin.loc}/${swiz.name}.swc" include-classes="${src.include.classes}"> |
| 141 | +
|
| 142 | +<compc output="${outputLocation}" include-classes="${src.include.classes}"> |
79 | 143 | <source-path path-element="${src.loc}" /> |
| 144 | +<directory>${isDirectoryCompile}</directory> |
80 | 145 |
|
81 | 146 | <namespace uri="${swiz.namespace}" manifest="${src.loc}/manifest.xml" /> |
82 | 147 | <include-namespaces uri="${swiz.namespace}" /> |
|
85 | 150 | <include-file name="design.xml" path="${src.loc}/design.xml" /> |
86 | 151 |
|
87 | 152 | <!-- add flex3/flex4 compiler arg --> |
88 | | -<compiler.define name="CONFIG::flex3" value="false" /> |
89 | | -<compiler.define name="CONFIG::flex4" value="true" /> |
| 153 | +<compiler.define name="CONFIG::flex3" value="${isFlex3}" /> |
| 154 | +<compiler.define name="CONFIG::flex4" value="${isFlex4}" /> |
90 | 155 |
|
91 | 156 | <!-- Configure the flex framework libraries as external link dependencies --> |
92 | | -<external-library-path dir="${FLEX_HOME}/frameworks" append="true"> |
| 157 | +<external-library-path dir="${flex.sdk}/frameworks" append="true"> |
93 | 158 | <include name="libs" /> |
94 | 159 | <include name="locale/{locale}" /> |
| 160 | +<include name="libs/air" /> |
| 161 | +<include name="libs/automation" /> |
| 162 | +<include name="libs/mobile" /> |
| 163 | +<include name="libs/mx" /> |
| 164 | +<include name="libs/player" /> |
95 | 165 | </external-library-path> |
96 | 166 |
|
97 | 167 | <keep-as3-metadata name="Autowire"/> |
|
108 | 178 | <!-- Sets java.awt.headless=true so font compilation works in headless environments --> |
109 | 179 | <headless-server>true</headless-server> |
110 | 180 | </compc> |
111 | | - |
112 | | -<echo message="${swiz.name}.swc has been created in ${bin.loc}" /> |
113 | | - |
114 | | -<compc output="${bin.loc}/${swiz.name.flex3}.swc" include-classes="${src.include.classes}"> |
115 | | -<source-path path-element="${src.loc}" /> |
116 | | - |
117 | | -<namespace uri="${swiz.namespace}" manifest="${src.loc}/manifest.xml" /> |
118 | | -<include-namespaces uri="${swiz.namespace}" /> |
119 | | - |
120 | | -<include-file name="metadata.xml" path="${src.loc}/metadata.xml" /> |
121 | | -<include-file name="design.xml" path="${src.loc}/design.xml" /> |
122 | | - |
123 | | -<!-- add flex3/flex4 compiler arg --> |
124 | | -<compiler.define name="CONFIG::flex3" value="true" /> |
125 | | -<compiler.define name="CONFIG::flex4" value="false" /> |
126 | | - |
127 | | -<!-- Configure the flex framework libraries as external link dependencies --> |
128 | | -<external-library-path dir="${FLEX_HOME}/frameworks" append="true"> |
129 | | -<include name="libs" /> |
130 | | -<include name="locale/{locale}" /> |
131 | | -</external-library-path> |
132 | | - |
133 | | -<keep-as3-metadata name="Autowire"/> |
134 | | -<keep-as3-metadata name="Dispatcher"/> |
135 | | -<keep-as3-metadata name="EventHandler"/> |
136 | | -<keep-as3-metadata name="Inject"/> |
137 | | -<keep-as3-metadata name="Mediate"/> |
138 | | -<keep-as3-metadata name="PostConstruct"/> |
139 | | -<keep-as3-metadata name="PreDestroy"/> |
140 | | -<keep-as3-metadata name="ViewAdded"/> |
141 | | -<keep-as3-metadata name="ViewNavigator"/> |
142 | | -<keep-as3-metadata name="ViewRemoved"/> |
143 | | - |
144 | | -<!-- Sets java.awt.headless=true so font compilation works in headless environments --> |
145 | | -<headless-server>true</headless-server> |
146 | | -</compc> |
147 | | - |
148 | | -<echo message="${swiz.name.flex3}.swc has been created in ${bin.loc}" /> |
149 | 181 | </target> |
150 | 182 |
|
151 | 183 | <target name="asdoc" depends="init" description="Generate ASDoc documentation"> |
|
175 | 207 | <include name="${swiz.name.flex3}.swc" /> |
176 | 208 | </zipfileset> |
177 | 209 |
|
| 210 | +<!-- Include the RSL .swf files --> |
| 211 | +<zipfileset dir="${bin.loc}/rsl" prefix="${swiz.name}/rsl" /> |
| 212 | + |
178 | 213 | <!-- Include README.markdown --> |
179 | 214 | <zipfileset dir="${basedir}" prefix="${swiz.name}"> |
180 | 215 | <include name="README.markdown" /> |
|
0 commit comments