4 Replies Latest reply on Oct 28, 2008 4:10 PM by curtisa2

    running adt from an ant script

    curtisa2 Level 1
      Hi,
      Has anyone successfully managed to use ant to build the AIR installation file pls?
      I'm trying to add this as the final step when I'm developing AIR apps (in Netbeans) but adt keeps saying that the root content .html file is missing from the package (when I know it's in the folder). Specifically the ant code I'm trying to run is ...

      <exec executable="${_air.sdk.dir}/bin/adt">
      <arg value="-package"/>
      <arg value="-storetype" />
      <arg value="pkcs12" />
      <arg value="-keystore" />
      <arg value="${_build.dir}/sampleCert.pfx" />
      <arg value="-storepass" />
      <arg value="${key.password}" />
      <arg value="${_build.dir}/${_project.name}.air" />
      <arg value="${_build.dir}/${_air.app.name}" />
      <arg value="${_build.dir}/HelloWorld.html" />
      <arg value="${_build.dir}/AIRAliases.js" />
      </exec>

      (the build.dir definitely has all the .html, .js, .xml files)
      Does that look right ?
      Thanks vm,
      Alex
        • 1. Re: running adt from an ant script
          tzeng Adobe Employee
          Your command might put the root content into a ${_build.dir} directory within the package. That is not the root content file is expected.

          I would test the command out first to make sure your command works.

          -ted
          • 2. Re: running adt from an ant script
            duncanhall Level 1
            This is the task I use for publishing, which looks very similar to yours:

            <!-- Packaging the application to an air-file in the publish directory -->
            <target name="6. Package application" depends="4. Compile for publishing">
            <java jar="${adt}" fork="true" failonerror="true">
            <arg value="-package" />
            <arg value="-storetype" />
            <arg value="pkcs12" />
            <arg value="-keystore" />
            <arg value="${certificate}" />
            <arg value="-storepass" />
            <arg value="${certificate_pw}" />
            <arg value="${publish_dir}/${air_file}" />
            <arg value="${app_descriptor}" />
            <arg value="-C" />
            <arg value="${build_dir}/" />
            <arg value="${compilation}" />
            </java>
            </target>

            The only difference I can see is that you're not including a '-C' argument, which could be why your files are not getting copied into the published AIR file.
            • 3. Re: running adt from an ant script
              tzeng Adobe Employee
              curtisa2's command should let the files copied into the package. But they are not copied into the right place.

              -C should be the option to solve this problem.

              -ted
              • 4. Re: running adt from an ant script
                curtisa2 Level 1
                Thanks all, yep that -C was what I needed.

                Cheers
                Alex