Posts Tagged ‘Ant’

21
May

Include only needed classes using asdoc

If you use asdoc and want to include specific packages only, for example get rid of open-source library classes you are using, you can write the following ANT script (taken from this post):

<?xml version="1.0" encoding="UTF-8"?>
<project name="Labstr" default="asdoc" basedir=".">

<!-- File with PC specific properties -->
	<property file="local.properties" />

	<target name="asdoc">
<!-- Put docs into folder named docs in project root -->
		<delete dir="${basedir}/docs"/>
		<mkdir dir="${basedir}/docs"/>

<!-- Get a list of files you don't want to be included in the docs, i.e. all the files except the ones you need. -->
		<fileset id="sources" dir="${basedir}/src">
		 	<exclude name="**/your/package/name/**"/>
		</fileset>

<!-- Convert file names to fully qualified class names. -->
         	<pathconvert property="classes" pathsep=" " refid="sources">
<!-- ChainedMapper executes its child mappers in sequence. -->
        	 	<chainedmapper>
<!-- Basic OR mapper for windows and mac slashes. Removes full path part we don't need. -->
        		 	<mapper>
	        	 		<globmapper from="${basedir}\src\*" to="*" />
	        	 		<globmapper from="${basedir}/src/*" to="*" />
        		 	</mapper>
<!-- Converts file path to class name. -->
        		 	<mapper type="package" from="*.as" to="*" />
        	 	</chainedmapper>
         	</pathconvert>

<!-- Executes asdoc. -->
		<exec executable="${ASDOC}" dir="${basedir}">
			<arg line="-source-path ${basedir}/src
					   -doc-sources ${basedir}/src
					   -exclude-classes ${classes}
					   -output docs"/>
		</exec>
	</target>

</project>

My local.properties content is the following:

FLEX_HOME=e:/work/4.5.0
ASDOC=${FLEX_HOME}/bin/asdoc.exe

Tags: ,

31
Mar

Flash Builder: “Specified VM install not found: type Standard VM”

Got this stupid error today while trying to run Ant script in Flash Builder. Thanks to this post I fixed it. Just delete .metadata\.plugins\org.eclipse.debug.core\.launches\*.xml.launch file in your workspace.

Tags: , ,

25
Mar

How to build your Flex app for iOS with AIR 2.6

AIR 2.6 brought a lot of great stuff, but one specific feature I just couldn’t pass by — publishing for iOS. Yes, there was this thing called Packager For Iphone, but now it is a part of ADT and is claimed to be much faster.

So, we have Flash Builder Burrito, Flex Hero SDK focused on mobile development and now AIR 2.6. You can see clear vector where Adobe is moving. There are many tutorials for Android platform, but iOS is lacking. So, let’s try to compile a small Flex application for iPad.

Tags: , , , , , , , , , , , , , , , ,

14
Sep

mxmlc, ant and metadata

Just not to forget how to make mxmlc and task save my custom metadata.

<target name="compile.test" >
 <mxmlc file="${source.dir}/TestsLauncher.mxml" output="${bin.dir}/tests/TestsRunner.swf" keep-generated-actionscript="false">
 <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
 <source-path path-element="${FLEX_HOME}/frameworks" />
 <source-path path-element="${source.dir}" />
 <compiler.library-path dir="${libs.dir}" append="true" >
 <include name="fluint.swc" />
 <include name="alcon.swc" />
 </compiler.library-path>
 <keep-as3-metadata name="Meta1"/>
 <keep-as3-metadata name="Meta2"/>
 </mxmlc>
 </target>

Tags: , ,