1 <project name="no.uio.ifi.refaktor" default="compile-ajc" basedir=".">
10 <target name="clean" depends="init">
11 <delete quiet="on" dir="${output.dir}"/>
12 <mkdir dir="${output.dir}"/>
15 <target name="init" depends="init.variables,init.taskdefs"/>
17 <target name="init.variables">
19 <property name="build.compiler.clean" value="anything"/>
21 <!-- build.compiler value to pick up our CompilerAdapter for javac -->
22 <property name="ajc.adapter"
23 value="org.aspectj.tools.ant.taskdefs.Ajc11CompilerAdapter"/>
25 <!-- required directories - run from examples or predefine -->
26 <property name="aspectj.lib.dir"
27 location="${basedir}/lib/aspectj"/>
29 <!-- required libraries - install or predefine -->
30 <property name="aspectjrt.jar"
31 location="${aspectj.lib.dir}/aspectjrt.jar"/>
32 <property name="aspectjtools.jar"
33 location="${aspectj.lib.dir}/aspectjtools.jar"/>
35 <property name="plugin.copy.dir"
36 location="${basedir}/plugincopies"/>
38 <property name="output.dir"
39 location="${basedir}/bin"/>
41 <property name="source.dir"
42 location="${basedir}/src"/>
44 <!-- checking required libraries -->
45 <available file="${aspectjtools.jar}"
46 property="aspectjtools.jar.available"/>
47 <available file="${aspectjrt.jar}"
48 property="aspectjrt.jar.available"/>
51 <property name="ECLIPSE_HOME" value="../../../bin/.software/eclipse"/>
53 <property name="debuglevel" value="source,lines,vars"/>
54 <property name="target" value="1.6"/>
55 <property name="source" value="1.6"/>
57 <condition property="plugins-location" value="${ECLIPSE_HOME}/plugins" else="${plugin.copy.dir}">
58 <isset property="ECLIPSE_HOME"/>
61 <condition property="runtime-registry-compatibility-dir"
62 value="org.eclipse.core.runtime.compatibility.registry_3.5.200.v20130514-1256/" else="">
63 <isset property="ECLIPSE_HOME"/>
66 <path id="dependencies.libraryclasspath">
67 <pathelement location="${plugins-location}/org.eclipse.ui_3.105.0.v20130522-1122.jar"/>
68 <pathelement location="${plugins-location}/org.eclipse.swt_3.102.1.v20130827-2021.jar"/>
69 <pathelement location="${plugins-location}/org.eclipse.swt.gtk.linux.x86_64_3.102.1.v20130827-2048.jar"/>
70 <pathelement location="${plugins-location}/org.eclipse.jface_3.9.1.v20130725-1141.jar"/>
71 <pathelement location="${plugins-location}/org.eclipse.core.commands_3.6.100.v20130515-1857.jar"/>
72 <pathelement location="${plugins-location}/org.eclipse.ui.workbench_3.105.1.v20130821-1411.jar"/>
73 <pathelement location="${plugins-location}/org.eclipse.e4.ui.workbench3_0.12.0.v20130515-1857.jar"/>
74 <pathelement location="${plugins-location}/org.eclipse.core.runtime_3.9.0.v20130326-1255.jar"/>
75 <pathelement location="${plugins-location}/org.eclipse.osgi_3.9.1.v20130814-1242.jar"/>
76 <pathelement location="${plugins-location}/org.eclipse.equinox.weaving.hook_1.0.200.I20130319-1000.jar"/>
77 <pathelement location="${plugins-location}/org.eclipse.equinox.common_3.6.200.v20130402-1505.jar"/>
78 <pathelement location="${plugins-location}/org.eclipse.core.jobs_3.5.300.v20130429-1813.jar"/>
79 <pathelement location="${plugins-location}/${runtime-registry-compatibility-dir}runtime_registry_compatibility.jar"/>
80 <pathelement location="${plugins-location}/org.eclipse.equinox.registry_3.5.301.v20130717-1549.jar"/>
81 <pathelement location="${plugins-location}/org.eclipse.equinox.preferences_3.5.100.v20130422-1538.jar"/>
82 <pathelement location="${plugins-location}/org.eclipse.core.contenttype_3.4.200.v20130326-1255.jar"/>
83 <pathelement location="${plugins-location}/org.eclipse.equinox.app_1.3.100.v20130327-1442.jar"/>
84 <pathelement location="${plugins-location}/org.eclipse.jdt.core_3.11.1.v20150902-1521.jar"/>
85 <pathelement location="${plugins-location}/org.eclipse.jdt.compiler.apt_1.2.0.v20150514-0146.jar"/>
86 <pathelement location="${plugins-location}/org.eclipse.jdt.compiler.tool_1.1.0.v20150513-2007.jar"/>
87 <pathelement location="${plugins-location}/org.eclipse.jdt.core.manipulation_1.5.100.v20141002-1241.jar"/>
88 <pathelement location="${plugins-location}/org.eclipse.jdt.ui_3.11.1.v20150827-1306.jar"/>
89 <pathelement location="${plugins-location}/org.eclipse.ltk.core.refactoring_3.6.100.v20130605-1748.jar"/>
90 <pathelement location="${plugins-location}/org.eclipse.core.resources_3.8.101.v20130717-0806.jar"/>
91 <pathelement location="${plugins-location}/org.eclipse.text_3.5.300.v20130515-1451.jar"/>
92 <pathelement location="${plugins-location}/org.eclipse.jface.text_3.8.101.v20130802-1147.jar"/>
93 <pathelement location="${plugins-location}/org.eclipse.ui.ide_3.9.1.v20130704-1828.jar"/>
94 <pathelement location="${plugins-location}/org.eclipse.ui.editors_3.8.100.v20130513-1637.jar"/>
95 <pathelement location="${plugins-location}/org.eclipse.core.filebuffers_3.5.300.v20130225-1821.jar"/>
96 <pathelement location="${plugins-location}/org.eclipse.core.expressions_3.4.500.v20130515-1343.jar"/>
97 <pathelement location="${plugins-location}/org.aspectj.runtime_1.7.3.20130613144500-a.jar"/>
98 <pathelement location="${plugins-location}/org.aspectj.ajde_1.7.3.20130613144500-a.jar"/>
99 <pathelement location="${plugins-location}/org.aspectj.weaver_1.7.3.20130613144500-a.jar"/>
100 <pathelement location="${plugins-location}/org.eclipse.ui.views_3.6.100.v20130326-1250.jar"/>
101 <pathelement location="${plugins-location}/org.eclipse.ui.workbench.texteditor_3.8.101.v20130729-1318.jar"/>
103 <path id="no.uio.ifi.refaktor.classpath">
104 <pathelement location="lib/Metrics.jar"/>
105 <path refid="dependencies.libraryclasspath"/>
106 <pathelement location="bin"/>
110 <target name="init.taskdefs" depends="init.variables,
111 aspectjtools.jar.available,
112 aspectjrt.jar.available"
113 unless="taskdefs.init">
114 <!-- sets name of new task to iajc, old task to ajc -->
115 <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
117 <pathelement path="${aspectjtools.jar}"/>
120 <property name="taskdefs.init" value="true"/>
123 <!-- targets to fail unless required libraries available -->
125 <target name="aspectjrt.jar.available" depends="init.variables"
126 unless="aspectjrt.jar.available" >
127 <fail message="expecting aspectjrt.jar at ${aspectjrt.jar}"/>
130 <target name="aspectjtools.jar.available" depends="init.variables"
131 unless="aspectjtools.jar.available" >
132 <fail message="expecting aspectjtools.jar at ${aspectjtools.jar}"/>
135 <target name="copy-plugins" depends="init.variables">
136 <delete quiet="on" dir="${plugin.copy.dir}"/>
137 <mkdir dir="${plugin.copy.dir}"/>
138 <copy todir="${plugin.copy.dir}" flatten="true">
139 <path refid="dependencies.libraryclasspath"/>
143 <target name="compile" depends="init">
144 <antcall target="clean" />
145 <javac srcdir="${source.dir}" destdir="${output.dir}" source="1.7" includeantruntime="false" >
146 <classpath refid="no.uio.ifi.refaktor.classpath"/>
148 <!-- compilerarg's ignored unless using our compiler adapter -->
149 <compilerarg compiler="${ajc.adapter}" line="-verbose -Xlint -proceedOnError"/>
150 <!-- use separate values if a path might have spaces -->
151 <compilerarg compiler="${ajc.adapter}" value="-classpath"/>
152 <compilerarg compiler="${ajc.adapter}" value="${aspectjrt.jar}"/>
154 <compilerarg compiler="${ajc.adapter}" path="${source.dir}/no/uio/ifi/refaktor/statistics/StatisticsAspect.aj"/>
155 <compilerarg compiler="${ajc.adapter}" path="${source.dir}/no/uio/ifi/refaktor/debugging/aspects/HeapDumperAspect.aj"/>
156 <compilerarg compiler="${ajc.adapter}" path="${source.dir}/no/uio/ifi/refaktor/debugging/aspects/DebugCatchThrowableAspect.aj"/>
160 <target name="compile-ajc" depends="init">
161 <!-- aspectjtools.jar must be on system/ant classpath -->
162 <antcall target="compile">
163 <param name="build.compiler" value="${ajc.adapter}"/>