forked from ketan/SWTBot
/
build.xml
165 lines (143 loc) · 5.83 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
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
<project name="org.eclipse.swtbot.updatesite" default="all" basedir=".">
<taskdef name="purge" classname="com.dallaway.ant.Purge" classpath="../org.eclipse.swtbot.releng/externals/libs/purge.jar" />
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<property name="target" value="${basedir}/target" />
<taskdef resource="net/sf/antcontrib/antlib.xml" classpath="../org.eclipse.swtbot.releng/externals/libs/ant-contrib-1.0b3.jar" />
<condition property="should.generate.archives">
<equals arg1="${has.archives}" arg2="true" />
</condition>
<echo>${should.generate.archives}: ${has.archives}</echo>
<target name="-create.features.template">
<basename file="${file}" property="file.name" />
<propertyregex property="all.buildId" input="${file.name}" regexp="${featureId}_(.*).jar" select="\1" />
<echo message="Adding ${featureId} version: ${all.buildId}" />
<concat destfile="build/${destFile}" append="true">
<path path="${srcFile}" />
<filterchain>
<expandproperties />
</filterchain>
</concat>
</target>
<target name="create_features_list">
<for param="file">
<path>
<fileset dir="${target}/features" includes="org.eclipse.swtbot_*.jar" />
</path>
<sequential>
<ant target="-create.features.template" inheritall="false">
<property name="file" value="@{file}" />
<property name="featureId" value="org.eclipse.swtbot" />
<property name="destFile" value="org.eclipse.swtbot.featurelist.xml" />
<property name="srcFile" value="site.template.org.eclipse.swtbot.featurelist.xml" />
</ant>
</sequential>
</for>
</target>
<target name="-create.plugins.template">
<basename file="${plugin.file.name}" property="file" />
<dirname file="${plugin.file.name}" property="file.dirname" />
<basename file="${file.dirname}" property="file.basedir" />
<echo>Adding feature/plugin: ${file} in ${file.basedir}</echo>
<concat destfile="build/${destFile}" append="true">
<path path="${srcFile}" />
<filterchain>
<expandproperties />
</filterchain>
</concat>
</target>
<target name="create_plugins_archive_list" if="should.generate.archives">
<for param="plugin">
<path>
<fileset dir="${target}/features" includes="*.jar" />
<fileset dir="${target}/plugins" includes="*.jar" />
</path>
<sequential>
<ant target="-create.plugins.template" inheritall="false">
<property name="plugin.file.name" value="@{plugin}" />
<property name="featureId" value="org.eclipse.swtbot" />
<property name="destFile" value="org.eclipse.swtbot.pluginarchivelist.xml" />
<property name="srcFile" value="site.template.org.eclipse.swtbot.pluginarchivelist.xml" />
</ant>
</sequential>
</for>
</target>
<target name="create_site_xml" depends="create_features_list">
<concat destfile="${target}/site.xml.tokenize" fixlastline="true" eol="unix">
<header file="site.template.header.xml" />
<fileset file="build/org.eclipse.swtbot.featurelist.xml" />
<fileset file="build/org.eclipse.swtbot.pluginarchivelist.xml" />
<fileset file="site.template.categories.xml" />
<footer file="site.template.footer.xml" />
</concat>
<move file="${target}/site.xml.tokenize" tofile="${target}/site.xml">
<filterchain>
<expandproperties />
</filterchain>
</move>
</target>
<target name="clean">
<delete dir="build" />
<delete dir="eclipse" />
<mkdir dir="build" />
<delete dir="${target}" />
</target>
<target name="-create.jars">
<for param="file">
<path>
<dirset dir="${target}/eclipse/features" includes="*" excludes="*.jar" />
<dirset dir="${target}/eclipse/plugins" includes="*" excludes="*.jar" />
</path>
<sequential>
<echo>Packaging feature @{file} as a jar</echo>
<zip destfile="@{file}.jar" basedir="@{file}" />
<delete dir="@{file}" />
</sequential>
</for>
</target>
<target name="init">
<mkdir dir="${target}" />
<unzip dest="${target}">
<fileset dir="../org.eclipse.swtbot.releng/artifacts" includes="org.eclipse.swtbot.eclipse-*" />
<fileset dir="../org.eclipse.swtbot.releng/artifacts" includes="org.eclipse.swtbot.eclipse.test.junit3-*" />
<fileset dir="../org.eclipse.swtbot.releng/artifacts" includes="org.eclipse.swtbot.eclipse.test.junit4-*" />
<fileset dir="../org.eclipse.swtbot.releng/artifacts" includes="org.eclipse.swtbot.eclipse.gef-*" />
<fileset dir="../org.eclipse.swtbot.releng/artifacts" includes="org.eclipse.swtbot.ide-*" />
</unzip>
<antcall target="-create.jars" inheritall="false" />
<move todir="${target}">
<fileset dir="${target}/eclipse" />
</move>
</target>
<target name="copy-to-update-site">
<property name="update-site-location" value="update-site" />
<copy todir="${update-site-location}">
<fileset dir=".">
<include name="features/**.*" />
<include name="plugins/**.*" />
<include name="index.html" />
<include name="site.xml" />
<include name="web/**.*" />
</fileset>
<fileset dir="target">
</fileset>
</copy>
</target>
<target name="create-p2-site">
<java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true">
<classpath>
<fileset dir="${eclipse.location}/plugins">
<include name="org.eclipse.equinox.launcher_*.jar" />
</fileset>
</classpath>
<arg line="-application org.eclipse.equinox.p2.metadata.generator.EclipseGenerator" />
<arg line="-updateSite ${target}" />
<arg line="-site file:${target}/site.xml" />
<arg line="-metadataRepository file:${target}" />
<arg line="-metadataRepositoryName 'SWTBot Update Site'" />
<arg line="-artifactRepository file:${target}" />
<arg line="-artifactRepositoryName 'SWTBot Artifacts'" />
<arg line="-compress -reusePack200Files -vmargs -Xmx128M" />
</java>
</target>
<target name="all" depends="clean, init, create_features_list, create_plugins_archive_list, create_site_xml, create-p2-site, copy-to-update-site" />
</project>