You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build-aspectjlib.xml 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <!-- wrapped at 70 characters, long elements wrapped -->
  2. <!-- ===========================================================================
  3. Copyright (c) 2005 Contributors.
  4. All rights reserved.
  5. This program and the accompanying materials are made available
  6. under the terms of the Eclipse Public License v 2.0
  7. which accompanies this distribution and is available at
  8. https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
  9. Contributors:
  10. Wes Isberg initial implementation
  11. ============================================================================ -->
  12. <project name="aspectj-library" default="aspectjlib" basedir=".">
  13. <target name="aspectjlib" depends="compile" />
  14. <target name="info">
  15. <echo>
  16. This script builds the AspectJ library.
  17. Relevant targets:
  18. aspectjlib build library
  19. Setup:
  20. - Run from the doc/aspectjlib directory in your AspectJ distribution.
  21. The tasks in ../../lib/aspectjtools.jar are used automatically.
  22. Variants:
  23. - To define a variable, use the Ant -D option - e.g., on Windows:
  24. ant -f build.xml -DJAVA_HOME=c:\jdk1.3.1 -Dnorun=skip
  25. </echo>
  26. </target>
  27. <!-- ============================================================= -->
  28. <!-- setup and cleanup targets -->
  29. <!-- ============================================================= -->
  30. <target name="clean"
  31. depends="init"
  32. description="clean and create classes/jar dir, .ajesym files"
  33. >
  34. <delete quiet="on" dir="${jar.dir}" />
  35. <delete quiet="on">
  36. <fileset dir="${org.aspectj.lib.dir}"
  37. includes="**/*.ajesym"
  38. />
  39. </delete>
  40. <mkdir dir="${jar.dir}" />
  41. </target>
  42. <target name="init" depends="init.variables,init.taskdefs" />
  43. <target name="init.variables" description="init variables">
  44. <property name="org.aspectj.lib.dir" location="${basedir}" />
  45. <property name="src.dir"
  46. location="${org.aspectj.lib.dir}/src"
  47. />
  48. <!-- find AspectJ lib dir in distribution or AspectJ CVS tree -->
  49. <property name="aspectj.dist.lib"
  50. location="${basedir}/../../lib"
  51. />
  52. <property name="aspectj.tree.lib"
  53. location="${basedir}/../lib/aspectj/lib"
  54. />
  55. <condition property="aspectj.lib.dir"
  56. value="${aspectj.dist.lib}"
  57. >
  58. <available file="${aspectj.dist.lib}/aspectjtools.jar" />
  59. </condition>
  60. <condition property="aspectj.lib.dir"
  61. value="${aspectj.tree.lib}"
  62. >
  63. <available file="${aspectj.tree.lib}/aspectjtools.jar" />
  64. </condition>
  65. <property name="aspectjrt.jar"
  66. location="${aspectj.lib.dir}/aspectjrt.jar"
  67. />
  68. <property name="aspectjtools.jar"
  69. location="${aspectj.lib.dir}/aspectjtools.jar"
  70. />
  71. <property name="aspectjweaver.jar"
  72. location="${aspectj.lib.dir}/aspectjweaver.jar"
  73. />
  74. <property name="jar.dir"
  75. location="${org.aspectj.lib.dir}/jars"
  76. />
  77. <property name="aspectjlib.out.jar"
  78. location="${jar.dir}/aspectjlib.out.jar"
  79. />
  80. <available file="${aspectjtools.jar}"
  81. property="aspectjtools.jar.available"
  82. />
  83. <available file="${aspectjrt.jar}"
  84. property="aspectjrt.jar.available"
  85. />
  86. <property name="library.packages" value="org.aspectj.lib" />
  87. </target>
  88. <target name="init.taskdefs"
  89. depends="init.variables,
  90. aspectjtools.jar.available,
  91. aspectjrt.jar.available"
  92. unless="taskdefs.init"
  93. >
  94. <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties"
  95. >
  96. <classpath>
  97. <pathelement path="${aspectjtools.jar}" />
  98. </classpath>
  99. </taskdef>
  100. <property name="taskdefs.init" value="true" />
  101. </target>
  102. <target name="aspectjrt.jar.available"
  103. depends="init.variables"
  104. unless="aspectjrt.jar.available"
  105. >
  106. <fail message="expecting aspectjrt.jar at ${aspectjrt.jar}" />
  107. </target>
  108. <target name="aspectjtools.jar.available"
  109. depends="init.variables"
  110. unless="aspectjtools.jar.available"
  111. >
  112. <fail message="expecting aspectjtools.jar at ${aspectjtools.jar}"
  113. />
  114. </target>
  115. <target name="compile"
  116. depends="init"
  117. description="compile library"
  118. >
  119. <antcall target="clean" />
  120. <!-- can use ajc or iajc here -->
  121. <iajc sourceroots="${src.dir}"
  122. fork="true"
  123. forkclasspath="${aspectjtools.jar}"
  124. classpath="${aspectjrt.jar}"
  125. outjar="${aspectjlib.out.jar}"
  126. />
  127. </target>
  128. </project>