-
Notifications
You must be signed in to change notification settings - Fork 55
/
upgrade-version.build.xml
60 lines (52 loc) · 2.69 KB
/
upgrade-version.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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Instructions for upgrading a checkstyle version
===============================================
* Uncheck Project > Build Automatically
* change the "fromVersion" and "toVersion" properties in this file.
* Select the *.launch file next to this script and run it via context menu > Run As.
* The script replaces all version numbers, deletes outdated files, and downloads the release jar.
* Check Project > Build Automatically
* Use Project > Clean with all projects to trigger a full rebuild.
There should be no errors or warnings in the problems view afterwards.
Apply all necessary manual code changes now.
-->
<project name="upgrade-version" default="upgrade-version">
<description>upgrade all version numbers</description>
<target name="upgrade-version" description="upgrade version numbers and dependent files">
<property name="fromVersion" value="10.20.0"/>
<property name="toVersion" value="10.20.1"/>
<!-- delete all outdated files, independent of their current version -->
<delete>
<fileset dir="${basedir}" includes="**/checkstyle-*-all.jar"/>
<fileset dir="${basedir}" includes="**/checkstyle-checkstyle-*.zip"/>
</delete>
<!-- replace version number in checkstyle library -->
<replace dir="${basedir}/net.sf.eclipsecs.checkstyle" token="${fromVersion}" value="${toVersion}">
<include name="**/.classpath"/>
<include name="**/build.properties"/>
<include name="**/category.xml"/>
<include name="**/feature.xml"/>
<include name="**/MANIFEST.MF"/>
<include name="**/pom.xml"/>
</replace>
<!-- restore parent version in POM and bundle version in manifest -->
<replace dir="${basedir}/net.sf.eclipsecs.checkstyle" token="<version>${toVersion}" value="<version>${fromVersion}">
<include name="**/pom.xml"/>
</replace>
<replace dir="${basedir}/net.sf.eclipsecs.checkstyle" token="Bundle-Version: ${toVersion}" value="Bundle-Version: ${fromVersion}">
<include name="**/MANIFEST.MF"/>
</replace>
<!-- replace dependencies from core to library -->
<replace dir="${basedir}/net.sf.eclipsecs.core" token="checkstyle-${fromVersion}" value="checkstyle-${toVersion}">
<include name="**/.classpath"/>
<include name="**/build.properties"/>
<include name="**/MANIFEST.MF"/>
</replace>
<!-- download new version -->
<get src="https://github.com/checkstyle/checkstyle/releases/download/checkstyle-${toVersion}/checkstyle-${toVersion}-all.jar"
dest="${basedir}/net.sf.eclipsecs.checkstyle/checkstyle-${toVersion}-all.jar"/>
<copy file="${basedir}/net.sf.eclipsecs.checkstyle/checkstyle-${toVersion}-all.jar"
tofile="${basedir}/net.sf.eclipsecs.core/lib/checkstyle-${toVersion}-all.jar"/>
</target>
</project>