-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
61 lines (60 loc) · 2.1 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="clean_install_default" name="composition-service">
<property name="host.production" value="not_active"/>
<target name="clean_install_default">
<clean_install/>
</target>
<!-- ======= various ======= -->
<target name="check_dependency_updates">
<mvn opts="versions:display-dependency-updates"/>
</target>
<!-- ======= macros ======= -->
<macrodef name="clean_install">
<attribute name="mvnArgs" default=""/>
<sequential>
<git_short-hash outputproperty="git_hash" />
<propertyfile file="src/main/resources-dynamic/release.properties">
<entry key="version" value="${git_hash}"/>
</propertyfile>
<mvn opts="clean install @{mvnArgs}" />
</sequential>
</macrodef>
<macrodef name="git_short-hash">
<attribute name="outputproperty"/>
<sequential>
<shell-output cmd="git log -1 --pretty='%h'" outputproperty="@{outputproperty}"/>
</sequential>
</macrodef>
<macrodef name="mvn">
<attribute name="opts"/>
<sequential>
<echo message="@{opts}"/>
<exec executable="/bin/bash" failonerror="true">
<arg value="--login"/>
<arg value="-c"/>
<arg value="mvn @{opts}"/>
</exec>
</sequential>
</macrodef>
<macrodef name="shell">
<attribute name="cmd"/>
<sequential>
<exec executable="/bin/bash">
<arg value="--login"/>
<arg value="-c"/>
<arg value="@{cmd}"/>
</exec>
</sequential>
</macrodef>
<macrodef name="shell-output">
<attribute name="cmd"/>
<attribute name="outputproperty" />
<sequential>
<exec executable="/bin/bash" outputproperty="@{outputproperty}">
<arg value="--login"/>
<arg value="-c"/>
<arg value="@{cmd}"/>
</exec>
</sequential>
</macrodef>
</project>