-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.xml
140 lines (123 loc) · 5.22 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="build" name="SWTRipper">
<property file="build.properties"/>
<property environment="env"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.6"/>
<property name="source" value="1.6"/>
<!-- we may want to pull these out into a properties file eventually -->
<property name="src.dir" value="src"/>
<property name="build.dir" value="bin"/>
<property name="lib.dir" value="lib"/>
<property name="dist.dir" value="dist"/>
<property name="doc.dir" value="doc"/>
<property name="swtmodel.jar.name" value="swtmodel.jar"/>
<property name="swtmodel.jar" value="${lib.dir}/${swtmodel.jar.name}"/>
<property name="swtripper.jar" value="${dist.dir}/swtripper.jar"/>
<!-- Use correct swt jar depending on operating system -->
<condition property="swt.jar" value="swt-linux.jar">
<and>
<os family="unix"/>
<not>
<os family="mac"/>
</not>
</and>
</condition>
<condition property="swt.jar" value="swt-mac.jar">
<os family="mac"/>
</condition>
<condition property="swt.jar" value="swt-windows.jar">
<os family="windows"/>
</condition>
<path id="SWTRipper.classpath">
<pathelement location="${build.dir}"/>
<pathelement location="${lib.dir}/args4j-2.0.12.jar"/>
<pathelement location="${lib.dir}/${swt.jar}"/>
<pathelement location="${lib.dir}/log4j-1.2.15.jar"/>
<pathelement location="${lib.dir}/GUITARModel-Core.jar"/>
<pathelement location="${lib.dir}/GUIRipper-Core.jar"/>
<pathelement location="${swtmodel.jar}"/>
</path>
<target name="init">
<mkdir dir="${build.dir}"/>
<copy includeemptydirs="false" todir="${build.dir}">
<fileset dir="${src.dir}">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="build" depends="init,build-model">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="${build.dir}"
source="${source}" target="${target}" includeantruntime="false">
<src path="${src.dir}"/>
<classpath refid="SWTRipper.classpath"/>
</javac>
</target>
<target name="doc" description="Generate Javadocs">
<mkdir dir="${doc.dir}"/>
<javadoc sourcepath="${src.dir}" destdir="${doc.dir}" source="${source}" classpathref="SWTRipper.classpath">
<link href="http://download.oracle.com/javase/6/docs/api/"/>
<!-- No good online SWT javadoc that works :( -->
</javadoc>
</target>
<target name="dist" depends="build" description="Build a JAR of this project">
<mkdir dir="${dist.dir}"/>
<jar destfile="${swtripper.jar}">
<fileset dir="${build.dir}"/>
</jar>
</target>
<target name="check-model" description="Check if SWTModel is in lib">
<!-- set swtmodel.present if swtmodel.jar is in lib,
this has the effect of checking whether this is a Jenkins build-->
<available file="${swtmodel.jar}" property="swtmodel.present"/>
</target>
<!-- Build and copy swtmodel.jar unless it's already here -->
<target name="build-model" depends="check-model" description="Build SWTModel and copy" unless="swtmodel.present">
<ant antfile="build.xml" dir="${swtmodel.project.dir}" target="dist" inheritall="false"/>
<copy file="${swtmodel.project.dir}/dist/swtmodel.jar" todir="${lib.dir}"/>
</target>
<target name="run" depends="build" description="Run the ripper">
<echo message="Arguments passed to SWTRipperMain: ${args}"/>
<java classname="edu.umd.cs.guitar.ripper.SitarRipperMain" fork="true">
<!-- Sample arguments: <arg line="-c edu.umd.cs.guitar.ripper.test.aut.SWTHelloWorld"/>-->
<arg line="${args}"/>
<classpath refid="SWTRipper.classpath"/>
</java>
</target>
<target name="run-sample" depends="build" description="Rip a sample app included in GUITAR-Ripper-Plugin-SWT-Test">
<echo message="Arguments passed to SWTRipperMain: ${args}"/>
<ant antfile="build.xml" dir="${swttest.project.dir}" target="build" inheritall="false"/>
<java classname="edu.umd.cs.guitar.ripper.SitarRipperMain" fork="true">
<!-- Sample arguments: <arg line="-c edu.umd.cs.guitar.ripper.test.aut.SWTHelloWorld"/>-->
<arg line="${args}" />
<classpath refid="SWTRipper.classpath" />
<classpath path="${swttest.project.dir}/${build.dir}" />
</java>
</target>
<target name="run-sample-mac" depends="build" description="Rip a sample app included in GUITAR-Ripper-Plugin-SWT-Test on OS X">
<echo message="Arguments passed to SWTRipperMain: ${args}" />
<ant antfile="build.xml" dir="${swttest.project.dir}" target="build" inheritall="false" />
<java classname="edu.umd.cs.guitar.ripper.SitarRipperMain" fork="true">
<arg line="${args}" />
<jvmarg value="-d32" />
<jvmarg value="-XstartOnFirstThread" />
<classpath refid="SWTRipper.classpath" />
<classpath path="${swttest.project.dir}/${build.dir}" />
</java>
</target>
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
<delete dir="${doc.dir}"/>
<delete>
<fileset dir="." includes="*.log" />
</delete>
<delete file="GUITAR-Default.GUI" />
<delete file="log_widget.xml" />
<!-- remove swtmodel.jar so Jenkins can add a potentially newer version -->
<!-- TODO remove this when we release -->
<delete file="${swtmodel.jar}"/>
</target>
</project>