I’m having problems packaging an air application with ant.
Adobe references taken from: http://help.adobe.com/en_US/FlashPlatform/develop/air/building_apps/WS5b3ccc516d4fbf351e63e3d118666ade46-7f66.html
I run ant using java classes inherited from org.apache.tools.ant.Task. This builds up the argument list for the adt tool e.g.
Java lJavaTask = new Java();
lJavaTask.bindToOwner(this);
lJavaTask.setJar(new File(this.getFlexInstallDir() + "/adt.jar"));
lJavaTask.setFork(true);
lJavaTask.setFailonerror(true);
lJavaTask.setMaxmemory("512m");
Argument lPackageArg = lJavaTask.createArg();
lPackageArg.setLine(“-package”);
I want to package C:\dev\HEAD\DASHBOARD\MISDashboardAir\dev\src which contains MISDashboardAir.swf MISDashboardAir.-app.xml
Certificate location is C:\dev\HEAD\DASHBOARD.
Debugging out the ant arguments with ant –v gives:
[panFlexCompile] '-package'
[panFlexCompile] '-storetype'
[panFlexCompile] 'pkcs12'
[panFlexCompile] '-keystore'
[panFlexCompile] 'C:\dev\HEAD/DASHBOARD/dashboardCertificate.p12'
[panFlexCompile] '-storepass'
[panFlexCompile] 'panIntelligence'
[panFlexCompile] 'C:\dev\HEAD/DASHBOARD/MISDashboardAir/build/dashboard.air'
[panFlexCompile] 'C:\dev\HEAD/DASHBOARD/MISDashboardAir/dev/src/MISDashboardAir-
app.xml'
[panFlexCompile] '-C '
[panFlexCompile] 'C:\dev\HEAD/DASHBOARD/MISDashboardAir/dev/src/'
[panFlexCompile] 'MISDashboardAir.swf'
The error after running is:
[panFlexCompile] no such file C:\dev\HEAD-C
Matching up against the ant documentation ant xml:
<java jar="${ADT.JAR}" fork="true" failonerror="true">
<arg value="-package"/> [panFlexCompile] '-package'
<arg value="-storetype"/> [panFlexCompile] '-storetype'
<arg value="${STORETYPE}"/> [panFlexCompile] 'pkcs12'
<arg value="-keystore"/> [panFlexCompile] '-keystore'
<arg value="${KEYSTORE}"/> [panFlexCompile] 'C:\dev\HEAD/DASHBOARD/dashboardCertificate.p12'
<arg value="${release}/${AIR_NAME}"/> [panFlexCompile] 'C:\dev\HEAD/DASHBOARD/MISDashboardAir/build/dashboard.air'
<arg value="${APP_DESCRIPTOR}"/> [panFlexCompile] 'C:\dev\HEAD/DASHBOARD/MISDashboardAir/dev/src/MISDashboardAir-app.xml'
<arg value="-C"/> [panFlexCompile] '-C '
<arg value="${build}"/> [panFlexCompile] 'C:\dev\HEAD/DASHBOARD/MISDashboardAir/dev/src'
<arg value="${APP_ROOT_FILE}"/> [panFlexCompile] 'MISDashboardAir.swf'
//not packaging the images yet
The error ‘no such file C:\dev\HEAD-C’ doesn’t seem to make much sense (it’s suggesting it’s expecting a filename here, which doesn’t fit with the documentation) and I have tried many different ways of packaging the files I need. I can’t get any to work.
Incidentally, the following adt command run on the command line from C:\dev\HEAD\DASHBOARD\MISDashboardAir\dev works, whereas the exact same command from ant doesn’t (same error). -package -storetype pkcs12 -keystore C:\dev\HEAD/DASHBOARD/dashboardCertificate.p12 -storepass panIntelligence C:\dev\HEAD/DASHBOARD/MISDashboardAir/build/dashboard.air C:\dev\HEAD/DASHBOARD/MISDashboardAir/dev/src/MISDashboardAir-app.xml -C C:\dev\HEAD/DASHBOARD/MISDashboardAir/dev/src/ MISDashboardAir.swf C:\dev\HEAD/DASHBOARD/MISDashboardAir/dev/src/com/panIntelligence/dashboard/air/icons
Thanks for any help.