エラーが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>
この問題の解決方法のサンプルコードとxmlを教えてください。ありがとう – Lisa
カスタム '-compile'ターゲットの中から' -set-debug-mode'ターゲットを呼び出そうとする可能性があります。あなたがする最初のことと呼ぶだけです。しかし、私たちは実際にこのアイデアを廃止し、私たちの外部ビルドプロセスをEclipseで動作させる努力をする価値はないと判断しました。だから、私はそれをさらにテストすることができません。 – prolink007