]> git.uio.no Git - ifi-stolz-refaktor.git/blob - software/no.uio.ifi.refaktor/build_a_work_in_progress.xml
build_a_work_in_progress: adding paths to specific aspects
[ifi-stolz-refaktor.git] / software / no.uio.ifi.refaktor / build_a_work_in_progress.xml
1 <project name="no.uio.ifi.refaktor" default="compile-ajc" basedir=".">
2
3     <target name="info" >
4         <echo>
5             Targets:
6             compile-ajc
7         </echo>
8     </target>
9
10     <target name="clean" depends="init">
11         <delete quiet="on" dir="${output.dir}"/>
12         <mkdir dir="${output.dir}"/>
13     </target>
14
15     <target name="init"  depends="init.variables,init.taskdefs"/>
16
17     <target name="init.variables">
18         
19         <property name="build.compiler.clean" value="anything"/>
20
21         <!-- build.compiler value to pick up our CompilerAdapter for javac -->
22         <property name="ajc.adapter"
23             value="org.aspectj.tools.ant.taskdefs.Ajc11CompilerAdapter"/>
24
25         <!-- required directories - run from examples or predefine -->
26         <property name="aspectj.lib.dir"
27             location="${basedir}/lib/aspectj"/> 
28
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"/> 
34         <property name="aspectjweaver.jar"
35             location="${aspectj.lib.dir}/aspectjweaver.jar"/>
36
37         <property name="output.dir"
38             location="${basedir}/bin"/> 
39
40         <property name="source.dir"
41             location="${basedir}/src"/> 
42
43         <!-- checking required libraries -->
44         <available file="${aspectjtools.jar}"
45             property="aspectjtools.jar.available"/>
46         <available file="${aspectjrt.jar}"
47             property="aspectjrt.jar.available"/>
48
49         <property name="ECLIPSE_HOME" value="../../../bin/.software/eclipse"/>
50         <property name="debuglevel" value="source,lines,vars"/>
51         <property name="target" value="1.6"/>
52         <property name="source" value="1.6"/>
53         <path id="dependencies.libraryclasspath">
54             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.ui_3.105.0.v20130522-1122.jar"/>
55             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.swt_3.102.1.v20130827-2021.jar"/>
56             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.swt.gtk.linux.x86_64_3.102.1.v20130827-2048.jar"/>
57             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.jface_3.9.1.v20130725-1141.jar"/>
58             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.commands_3.6.100.v20130515-1857.jar"/>
59             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.ui.workbench_3.105.1.v20130821-1411.jar"/>
60             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.e4.ui.workbench3_0.12.0.v20130515-1857.jar"/>
61             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.runtime_3.9.0.v20130326-1255.jar"/>
62             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.osgi_3.9.1.v20130814-1242.jar"/>
63             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.equinox.weaving.hook_1.0.200.I20130319-1000.jar"/>
64             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.equinox.common_3.6.200.v20130402-1505.jar"/>
65             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.jobs_3.5.300.v20130429-1813.jar"/>
66             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.200.v20130514-1256/runtime_registry_compatibility.jar"/>
67             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.equinox.registry_3.5.301.v20130717-1549.jar"/>
68             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.equinox.preferences_3.5.100.v20130422-1538.jar"/>
69             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.contenttype_3.4.200.v20130326-1255.jar"/>
70             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.equinox.app_1.3.100.v20130327-1442.jar"/>
71             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.jdt.core_3.9.1.v20130905-0837.jar"/>
72             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.jdt.compiler.apt_1.0.600.v20130530-1010.jar"/>
73             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.jdt.compiler.tool_1.0.200.v20130530-1010.jar"/>
74             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.jdt.core.manipulation_1.5.0.v20130605-1748.jar"/>
75             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.ltk.core.refactoring_3.6.100.v20130605-1748.jar"/>
76             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.resources_3.8.101.v20130717-0806.jar"/>
77             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.text_3.5.300.v20130515-1451.jar"/>
78             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.jface.text_3.8.101.v20130802-1147.jar"/>
79             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.jdt.ui_3.9.1.v20130820-1427.jar"/>
80             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.ui.ide_3.9.1.v20130704-1828.jar"/>
81             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.ui.editors_3.8.100.v20130513-1637.jar"/>
82             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.filebuffers_3.5.300.v20130225-1821.jar"/>
83             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.jdt.annotation_1.1.0.v20130513-1648.jar"/>
84             <pathelement location="${ECLIPSE_HOME}/plugins/org.hamcrest.core_1.3.0.v201303031735.jar"/>
85             <pathelement location="${ECLIPSE_HOME}/plugins/org.junit_4.11.0.v201303080030/junit.jar"/>
86             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.expressions_3.4.500.v20130515-1343.jar"/>
87             <pathelement location="${ECLIPSE_HOME}/plugins/org.aspectj.runtime_1.7.3.20130613144500-a.jar"/>
88             <pathelement location="${ECLIPSE_HOME}/plugins/org.aspectj.ajde_1.7.3.20130613144500-a.jar"/>
89             <pathelement location="${ECLIPSE_HOME}/plugins/org.aspectj.weaver_1.7.3.20130613144500-a.jar"/>
90             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.ui.views_3.6.100.v20130326-1250.jar"/>
91             <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.ui.workbench.texteditor_3.8.101.v20130729-1318.jar"/>
92         </path>
93         <path id="no.uio.ifi.refaktor.classpath">
94             <pathelement location="lib/Metrics.jar"/>
95             <path refid="dependencies.libraryclasspath"/>
96             <pathelement location="bin"/>
97         </path>
98     </target>
99
100     <target name="init.taskdefs" depends="init.variables, 
101         aspectjtools.jar.available,
102         aspectjrt.jar.available"
103         unless="taskdefs.init">
104         <!-- sets name of new task to iajc, old task to ajc -->
105         <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
106             <classpath> 
107                 <pathelement path="${aspectjtools.jar}"/> 
108             </classpath>
109         </taskdef>
110         <property name="taskdefs.init" value="true"/>
111     </target>
112
113     <!-- targets to fail unless required libraries available -->
114
115     <target name="aspectjrt.jar.available" depends="init.variables" 
116         unless="aspectjrt.jar.available" >
117         <fail message="expecting aspectjrt.jar at ${aspectjrt.jar}"/>
118     </target>
119
120     <target name="aspectjtools.jar.available" depends="init.variables" 
121         unless="aspectjtools.jar.available" >
122         <fail message="expecting aspectjtools.jar at ${aspectjtools.jar}"/>
123     </target>
124
125
126     <target name="compile" depends="init">
127         <antcall target="clean" />
128         <javac srcdir="${source.dir}" destdir="${output.dir}" source="1.6" includeantruntime="false" >
129             <classpath refid="no.uio.ifi.refaktor.classpath"/>
130
131             <!-- compilerarg's ignored unless using our compiler adapter -->
132             <compilerarg compiler="${ajc.adapter}" line="-verbose -Xlint -proceedOnError"/>
133             <!-- use separate values if a path might have spaces -->
134             <compilerarg compiler="${ajc.adapter}" value="-classpath"/>
135             <compilerarg compiler="${ajc.adapter}" value="${aspectjrt.jar}"/>
136                 <!-- ASPECTS: -->
137             <compilerarg compiler="${ajc.adapter}" path="${source.dir}/no/uio/ifi/refaktor/aspects/StatisticsAspect.aj"/>
138             <compilerarg compiler="${ajc.adapter}" path="${source.dir}/no/uio/ifi/refaktor/aspects/HeapDumperAspect.aj"/>
139             <compilerarg compiler="${ajc.adapter}" path="${source.dir}/no/uio/ifi/refaktor/aspects/DebugCatchThrowableAspect.aj"/>
140         </javac>           
141     </target>
142
143     <target name="compile-ajc" depends="init">
144         <!-- aspectjtools.jar must be on system/ant classpath -->
145         <antcall target="compile">
146             <param name="build.compiler" value="${ajc.adapter}"/> 
147         </antcall>
148     </target>
149
150 </project>