forked from testng-team/testng-eclipse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autobuild.plugin.xml
192 lines (175 loc) · 8.61 KB
/
autobuild.plugin.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<?xml version="1.0" encoding="UTF-8"?>
<project name="org.testng.eclipse" default="build.jars" basedir=".">
<import file="./eclipse-path.xml"/>
<property file="./autobuild.plugin.properties"/>
<property name="basews" value="${ws}"/>
<property name="baseos" value="${os}"/>
<property name="basearch" value="${arch}"/>
<property name="bundleId" value="org.testng.eclipse"/>
<!-- Compiler settings. -->
<property name="javacFailOnError" value="false"/>
<property name="javacDebugInfo" value="on"/>
<property name="javacVerbose" value="false"/>
<property name="logExtension" value=".log"/>
<property name="compilerArg" value=""/>
<property name="javacSource" value="1.3"/>
<property name="javacTarget" value="1.2"/>
<condition property="dir_bootclasspath" value="${java.home}/../Classes">
<os family="mac"/>
</condition>
<property name="dir_bootclasspath" value="${java.home}/lib"/>
<path id="path_bootclasspath">
<fileset dir="${dir_bootclasspath}">
<include name="*.jar"/>
</fileset>
</path>
<property name="bootclasspath" refid="path_bootclasspath"/>
<condition property="bundleBootClasspath" value="${J2SE-1.4}">
<isset property="J2SE-1.4"/>
</condition>
<condition property="bundleJavacSource" value="1.3">
<isset property="J2SE-1.4"/>
</condition>
<condition property="bundleJavacTarget" value="1.2">
<isset property="J2SE-1.4"/>
</condition>
<property name="bundleJavacSource" value="${javacSource}"/>
<property name="bundleJavacTarget" value="${javacTarget}"/>
<property name="bundleBootClasspath" value="${bootclasspath}"/>
<property name="build.dir" value="buildResultFolder"/>
<echo message="-----------------------------------build.dir=${build.dir}"/>
<target name="init" depends="properties">
<condition property="pluginTemp" value="${build.dir}/plugins">
<isset property="build.dir"/>
</condition>
<echo message="a.plugin.xml build.dir=${build.dir}; plugin.version=${plugin.version} --------------------"/>
<property name="pluginTemp" value="${basedir}"/>
<condition property="build.result.folder" value="${pluginTemp}/org.testng.eclipse_${plugin.version}">
<isset property="build.dir"/>
</condition>
<property name="build.result.folder" value="${basedir}"/>
<property name="temp.folder" value="${basedir}/build.temp.folder"/>
<property name="plugin.destination" value="${basedir}"/>
</target>
<target name="properties" if="eclipse.running">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
</target>
<target name="build.update.jar" depends="init" description="Build the plug-in: org.testng.eclipse for an update site.">
<delete dir="${temp.folder}"/>
<mkdir dir="${temp.folder}"/>
<antcall target="build.jars"/>
<antcall target="gather.bin.parts">
<param name="destination.temp.folder" value="${temp.folder}/"/>
</antcall>
<jar destfile="${plugin.destination}/org.testng.eclipse_${plugin.version}.jar" basedir="${temp.folder}/org.testng.eclipse_${plugin.version}" filesetmanifest="merge"/>
<delete dir="${temp.folder}"/>
</target>
<target name="eclipse-testng.jar" depends="init" unless="eclipse-testng.jar" description="Create jar: org.testng.eclipse eclipse-testng.jar.">
<delete dir="${temp.folder}/eclipse-testng.jar.bin"/>
<mkdir dir="${temp.folder}/eclipse-testng.jar.bin"/>
<!-- compile the source code -->
<javac destdir="${temp.folder}/eclipse-testng.jar.bin" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bundleBootClasspath}" source="${bundleJavacSource}" target="${bundleJavacTarget}" >
<compilerarg line="${compilerArg}" compiler="${build.compiler}"/>
<classpath refid="eclipse-testng.jar.classpath" />
<src path="src/main" />
<compilerarg value="@${basedir}/javaCompiler.eclipse-testng.jar.args" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<compilerarg line="-log '${temp.folder}/eclipse-testng.jar.bin${logExtension}'" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
</javac>
<!-- Copy necessary resources -->
<copy todir="${temp.folder}/eclipse-testng.jar.bin" failonerror="true" overwrite="false">
<fileset dir="src/main">
<exclude name="**/*.java"/>
<exclude name="**/package.htm*"/>
</fileset>
</copy>
<mkdir dir="${build.result.folder}"/>
<jar destfile="${build.result.folder}/eclipse-testng.jar" basedir="${temp.folder}/eclipse-testng.jar.bin"/>
<delete dir="${temp.folder}/eclipse-testng.jar.bin"/>
</target>
<target name="eclipse-testngsrc.zip" depends="init" unless="eclipse-testngsrc.zip">
<mkdir dir="${build.result.folder}"/>
<zip destfile="${build.result.folder}/eclipse-testngsrc.zip" filesonly="false" whenempty="skip" update="false">
<fileset dir="src/main">
<include name="**/*.java"/>
</fileset>
</zip>
</target>
<target name="build.jars" depends="init" description="Compile classes and build nested jars for the plug-in: org.testng.eclipse.">
<available property="eclipse-testng.jar" file="${build.result.folder}/eclipse-testng.jar"/>
<antcall target="eclipse-testng.jar"/>
</target>
<target name="build.sources" depends="init">
<available property="eclipse-testngsrc.zip" file="${build.result.folder}/eclipse-testngsrc.zip"/>
<antcall target="eclipse-testngsrc.zip"/>
</target>
<target name="gather.bin.parts" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/org.testng.eclipse_${plugin.version}"/>
<copy todir="${destination.temp.folder}/org.testng.eclipse_${plugin.version}" failonerror="true" overwrite="false">
<fileset dir="${build.result.folder}">
<include name="eclipse-testng.jar"/>
</fileset>
</copy>
<copy todir="${destination.temp.folder}/org.testng.eclipse_${plugin.version}" failonerror="true" overwrite="false">
<fileset dir="${basedir}">
<include name="plugin.xml"/>
<include name="icons/"/>
<include name="plugin.properties"/>
<include name="eclipse-testng.jar"/>
<include name="schema/"/>
<include name="lib/testng-jdk14.jar"/>
<include name="lib/testng-jdk15.jar"/>
</fileset>
</copy>
</target>
<target name="build.zips" depends="init">
</target>
<target name="gather.sources" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/org.testng.eclipse_${plugin.version}"/>
<copy file="${build.result.folder}/eclipse-testngsrc.zip" todir="${destination.temp.folder}/org.testng.eclipse_${plugin.version}" failonerror="false" overwrite="false"/>
<copy todir="${destination.temp.folder}/org.testng.eclipse_${plugin.version}" failonerror="false" overwrite="false">
<fileset dir="${basedir}">
<include name="schema/"/>
</fileset>
</copy>
</target>
<target name="gather.logs" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/org.testng.eclipse_${plugin.version}"/>
<copy todir="${destination.temp.folder}/org.testng.eclipse_${plugin.version}" failonerror="false" overwrite="false">
<fileset dir="${temp.folder}">
<include name="eclipse-testng.jar.bin${logExtension}"/>
</fileset>
</copy>
</target>
<target name="clean" depends="init" description="Clean the plug-in: org.testng.eclipse of all the zips, jars and logs created.">
<delete file="${build.result.folder}/eclipse-testng.jar"/>
<delete file="${build.result.folder}/eclipse-testngsrc.zip"/>
<delete file="${plugin.destination}/org.testng.eclipse_${plugin.version}.jar"/>
<delete file="${plugin.destination}/org.testng.eclipse_${plugin.version}.zip"/>
<delete dir="${temp.folder}"/>
<delete dir="${build.dir}"/>
<delete file="eclipse-testng.jar"/>
</target>
<target name="refresh" depends="init" if="eclipse.running" description="Refresh this folder.">
<eclipse.convertPath fileSystemPath="/home/joan/svn/testng-eclipse" property="resourcePath"/>
<eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>
</target>
<target name="zip.plugin" depends="init" description="Create a zip containing all the elements for the plug-in: org.testng.eclipse.">
<delete dir="${temp.folder}"/>
<mkdir dir="${temp.folder}"/>
<antcall target="build.jars"/>
<antcall target="build.sources"/>
<antcall target="gather.bin.parts">
<param name="destination.temp.folder" value="${temp.folder}/"/>
</antcall>
<antcall target="gather.sources">
<param name="destination.temp.folder" value="${temp.folder}/"/>
</antcall>
<delete>
<fileset dir="${temp.folder}">
<include name="**/*.bin${logExtension}"/>
</fileset>
</delete>
<zip destfile="${plugin.destination}/org.testng.eclipse_${plugin.version}.zip" basedir="${temp.folder}" filesonly="true" whenempty="skip" update="false"/>
<delete dir="${temp.folder}"/>
</target>
</project>