-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.xml
More file actions
137 lines (103 loc) · 4.65 KB
/
build.xml
File metadata and controls
137 lines (103 loc) · 4.65 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:if="ant:if"
xmlns:unless="ant:unless" name="sit-wt-all" basedir="." default="install">
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${maven.plugin.classpath}"/>
<property environment="env" />
<property name="testArtifactId" value="sit-wt-test" />
<property name="testdir" value="${basedir}/${testArtifactId}" />
<property name="distribution.pom" value="${basedir}/sit-wt-app/src/main/resources/distribution-pom.xml" />
<property name="file.encoding" value="UTF-8" />
<property name="driver.type" value="chrome" unless:blank="${driver.type}"/>
<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>
<condition property="mvn.profile.ci" value="localhost,ci,release" else="">
<isset property="ci" />
</condition>
<target name="install">
<antcall target="01_local-install-stage" />
<antcall target="02_analyze-stage" />
</target>
<target name="deploy">
<antcall target="01_local-install-stage" />
<antcall target="02_analyze-stage" />
<antcall target="03_deploy-stage" />
</target>
<target name="01_local-install-stage">
<exec executable="${mvn.cmd}" dir="${basedir}" failonerror="true">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="-Dmaven.test.skip=true" />
<arg value="clean" />
<arg value="install" />
</exec>
</target>
<target name="02_analyze-stage">
<exec executable="${mvn.cmd}" dir="${basedir}" failonerror="true">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="clean" />
<arg value="test" />
<arg value="sonar:sonar" />
<arg value="--fail-at-end" />
<arg value="--activate-profiles" />
<arg value="localhost,ci,analyze" />
<arg value="-Duser.language=ja" />
<arg value="-Duser.country=JP" />
<arg value="-Dfile.encoding=${file.encoding}" />
<arg value="-Dmaven.test.skip=false" />
<arg value="-Ddriver.type=${driver.type}" />
<arg value="-Dheadless=true" />
</exec>
</target>
<target name="03_deploy-stage">
<exec executable="${mvn.cmd}" dir="${basedir}" failonerror="true">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="clean" />
</exec>
<exec executable="${mvn.cmd}" dir="${basedir}" failonerror="true">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="--activate-profiles" />
<arg value="mobile" />
<arg value="--file" />
<arg value="sit-wt-app" />
<arg value="-Dmaven.test.skip=true" />
<arg value="package" />
</exec>
<exec executable="${mvn.cmd}" dir="${basedir}" failonerror="true">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="--activate-profiles" />
<arg value="release,attach-mobile-artifact" />
<arg value="-Dmaven.test.skip=true" />
<arg value="deploy" />
</exec>
</target>
<target name="set-version">
<property name="version" value="3.0.0" />
<replaceregexp file="${distribution.pom}" match="sit-wt-project</artifactId> \s+<version>.*</version>" replace="sit-wt-project</artifactId> <version>${version}</version>" />
<replaceregexp file="${basedir}/sit-wt-project/pom.xml" match="<sitwt.version>.*</sitwt.version>" replace="<sitwt.version>${version}</sitwt.version>" />
<if>
<not>
<matches string="${version}" pattern="^.*-SNAPSHOT$" />
</not>
<then>
<replaceregexp file="${basedir}/README.md" match="io/sitoolkit/wt/sit-wt-app/.*/sit-wt-app-.*\.jar" replace="io/sitoolkit/wt/sit-wt-app/${version}/sit-wt-app-${version}.jar" />
<replaceregexp file="${basedir}/sit-wt-docs/src/docs/asciidoc/クイックスタート.adoc" match="io/sitoolkit/wt/sit-wt-app/.*/sit-wt-app-.*\.jar" replace="io/sitoolkit/wt/sit-wt-app/${version}/sit-wt-app-${version}.jar" />
</then>
</if>
<exec executable="${mvn.cmd}" dir="${basedir}">
<arg value="-DnewVersion=${version}" />
<arg value="versions:set" />
</exec>
</target>
<target name="generate-docs">
<exec executable="${mvn.cmd}" dir="${basedir}" failonerror="true">
<arg line="-f sit-wt-docs" />
</exec>
<delete dir="docs" />
<copy todir="docs">
<fileset dir="sit-wt-docs/target/generated-docs"/>
</copy>
</target>
</project>