This repository was archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.xml
69 lines (50 loc) · 2.11 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
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:if="ant:if"
xmlns:unless="ant:unless" name="sit-at" basedir="." default="deploy">
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${maven.plugin.classpath}"/>
<condition property="os.windows" value="true" else="false">
<os family="windows" />
</condition>
<condition property="mvn.cmd" value="${basedir}\mvnw.cmd" else="${basedir}\mvnw">
<os family="windows" />
</condition>
<target name="deploy">
<exec executable="${mvn.cmd}" dir="${basedir}" failonerror="true">
<arg line="clean test sonar:sonar -P analyze --fail-at-end" />
</exec>
<exec executable="${mvn.cmd}" dir="${basedir}" failonerror="true">
<arg line="deploy -P release -Dmaven.test.skip=true" />
</exec>
</target>
<target name="set-version">
<property name="version" value="0.9" />
<exec executable="${mvn.cmd}" dir="${basedir}">
<arg line="versions:set -DnewVersion=${version} -DgenerateBackupPoms=false" />
</exec>
<if>
<not>
<matches string="${version}" pattern="^.*-SNAPSHOT$" />
</not>
<then>
<replaceregexp file="${basedir}/README.md" flags="g">
<regexp pattern="sit-bt-core-[^j]*jar"/>
<substitution expression="sit-bt-core-${version}.jar"/>
</replaceregexp>
<replaceregexp file="${basedir}/README.md" flags="g">
<regexp pattern="sit-bt-core/[^\/]*\/"/>
<substitution expression="sit-bt-core/${version}/"/>
</replaceregexp>
<replaceregexp file="${basedir}/README.md" flags="g">
<regexp pattern="<version>.*<\/version>"/>
<substitution expression="<version>${version}<\/version>"/>
</replaceregexp>
</then>
</if>
</target>
<target name="translate-readme">
<exec executable="${mvn.cmd}" dir="${basedir}" failonerror="true">
<arg line="-f sit-bt-core exec:java -Dexec.args='-m ja2en README_ja.md:README.md'" />
</exec>
<replace file="README.md" token="[English](README.md)" value="[日本語](README_ja.md)"/>
</target>
</project>