2012-02-27 3 views
3

エラーがbuild.xmlファイルを実行しようとしたとき、私は-build-setup作業中にこのエラーを取得しています下

であります(android sdkによって生成された)カップルの依存関係を持つプロジェクトで、実行しようとしているタスクは-compileです。私はEclipseビルド関数を使ってこのantファイルを実行するためにEclipseを使用しています。このbuild.xmlファイルをプロジェクトのビルダーとして割り当て、唯一のビルダーとして設定しました。そして、次の目標を設定:

<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AFTER_CLEAN_TARGETS" value="-compile,"/> 
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AUTO_TARGETS" value="-compile,"/> 
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_CLEAN_TARGETS" value="clean,"/> 
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="clean,nodeps,debug,"/> 

どちらの依存関係も生成build.xmlファイルを使用しています。私のbuild.xmlファイルはすべて、-compileタスクに乗っていません。下部にはbuild.xmlファイルにある-compileタスクが掲示されています。

依存関係のプロジェクトは、Androidのライブラリであり、私は彼らのアリビルダーには、次のよう日食に設定している:

<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AFTER_CLEAN_TARGETS" value="nodeps,debug,"/> 
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AUTO_TARGETS" value="nodeps,debug,"/> 
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_CLEAN_TARGETS" value="clean,"/> 
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="debug,"/> 

私はこのエラーを取得しておくんし、私はこれをどのように修正するのはなぜ?



私の現在の仕事の周り

私は、次へAppNameAのターゲットを変更すると、それが正常に動作します。しかし、私はこれをやろうとは思っていません...あなたが本当に望むのは、それらのポイントでコンパイルすることです。

<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AFTER_CLEAN_TARGETS" value="debug,"/> 
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AUTO_TARGETS" value="debug,"/> 
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_CLEAN_TARGETS" value="clean,"/> 
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="clean,nodeps,debug,"/> 

はここで正確なエラーです:

BUILD FAILED 
C:\Users\myusername\android-sdks\tools\ant\build.xml:485: The following error occurred while executing this line: 
Target "${build.target}" does not exist in the project "AppNameA". 

build.xmlファイルである-compileタスク。

(基本的にはオリジナルと同じで、1つのマイナーな変更がある...)

<!-- Compiles this project's .java files into .class files. --> 
<target name="-compile" depends="-build-setup, -pre-build, -code-gen, -pre-compile"> 
    <do-only-if-manifest-hasCode elseText="hasCode = false. Skipping..."> 
     <!-- If android rules are used for a test project, its classpath should include 
      tested project's location --> 
     <condition property="extensible.classpath" 
       value="${tested.project.absolute.dir}/bin/classes" 
       else="."> 
      <isset property="tested.project.absolute.dir" /> 
     </condition> 
     <condition property="extensible.libs.classpath" 
       value="${tested.project.absolute.dir}/${jar.libs.dir}" 
       else="${jar.libs.dir}"> 
      <isset property="tested.project.absolute.dir" /> 
     </condition> 
     <javac encoding="${java.encoding}" 
       source="${java.source}" target="${java.target}" 
       debug="true" extdirs="" includeantruntime="false" 
       destdir="${out.classes.absolute.dir}" 
       bootclasspathref="android.target.classpath" 
       verbose="${verbose}" 
       classpath="${extensible.classpath}" 
       classpathref="jar.libs.ref" 
       excludes="${filesToExcludeFromCompile}" 
       failonerror="true" 
      > 
      <src path="${source.absolute.dir}" /> 
      <src path="${gen.absolute.dir}" /> 
      <classpath> 
       <fileset dir="${extensible.libs.classpath}" includes="*.jar" /> 
      </classpath> 
      <compilerarg line="${java.compilerargs}" /> 
     </javac> 
     <!-- if the project is a library then we generate a jar file --> 
     <if condition="${project.is.library}"> 
      <then> 
       <echo>Creating library output jar file...</echo> 
       <property name="out.library.jar.file" location="${out.absolute.dir}/classes.jar" /> 
       <if> 
        <condition> 
         <length string="${android.package.excludes}" trim="true" when="greater" length="0" /> 
        </condition> 
        <then> 
         <echo>Custom jar packaging exclusion: ${android.package.excludes}</echo> 
        </then> 
       </if> 
       <jar destfile="${out.library.jar.file}"> 
        <fileset dir="${out.classes.absolute.dir}" excludes="**/R.class **/R$*.class"/> 
        <fileset dir="${source.absolute.dir}" excludes="**/*.java ${android.package.excludes}" /> 
       </jar> 
      </then> 
     </if> 

     <!-- if the project is instrumented, intrument the classes --> 
     <if condition="${build.is.instrumented}"> 
      <then> 
       <echo>Instrumenting classes from ${out.absolute.dir}/classes...</echo> 
       <!-- It only instruments class files, not any external libs --> 
       <emma enabled="true"> 
        <instr verbosity="${verbosity}" 
          mode="overwrite" 
          instrpath="${out.absolute.dir}/classes" 
          outdir="${out.absolute.dir}/classes"> 
        </instr> 
        <!-- TODO: exclusion filters on R*.class and allowing custom exclusion from 
         user defined file --> 
       </emma> 
      </then> 
     </if> 
    </do-only-if-manifest-hasCode> 
</target> 

答えて

2

私はこの問題を考え出しました。

${build.target}は実際に-set-debug-mode-set-release-modeタスクに設定されています。したがって、-compileタスクを直接呼び出すときは、これらのタスクのいずれかを依存関係として呼び出すことはありません。

したがって、実際には${build.target}は決して決してない。

この問題を回避するには、タスクの1つを無効にし、設定されていない場合は${build.target}に設定します。あなたが承認したデフォルトに設定してください。

+0

この問題の解決方法のサンプルコードとxmlを教えてください。ありがとう – Lisa

+0

カスタム '-compile'ターゲットの中から' -set-debug-mode'ターゲットを呼び出そうとする可能性があります。あなたがする最初のことと呼ぶだけです。しかし、私たちは実際にこのアイデアを廃止し、私たちの外部ビルドプロセスをEclipseで動作させる努力をする価値はないと判断しました。だから、私はそれをさらにテストすることができません。 – prolink007

0

java.targetというプロパティは、build.xmlファイルで設定されていません。

私はメッセージが「ターゲット」と呼ばれる属性を持って、次のANTタスクによってスローされる数える

<javac encoding="${java.encoding}" 
     source="${java.source}" target="${java.target}" 
     debug="true" extdirs="" includeantruntime="false" 
     destdir="${out.classes.absolute.dir}" 
     bootclasspathref="android.target.classpath" 
     verbose="${verbose}" 
     classpath="${extensible.classpath}" 
     classpathref="jar.libs.ref" 
     excludes="${filesToExcludeFromCompile}" 
     failonerror="true" 
    > 
+0

その属性はjavaのターゲットバージョンを要求していますか?私もこれが問題だとは思わないが、私はあなたがこのメッセージへの応答で私に与えてくれた何か特別な情報にそれを設定し、それを行っていく。ありがとう – prolink007

+0

android親のbuild.xmlの中で、彼らはすでにこの値を設定しています。 1.5に設定されています。これはアンドロイドが提供する親 'build.xml'の' line 51'です。これはまだ解決されていません。 – prolink007

関連する問題