1

以前は Eclipse を使用してのみビルドされていた Android アプリケーションを構築しようとしていますが、ビルドを自動化するために ant4Eclipse を使用しています。これには 2 つのプロジェクトがあり、1 つは JAR としてビルドされ、もう 1 つは APK (JAR を参照します) です。どちらのプロジェクトも Android ライブラリを参照しています。

目的のマクロ ビルド プロセスは次のとおりです。

  1. JAR プロジェクト (XX と呼ばれる) をビルドします。
  2. JAR プロジェクトを APK プロジェクトの lib フォルダーにエクスポートします。
  3. APK プロジェクトをビルドする

現在、JAR をビルドしようとしています。2 番目のプロジェクトでは、さらに多くの問題に遭遇することになると確信していますが、一度に 1 つのことです。これが私のbuild.xmlです:

<project 
      name="XX"

       xmlns:ant4eclipse="antlib:org.ant4eclipse"
       xmlns:antcontrib="antlib:net.sf.antcontrib">

<property environment="env"/>
<property name="workspaceDirectory" value="${basedir}/.." />

<taskdef uri="antlib:net.sf.antcontrib"
         resource="net/sf/antcontrib/antlib.xml" />

<taskdef uri="antlib:org.ant4eclipse"
         resource="org/ant4eclipse/antlib.xml" />

<import file="${env.ANT_HOME}/lib/a4e-jdt-macros.xml"/>

<!-- This is here because ANT found this library reference in my project's .classpath and couldn't find it, so I added it thus -->
<ant4eclipse:jdtClassPathLibrary name="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK">
    <fileset dir="C:\eclipse\eclipse-galileo\plugins">
      <include name="com.android.ide.eclpise.*.jar"/>
    </fileset>
</ant4eclipse:jdtClassPathLibrary >
<!-- I borrowed this from http://stackoverflow.com/questions/5649348/ant4eclipse-examples -->
 <target name="compileAndJar">
    <buildJdtProject workspacedirectory="${workspaceDirectory}" projectname="XX">
      <finish>
        <jar destfile="${jar.dir}/myjar.jar">
          <ant4eclipse:jdtProjectFileSet 
              workspacedirectory="${workspaceDirectory}"
              projectname="${buildJdtProject.project.name}"/>
        </jar>
      </finish>
    </buildJdtProject>
  </target>
</project>

ant compileAndJarを実行したときに表示されるエラーは次のとおりです。

BUILD FAILED
C:\dev\Project\Client\Android\XX\build.xml:31: The following error occurred while executing this line:
C:\bin\apache-ant-1.8.2\lib\a4e-jdt-macros.xml:77: The following error occurred while executing this line:
C:\bin\apache-ant-1.8.2\lib\a4e-jdt-macros.xml:133: Reference buildJdtProject.boot.classpath.path not found.

また、ビルド出力にこれが表示されていることに注意してください。

 [echo]   - bootclasspath      -> ${buildJdtProject.boot.classpath}
4

0 に答える 0