-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.xml
80 lines (64 loc) · 2.62 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
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:if="ant:if" xmlns:unless="ant:unless" name="sit-cv" basedir="." default="deploy">
<property name="version" value="1.1.1" />
<condition property="isSnapshotVersion">
<matches pattern=".*-SNAPSHOT" string="${version}" />
</condition>
<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>
<property name="gbasedir" value="${basedir}/sit-cv-gradle-plugin" />
<condition property="gradle.cmd" value="${gbasedir}/gradlew.bat" else="${gbasedir}/gradlew">
<os family="windows" />
</condition>
<target name="deploy">
<antcall target="analyze" />
<antcall target="deploy-maven" />
<antcall target="deploy-gradle" />
</target>
<target name="analyze">
<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="analyze" />
<arg value="--projects" />
<arg value="!sit-cv-tools/pom-1_8.xml,!sit-cv-tools/pom.xml" />
</exec>
</target>
<target name="deploy-maven">
<exec executable="${mvn.cmd}" dir="${basedir}" failonerror="true">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="--activate-profiles" />
<arg value="release" />
<arg value="clean" />
<arg value="deploy" />
</exec>
</target>
<target name="deploy-gradle" unless="${isSnapshotVersion}">
<exec executable="${gradle.cmd}" dir="${gbasedir}" failonerror="true">
<arg value="--no-daemon" />
<arg value="publishPlugins" />
</exec>
</target>
<target name="set-version">
<exec executable="${mvn.cmd}" dir="${basedir}">
<arg line="versions:set -DnewVersion=${version} -DgenerateBackupPoms=false" />
</exec>
<exec executable="${mvn.cmd}" dir="${basedir}/sample">
<arg line="versions:set -DnewVersion=${version} -DgenerateBackupPoms=false" />
</exec>
<exec executable="${mvn.cmd}" dir="${basedir}/sit-cv-maven-plugin/src/test/projects/test-project-1">
<arg value="-DnewVersion=${version}" />
<arg value="versions:set" />
</exec>
<replaceregexp file="${gbasedir}/gradle.properties" match="version=.*$" replace="version=${version}" />
<replaceregexp file="${basedir}/sample/gradle.properties" match="version=.*$" replace="version=${version}" />
</target>
</project>