-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuildcallbacks.xml
38 lines (38 loc) · 1.69 KB
/
buildcallbacks.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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<macrodef name="hacvcsinfo_after_build">
<sequential>
<exec executable="git" dir="${ext.hacvcsinfo.path}" outputproperty="commit-hash" failifexecutionfails="false" failonerror="false" resultproperty="return.code" >
<arg value="rev-parse"/>
<arg value="--short"/>
<arg value="HEAD"/>
</exec>
<exec executable="git" dir="${ext.hacvcsinfo.path}" outputproperty="commit-tag" failifexecutionfails="false" failonerror="false" resultproperty="return.code" >
<arg value="describe"/>
<arg value="--always"/>
<arg value="--tags"/>
</exec>
<exec executable="git" dir="${ext.hacvcsinfo.path}" outputproperty="commit-branch" failifexecutionfails="false" failonerror="false" resultproperty="return.code" >
<arg value="symbolic-ref"/>
<arg value="--short"/>
<arg value="HEAD"/>
</exec>
<exec executable="git" dir="${ext.hacvcsinfo.path}" outputproperty="commit-msg" failifexecutionfails="false" failonerror="false" resultproperty="return.code" >
<arg value="show"/>
<arg value="-s"/>
<arg value="--format=%s"/>
<arg value="HEAD"/>
</exec>
<echo message="hacvcsinfo hash: ${commit-hash}" />
<echo message="hacvcsinfo tag: ${commit-tag}" />
<echo message="hacvcsinfo branch: ${commit-branch}" />
<echo message="hacvcsinfo message: ${commit-msg}" />
<propertyfile file="${ext.hacvcsinfo.path}/resources/hacvcsinfo/vcs.properties">
<entry key="commit" value="${commit-hash}"/>
<entry key="tag" value="${commit-tag}"/>
<entry key="branch" value="${commit-branch}"/>
<entry key="message" value="${commit-msg}"/>
</propertyfile>
</sequential>
</macrodef>
</project>