This repository has been archived by the owner on Apr 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrelease.xml
118 lines (94 loc) · 4.31 KB
/
release.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
<project name="GwtBootstrap3 Release Helper" default="release">
<!-- Helper Ant script to perform a release of GwtBootstrap3.
Everything needs to be set up as described here:
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide
This script assumes that it's executed in a directory where gwtbootstrap3 is checked out to a directory named
"gwtbootstrap3" and gwtbootstrap3-extras is checked out to "gwtbootstrap3-extras".
In order for the script to work the GPG passphrase of your key for release signing needs to be specified in
Maven's ~/.m2/settings.xml because it cannot be entered interactively when Maven is executed by Ant nor can
it be specified by command line arguments. That's an issue of Maven's release plugin.
<settings>
<profiles>
<profile>
<id>gpg</id>
<properties>
<gpg.passphrase>mypassphrase</gpg.passphrase>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>gpg</activeProfile>
</activeProfiles>
</settings>
-->
<property name="dir" location="${user.dir}"/>
<property name="mvn.bin" value="mvn.bat"/>
<property name="git.bin" value="git"/>
<property name="dryRun" value="false"/>
<target name="release">
<echo message="Current working directory: ${dir}"/>
<input addproperty="release.version" message="What is the release version?"/>
<input addproperty="development.version" message="What is the next development version (without -SNAPSHOT appended)?"/>
<echo message="Release version: ${release.version}, Development version: ${development.version}"/>
<input addproperty="correct" message="Is this correct (y/n)?"/>
<condition property="abort">
<not><equals arg1="${correct}" arg2="y" casesensitive="false" trim="true"/></not>
</condition>
<fail if="abort">Release aborted by user</fail>
<antcall target="do-release">
<param name="dir" value="${dir}/gwtbootstrap3"/>
</antcall>
<!-- Update gwtbootstrap-extras parent version to release -->
<exec executable="${mvn.bin}"
dir="${dir}/gwtbootstrap3-extras"
failonerror="true">
<arg value="versions:update-parent"/>
<arg value="-DparentVersion=${release.version}"/>
</exec>
<!-- Update gwtbootstrap-extras dependency to release -->
<exec executable="${mvn.bin}"
dir="${dir}/gwtbootstrap3-extras"
failonerror="true">
<arg value="versions:use-next-versions"/>
</exec>
<exec executable="${git.bin}"
dir="${dir}/gwtbootstrap3-extras"
failonerror="true">
<arg value="add"/>
<arg value="pom.xml"/>
</exec>
<exec executable="${git.bin}"
dir="${dir}/gwtbootstrap3-extras"
failonerror="true">
<arg value="commit"/>
<arg value="-m"/>
<arg value="Prepare release ${release.version}"/>
</exec>
<antcall target="do-release">
<param name="dir" value="${dir}/gwtbootstrap3-extras"/>
</antcall>
<echo message="${line.separator}${line.separator}Done! Now don't forget to login to https://oss.sonatype.org/ and release the staged artifacts."/>
</target>
<target name="do-release">
<exec executable="${mvn.bin}"
dir="${dir}"
failonerror="true">
<arg value="release:clean"/>
</exec>
<exec executable="${mvn.bin}"
dir="${dir}"
failonerror="true">
<arg value="release:prepare"/>
<arg value="-DreleaseVersion=${release.version}"/>
<arg value="-DdevelopmentVersion=${development.version}"/>
<arg value="-Dtag=${release.version}"/>
<arg value="-DdryRun=${dryRun}"/>
</exec>
<exec executable="${mvn.bin}"
dir="${dir}"
failonerror="true">
<arg value="release:perform"/>
<arg value="-DdryRun=${dryRun}"/>
</exec>
</target>
</project>