-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
179 lines (160 loc) · 7.47 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
<!--
Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0.
SPDX-License-Identifier: EPL-2.0
-->
<project name="VirSat Core" default="updateVersions" basedir="." xmlns:jacoco="antlib:org.jacoco.ant">
<description>
Additional Build Preparations for VirSat
</description>
<property name="version">4.17.0</property>
<property name="version.pattern.qualified">[\s]?[0-9]+\.[0-9]+\.[0-9]+\.qualifier</property>
<property name="version.pattern">[\s]?[0-9]+\.[0-9]+\.[0-9]+</property>
<property name="m2.directory">${user.home}/.m2/</property>
<property environment="env"/>
<!-- =====================================================
Task: flushAll
===================================================== -->
<target name="flushAll">
<description>Call this target to flush all relevant information before starting the build</description>
<antcall target="flushBuilds">
</antcall>
<antcall target="flushJavaDocAPI">
</antcall>
<antcall target="flushM2Repository">
</antcall>
</target>
<!-- =====================================================
Task: flushM2Repository
===================================================== -->
<target name="flushM2Repository">
<description>Call this target to flush pending virsat dependencies in mavens m2 repository</description>
<delete includeemptydirs="true" verbose="true" failonerror="false">
<fileset dir="${m2.directory}" includes="**/de.dlr.sc.virsat*/**"/>
</delete>
</target>
<!-- =====================================================
Task: flushBuilds
===================================================== -->
<target name="flushBuilds">
<description>Call this target to flush builds folder for deployment</description>
<delete includeemptydirs="true" verbose="true" failonerror="false">
<fileset dir="builds" includes="**/*"/>
</delete>
</target>
<!-- =====================================================
Task: flushJavaDocAPI
===================================================== -->
<target name="flushJavaDocAPI">
<description>Call this target to flush builds folder for deployment</description>
<delete includeemptydirs="true" verbose="true" failonerror="false">
<fileset dir="de.dlr.sc.virsat.javadoc.api/help/api-docs/javadoc" includes="**/*"/>
</delete>
</target>
<!-- =====================================================
Task: updateVersion
===================================================== -->
<target name="updateVersions">
<!-- =====================================================
Task: updateVersion - Ask for new Version String
===================================================== -->
<input message="Please enter the new Version Number (e.g.: 4.0.3):"
addproperty="version.new"
defaultvalue="${version}" />
<property name="version.new.qualified">${version.new}.qualifier</property>
<!-- =====================================================
Task: updateVersion - Self Update build.xml
===================================================== -->
<replaceregexp byline="true">
<regexp pattern="<property name="version">${version.pattern}</property>" />
<substitution expression="<property name="version">${version.new}</property>" />
<fileset dir=".">
<include name="build.xml" />
</fileset>
</replaceregexp>
<!-- =====================================================
Task: updateVersion - Update master pom
===================================================== -->
<replaceregexp byline="true">
<regexp pattern="<version>${version.pattern}-SNAPSHOT</version>" />
<substitution expression="<version>${version.new}-SNAPSHOT</version>" />
<fileset dir=".">
<include name="maven/pom.xml" />
<include name="pom.xml" />
</fileset>
</replaceregexp>
<!-- =====================================================
Task: updateVersion - Update Build Version in POM for deployment
===================================================== -->
<replaceregexp byline="true">
<regexp pattern="<build.version>${version.pattern}</build.version>" />
<substitution expression="<build.version>${version.new}</build.version>" />
<fileset dir=".">
<exclude name="**/target/"/>
<include name="**/pom.xml" />
</fileset>
</replaceregexp>
<!-- =====================================================
Task: updateVersion - Update Build Version in POM for deployment
===================================================== -->
<replaceregexp byline="true">
<regexp pattern="<version>${version.pattern}-SNAPSHOT</version>" />
<substitution expression="<version>${version.new}-SNAPSHOT</version>" />
<fileset dir=".">
<exclude name="de.dlr.sc.**/target/"/>
<include name="de.dlr.sc.**/**/pom.xml" />
</fileset>
</replaceregexp>
<!-- =====================================================
Task: updateVersion - Update all MANIFEST.MF
===================================================== -->
<replaceregexp byline="true">
<regexp pattern="Bundle-Version:${version.pattern.qualified}" />
<substitution expression="Bundle-Version: ${version.new.qualified}" />
<fileset dir=".">
<exclude name="de.dlr.sc.**/target/"/>
<include name="de.dlr.sc.**/**/META-INF/MANIFEST.MF" />
</fileset>
</replaceregexp>
<!-- =====================================================
Task: updateVersion - Update all feature.xml
===================================================== -->
<replaceregexp byline="true">
<regexp pattern="version="${version.pattern.qualified}"" />
<substitution expression="version="${version.new.qualified}"" />
<fileset dir=".">
<exclude name="de.dlr.sc.**/target/"/>
<include name="de.dlr.sc.**/**/feature.xml" />
</fileset>
</replaceregexp>
<!-- =====================================================
Task: updateVersion - Update Category p2 Versions
===================================================== -->
<replaceregexp byline="true">
<regexp pattern="version="${version.pattern.qualified}"" />
<substitution expression="version="${version.new.qualified}"" />
<fileset dir=".">
<exclude name="de.dlr.sc.**/target/"/>
<include name="de.dlr.sc.**/**/category.xml" />
</fileset>
</replaceregexp>
<replaceregexp byline="true">
<regexp pattern="${version.pattern.qualified}\.jar" />
<substitution expression="${version.new.qualified}.jar" />
<fileset dir=".">
<exclude name="de.dlr.sc.**/target/"/>
<include name="de.dlr.sc.**/**/category.xml" />
</fileset>
</replaceregexp>
<replaceregexp byline="true">
<regexp pattern="<updatesite.release.version>${version.pattern}</updatesite.release.version>" />
<substitution expression="<updatesite.release.version>${version.new}</updatesite.release.version>" />
<fileset dir=".">
<exclude name="de.dlr.sc.**/target/"/>
<include name="de.dlr.sc.**/**/updateSitePom/pom.xml" />
</fileset>
</replaceregexp>
</target>
</project>