라이브러리 프로젝트와 개미를 사용하여 테스트 :안드로이드 장치 R18
Android unit test using ant with library project 내가 질문에 제안 된 두 가지 방법을 시도하지만, 안드로이드 도구의 R18 출시에, I 점점 오전 : 뭔가가 안드로이드 도구의 R18에 변경된 경우 원래의 질문에 대한 답변에 대한 해결 방법에 대한 조리법을 다음에 실패, 또는 사람 나야 경우
NTServicesTest/build.xml:110: Reference jar.libs.ref not found.
나는 확실하지 않다.
내 폴더 설정이 포함 PROJ 폴더에 .. :
NTServices, NTServicesTest, NTServicesTestApp I는 다음과 같이 내 NTServicesTest/project.properties를 수정 @Snicolas 의 해결을 위해
:
# Project target.
target=android-15
tested.android.library.reference.1=../NTServices
그리고 내 NTServicesTest/build.xml 파일은 다음과 같습니다 (오른쪽에서 버전 태그 아래)
<import file="${sdk.dir}/tools/ant/build.xml" />
<!-- override "compile" target in platform android_rules.xml to include tested app's external libraries -->
<!-- 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>
<echo message="jar libs dir : ${tested.project.target.project.libraries.jars}"/>
<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">
<src path="${source.absolute.dir}" />
<src path="${gen.absolute.dir}" />
<classpath>
<!-- steff: we changed one line here !-->
<fileset dir="${tested.android.library.reference.1}/bin/" includes="*.jar"/>
<fileset dir="${extensible.libs.classpath}" includes="*.jar" />
</classpath>
<compilerarg line="${java.compilerargs}" />
</javac>
<!-- 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>