You would like to find an easy and automatic way of compiling all your external resource manager localization bundles at once. Create an Ant macro to compile your language resource, and invoke it when necessary. Ant is an automated build framework that allows substantial amounts of automation for repetitive tasks including, among other things, compiling of various assets.

ant.apache.org

cookbooks.adobe.com //
Easily compile resource bundles using Ant

flex3 sdk //
http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html

blog.alanklement //
FDT and ANT | A User’s Guide – Part I

FDT and ANT | A User’s Guide – Part II

hubflanger.com //
Building Flash Projects with Ant and Flex Builder – Part 1
Building Flash Projects with Ant and Flex Builder – Part 2
Building Flash Projects with Ant and Flex Builder – Part 3

Another Flash Blog //
Using ANT in your Flash Development and Be a Better Person! Part 1
Using ANT in your Flash Development Part 2: Basic ANT Concepts

Zusammenfassung der Ant-Tasks von FDT (aus der Hilfe):

fdt.launch.application ::: To use the FDT launch capabilities for AS3 from ANT use this task. You can compile your source to an SWF and optionaly launch this with one of the SWF viewers. If FCSH is installed it is used for incremental compiling.

fdt.launch.library ::: To create SWC files for AS3 you can use this task. All options from the “AS3 FDT Library” launcher are availible. If FCSH is installed it is used for incremental compiling.

fdt.launch.resetFCSH ::: If you use FCSH for compiling and want to reset it (because the classpath changed or something like that) call this task. FCSH is reset and the next compile is a full compile, all incremental information is discarded.

fdt.flashCompile ::: This task compiles a single FLA or a set of FLA’s with the Flash IDE. The Flash IDE must be set in the Flash Preferences (see ” Preparing the workbench (AS2) “). The Flash Output is captured and shown in the console. If any error occurs the build will be aborted. You can define a timeout for how long the build waits for the output. If the timeout is not specified the task will take a 60 second timeout.

fdt.viewDocument ::: Opens a document in the internal SWF Viewer. You can open all types accepted by a browser (html, php, swf, …).fdt.browse ::: Opens a document in the Browser.

fdt.extSWFViewer.focusWindow ::: Focuses a running process. The window pop up to the foreground.

fdt.extSWFViewer.startSWF ::: An existing SWF file is started in the external SWF Viewer.

exec ::: Runs an executable file.
copy
::: Copies one or several files/directories.
zip ::: Creates a “.zip”-file.

Tipp: Ant-Xml-Files mit dem Ant-Editor in FDT öffnen.

Hier ein einfaches Beispiel:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<project name="Test_ANT" default="_defaultTarget">

	<property name="prj.name" value="Test_ANT"/>
	<property name="src.dir" value="${basidr}/../src"/>
	<property name="bin.dir" value="${basdir}/../bin"/>
	<property name="swf.dir" value="${basdir}/../bin/swf"/>

	<target name="_defaultTarget"
			depends="
			startDebugger,
			resetFCSH,
			cleanBinFolder,
			compileMain,
			copyAssetsInBinFolder">
	</target>

	<target name="startDebugger">
		<echo>target::: startDebugger</echo>
		<fdt.startDebugger projectname="${prj.name}"
                 savelocation="launcher" />
	</target>

	<target name="resetFCSH">
		<echo>target::: resetFCSH</echo>
		<fdt.launch.resetFCSH />
	</target>

	<target name="cleanBinFolder">
		<echo>target::: cleanBinFolder</echo>
		<delete dir="${bin.dir}"/>
		<mkdir dir="${bin.dir}" />
		<mkdir dir="${swf.dir}" />
	</target>

	<target name="compileMain">
		<echo>target::: compileMain</echo>
		<fdt.launch.application
			projectname="${prj.name}"
			mainclass="${src.dir}/Main.as"
			target="${swf.dir}/Main.swf"
			startswf="true"
			swflauncher="Adobe Flash Player"
		/>
	</target>

	<target name="copyAssetsInBinFolder">
		<echo>target::: copyAssetsInBinFolder</echo>
		<copy todir="${bin.dir}/assets/">
		  <fileset dir="assets"/>
		</copy>
		<copy file="htmlfile.html"
                      tofile="${bin.dir}/assets/copyhtmlfile.html"/>
	</target>

</project>

Geschrieben in Dreidimensional, Programmiert am 11.01.2010.



Einen Kommentar abgeben...





Bitte beachte: Die Kommentare werden moderiert. Dies kann zu Verzögerungen bei Deinem Kommentar führen. Es besteht kein Grund den Kommentar erneut abzuschicken.