forked from camunda/camunda-eclipse-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
197 lines (174 loc) · 6.81 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
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
193
194
195
196
197
<?xml version="1.0" encoding="UTF-8"?>
<!-- using macros for git, because the ant tasks in jgit suck, no push / commit etc. -->
<project name="Release Script" default="release" basedir=".">
<macrodef name = "git">
<attribute name = "command" />
<attribute name = "dir" default = "" />
<attribute name="failonerror" default="true"/>
<element name = "args" optional = "true" />
<sequential>
<echo message = "git @{command}" />
<exec executable = "git" dir = "@{dir}">
<arg value = "@{command}" />
<args/>
</exec>
</sequential>
</macrodef>
<macrodef name = "git-clone-pull">
<attribute name = "repository" />
<attribute name = "dest" />
<sequential>
<git command = "clone">
<args>
<arg value = "@{repository}" />
<arg value = "@{dest}" />
<arg value = "--recursive" />
</args>
</git>
<git command = "pull" dir = "@{dest}" />
<git command = "checkout" dir = "@{dest}">
<args>
<arg value = "master" />
</args>
</git>
</sequential>
</macrodef>
<!-- ============ Maven macro ============ -->
<macrodef name="maven">
<attribute name="options" default="" />
<attribute name="goals" />
<attribute name="basedir" />
<attribute name="settingsfile" default="${maven.settings.file}" />
<attribute name="maven.repo.local" default="${maven.repo.local}" />
<attribute name="resultproperty" default="maven.result" />
<element name="args" implicit="true" optional="true" />
<sequential>
<java classname="org.codehaus.classworlds.Launcher" fork="true"
dir="@{basedir}" resultproperty="@{resultproperty}" failonerror="true" timeout="1800000">
<jvmarg value="-Xmx512m"/>
<jvmarg value="-XX:MaxPermSize=256m"/>
<classpath>
<fileset dir="${maven.home}/boot">
<include name="*.jar" />
</fileset>
<fileset dir="${maven.home}/lib">
<include name="*.jar" />
</fileset>
</classpath>
<sysproperty key="classworlds.conf" value="${maven.home}/bin/m2.conf" />
<sysproperty key="maven.home" value="${maven.home}" />
<arg line="--settings=@{settingsfile} -Dmaven.repo.local=@{maven.repo.local} --batch-mode @{options} @{goals}" />
</java>
</sequential>
</macrodef>
<property file="build.properties" />
<property name="jvm.options" value="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8" />
<property name="checkout.release.path" value="release" />
<!-- =========== OS properties / conditions =========== -->
<condition property="is.windows">
<os family="windows"/>
</condition>
<condition property="is.not.windows">
<not>
<os family="windows"/>
</not>
</condition>
<condition property="mvn.executable" value="mvn.bat" else="mvn">
<os family="windows"/>
</condition>
<!-- ============ Maven Ant stuff ============ -->
<target name="mvn.init">
<condition property="maven.repo.local" value="${maven.repo.local}" else="${user.home}/.m2/repository">
<isset property="maven.repo.local" />
</condition>
<echo>Using maven.repo.local=${maven.repo.local}</echo>
<condition property="maven.settings.file" value="${maven.settings.file}" else="${user.home}/.m2/settings.xml">
<isset property="maven.settings.file" />
</condition>
<echo>Using maven.settings.file=${maven.settings.file}</echo>
</target>
<!-- ============ Release Management Aggregation targets ============ -->
<target name="release" depends="checkout,
set.release.version,
build.release,
commit.release.version,
create.release.tag,
set.dev.version,
commit.dev.version,
git.push"
/>
<target name="build.release">
<maven basedir="${checkout.release.path}/${checkout.dir}"
options="-Pplatform-indigo -Dmaven.test.skip=true -DskipTests=true -X"
goals="clean install"
resultproperty="maven.build.result" />
</target>
<target name="checkout" depends="clean, git.checkout" />
<!-- ============ Common stuff ============ -->
<target name="clean">
<delete dir="${checkout.release.path}/${checkout.dir}" />
</target>
<target name="git.checkout">
<git-clone-pull repository="${git.url}" dest="${checkout.release.path}/${checkout.dir}" />
</target>
<target name="set.release.version" depends="mvn.init">
<maven basedir="${checkout.release.path}/${checkout.dir}"
options="-DnewVersion=${release.version} -Pplatform-indigo -e"
goals="org.eclipse.tycho:tycho-versions-plugin:set-version"
resultproperty="maven.build.result" />
</target>
<target name="commit.release.version">
<property name="release.version.commit.message" value="chore(release): set dev version to ${release.version}" />
<echo>Project: ${release.version} committing...</echo>
<git command="commit" dir="${checkout.release.path}/${checkout.dir}">
<args>
<arg value = "-a" />
<arg value = "-m ${release.version.commit.message}" />
</args>
</git>
<echo>Project: ${checkout.release.path}/${checkout.dir} committed.</echo>
</target>
<target name="create.release.tag">
<property name="release.commit.message" value="chore(release): tag release version ${release.version}" />
<git command="tag" dir="${checkout.release.path}/${checkout.dir}">
<args>
<arg value = "-a" />
<arg value = "${camunda.release.version}" />
<arg value = "-m '${release.commit.message}'" />
</args>
</git>
<git command="checkout" dir="${checkout.release.path}/${checkout.dir}">
<args>
<arg value = "master" />
</args>
</git>
</target>
<target name="set.dev.version" depends="mvn.init">
<maven basedir="${checkout.release.path}/${checkout.dir}"
options="-DnewVersion=${development.version} -Pplatform-indigo -e -X"
goals="org.eclipse.tycho:tycho-versions-plugin:set-version"
resultproperty="maven.build.result" />
</target>
<target name="commit.dev.version">
<property name="prepare.next.commit.message" value="chore(release): prepare next release: set developmentVersion to ${development.version}" />
<echo>Project: @{project.dir} committing...</echo>
<git command="commit" dir="${checkout.release.path}/${checkout.dir}">
<args>
<arg value = "-a" />
<arg value = "-m ${prepare.next.commit.message}" />
</args>
</git>
<echo>Project: ${checkout.release.path}/${checkout.dir} committed.</echo>
</target>
<target name="git.push">
<echo>Project: ${checkout.release.path}/${checkout.dir} pushing...</echo>
<git command="push" dir="${checkout.release.path}/${checkout.dir}">
<args>
<arg value = "origin" />
<arg value = "master" />
<arg value = "--tags" />
</args>
</git>
<echo>Project: ${checkout.release.path}/${checkout.dir} pushed.</echo>
</target>
</project>