Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Packaging and signing using ant (in Adobe Flash Builder)

by BlackBerry Development Advisor on ‎04-20-2011 03:15 PM (1,615 Views)

Here is an ant script to package application in the debug or release mode. The example script below uses the sample project that comes with BlackBerry® Tablet OS SDK and can be used with Adobe® Flash Builder®.

 

It assumes Flash Builder has created the bin-debug folder. If you don't have Flash Builder, modify debug target to compile the application and copy all assets to the bin-debug (or bin-release) folder.

 

To run this, simply drop this into the example project root folder, right click Run As > Ant Build.

 

 

<!-- 
This build.xml works with sdk's HelloWorld example project.
* Copy this file to the root of the project
* Modify it (see MODIFY comment)
Other changes you need to do before using it:
* Edit HelloWorld-app.xml and replace text in <content> tag with <content>HelloWorld.swf</content>
* Edit blackberry-tablet.xml <publisher> tag and enter your company name/develop name used for signing
* We assume you registered keys and have a development certificate in the default location
-->
<project name="HelloWorld" default="release" basedir=".">
<!-- MODIFY path to your sdk here -->
<property name="SDK_HOME" value="C:\Users\Alena\blackberry-tablet-sdk-0.9.4" />
<property name="airpackager" value="${SDK_HOME}/lib/BarAir.jar" />
<property name="project" value="HelloWorld" />
<property name="bin_debug" value="bin-debug" />
<property name="bin_release" value="bin-release" />
<property name="src" value="src" />

<target name="debug">
<delete file="${bin_debug}/${project}-app.xml" verbose="true" />
<delete verbose="true">
<fileset dir="${bin_debug}" includes="**/*.tmp" />
<fileset dir="${bin_debug}" includes="**/*.bar" />
</delete>
<java jar="${airpackager}" fork="true" failonerror="true">
<arg value="-package" />
<arg value="${bin_debug}/${project}-debug.bar" />
<arg value="${src}/${project}-app.xml" />
<arg value="-devMode" />
<arg value="-C" />
<arg value="${bin_debug}" />
<arg value="${bin_debug}" />
</java>
</target>
<target name="compile_release">
<delete dir="${bin_release}" verbose="true" />
<mkdir dir="${bin_release}" />
<delete file="${bin_debug}/${project}-app.xml" verbose="true" />
<delete verbose="true">
<fileset dir="${bin_debug}" includes="**/*.tmp" />
<fileset dir="${bin_debug}" includes="**/*.bar" />
</delete>
<copy todir="${bin_release}">
<fileset dir="${bin_debug}" />
</copy>
<exec executable="${SDK_HOME}/bin/amxmlc.bat">
<arg value="-debug=false" />
<arg value="${src}/${project}.as" />
<arg value="-output" />
<arg value="${bin_release}/${project}.swf" />
</exec>
</target>
<target name="inc_version">
<propertyfile file="./build.properties">
<entry key="build.number" type="int" operation="+" value="1" />
</propertyfile>
<property file="./build.properties" />
<echo message="Build number ${build.number}"/>
</target>
<target name="release" depends="compile_release,inc_version">
<java jar="${airpackager}" fork="true" failonerror="true">
<arg value="-package" />
<arg value="${bin_release}/${project}-release.bar" />
<arg value="${src}/${project}-app.xml" />
<!-- setting build number (it is increased automatically) -->
<arg value="-buildId" />
<arg value="${build.number}" />
<!-- signing options -->
<arg value="-signDev" />
<arg value="-signRim" />
<!-- MODIFY your passwords here -->
<arg line="-cskpass 123456" />
<arg line="-storepass 123456" />
<!-- take all file from bin release folder with the root in the folder -->
<arg value="-C" />
<arg value="${bin_release}" />
<arg value="${bin_release}" />
</java>
</target>

</project>
Users Online
Currently online: 31 members 7,063 guests
Please welcome our newest community members: