2012-04-12 2 views
2
나는이 질문에서와 같은 문제가 발생하고

라이브러리 프로젝트와 개미를 사용하여 테스트 :안드로이드 장치 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> 

답변

6

classpathref = "jar.libs.ref"의 이름을 classpathref = "project.libraries.jars"로 변경하십시오.

2

예. R18에서이 속성은 project.libraries.jars로 변경되지만 owerrided 작업에서는이 값을 변경하지 않았습니다