build_common.xml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="" default="debug">
  3. <!-- link jar files -->
  4. <property name="myjar.libs.dir" value="./sdk" />
  5. <target name="-pre-compile" depends="check-dependens">
  6. <path id="depend.projects.jar">
  7. <fileset file="${project.jar.1}" />
  8. <fileset file="${project.jar.2}" />
  9. </path>
  10. <if condition="${jarExisted}">
  11. <then>
  12. <path id="project.all.jars.path">
  13. <path refid="depend.projects.jar" />
  14. <fileset dir="${myjar.libs.dir}" includes="*.jar" />
  15. </path>
  16. </then>
  17. </if>
  18. </target>
  19. <import file="${sdk.dir}/tools/ant/build.xml" />
  20. <!-- rename the jar file -->
  21. <target name="plugin-publish" depends="release">
  22. <copy file="${out.absolute.dir}/classes.jar" tofile="${out.absolute.dir}/${ant.project.name}.jar" />
  23. <!-- delete temp files -->
  24. <delete>
  25. <fileset dir="${out.absolute.dir}" includes="build.prop AndroidManifest.xml.d jarlist.cache classes.jar"/>
  26. </delete>
  27. </target>
  28. <!-- check the project & jars which current project dependents -->
  29. <target name="check-dependens">
  30. <!-- check the sdk dir is existed or not -->
  31. <condition property="jarExisted">
  32. <and>
  33. <available file="${myjar.libs.dir}" />
  34. </and>
  35. </condition>
  36. <!-- check the projects dependents -->
  37. <condition property="have.proj.1">
  38. <isset property="android.library.reference.1" />
  39. </condition>
  40. <if condition="${have.proj.1}">
  41. <then>
  42. <property name="project.jar.1" value="${android.library.reference.1}/bin/classes.jar" />
  43. </then>
  44. </if>
  45. <condition property="have.proj.2">
  46. <isset property="android.library.reference.2" />
  47. </condition>
  48. <if condition="${have.proj.2}">
  49. <then>
  50. <property name="project.jar.2" value="${android.library.reference.2}/bin/classes.jar" />
  51. </then>
  52. </if>
  53. </target>
  54. </project>