-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
106 lines (95 loc) · 3.74 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="publish_adt_to_p2repo" default="all" basedir=".">
<description>
This ant script should be run by a an eclipse runtime,
that contains
definitions of p2 tasks
When run, this script will mirror
Google ADT update site and then publish it into a p2 repo,
consumable
by tycho and others
modern build tools.
</description>
<macrodef name = "git">
<attribute name = "command" />
<attribute name = "dir" default = "" />
<element name = "args" optional = "true" />
<sequential>
<echo message = "git @{command}" />
<exec executable = "git" dir = "@{dir}">
<arg value = "@{command}" />
<args/>
</exec>
</sequential>
</macrodef>
<target name="all">
<antcall target="clean" />
<antcall target="downloadAndUnzipBuilder" />
<antcall target="launchMirrorAndPublishWithBuilder" />
</target>
<target name="downloadAndUnzipBuilder" depends="doesBuilderAlreadyExist" unless="basebuilder.exists">
<get dest="." src="http://download.jboss.org/jbosstools/requirements/indigo/org.eclipse.releng.basebuilder_R37_M6.zip" />
<unzip src="org.eclipse.releng.basebuilder_R37_M6.zip" dest="." />
</target>
<target name="doesBuilderAlreadyExist" description="in this step, we check if an eclipse runtime is available, if not, we download it and unzip it">
<condition property="basebuilder.exists">
<available file="org.eclipse.releng.basebuilder" type="dir" />
</condition>
</target>
<target name="clean">
<delete dir="mirror" />
<delete dir="output" />
</target>
<target name="launchMirrorAndPublishWithBuilder" description="we use the basebuilder to launch the mirror andpublish steps">
<java fork="true" jar="./org.eclipse.releng.basebuilder/plugins/org.eclipse.equinox.launcher.jar" failonerror="true">
<arg line="-application org.eclipse.ant.core.antRunner" />
<arg line="-buildfile build.xml mirror" />
</java>
<java fork="true" jar="./org.eclipse.releng.basebuilder/plugins/org.eclipse.equinox.launcher.jar" failonerror="true">
<arg line="-application org.eclipse.ant.core.antRunner" />
<arg line="-buildfile build.xml publish" />
</java>
</target>
<target name="mirror">
<p2.mirror>
<repository location="file:${basedir}/mirror" name="ADT old update site" />
<source>
<repository location="https://dl-ssl.google.com/android/eclipse/" />
</source>
</p2.mirror>
</target>
<target name="publish">
<git command = "clone" dir = "${basedir}">
<args>
<arg value = "[email protected]:anthonydahanne/publish_adt_to_p2repo.git" />
<arg value = "updates" />
</args>
</git>
<git command = "checkout" dir = "${basedir}/updates">
<args>
<arg value = "gh-pages" />
</args>
</git>
<git command = "pull" dir = "${basedir}/updates" />
<p2.publish.featuresAndBundles metadataRepository="file:${basedir}/updates" artifactRepository="file:${basedir}/updates" publishArtifacts="true" compress="true" source="${basedir}/mirror" />
<git command = "add" dir = "${basedir}/updates">
<args>
<arg value = "." />
<arg value = "features" />
<arg value = "plugins" />
</args>
</git>
<git command = "commit" dir = "${basedir}/updates">
<args>
<arg value = "-am" />
<arg value = '\"updated p2 repo\"' />
</args>
</git>
<git command = "push" dir = "${basedir}/updates">
<args>
<arg value = "origin" />
<arg value = "gh-pages" />
</args>
</git>
</target>
</project>