|
1 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
2 | | -<!-- |
3 | | - [y] hybris Platform |
4 | | -
|
5 | | - Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. |
6 | | -
|
7 | | - This software is the confidential and proprietary information of SAP |
8 | | - ("Confidential Information"). You shall not disclose such Confidential |
9 | | - Information and shall use it only in accordance with the terms of the |
10 | | - license agreement you entered into with SAP. |
11 | | ---><project> |
12 | | - |
| 2 | +<project> |
13 | 3 | <macrodef name="hacvcsinfo_after_build"> |
14 | 4 | <sequential> |
15 | | - <!--you may want to change the dir="..." property --> |
16 | | - <exec executable="git" outputproperty="commit-hash" failifexecutionfails="false" failonerror="false" resultproperty="return.code" > |
| 5 | + <exec executable="git" dir="${ext.hacvcsinfo.path}" outputproperty="commit-hash" failifexecutionfails="false" failonerror="false" resultproperty="return.code" > |
17 | 6 | <arg value="rev-parse"/> |
18 | 7 | <arg value="--short"/> |
19 | 8 | <arg value="HEAD"/> |
20 | 9 | </exec> |
21 | | - <exec executable="git" outputproperty="commit-tag" failifexecutionfails="false" failonerror="false" resultproperty="return.code" > |
| 10 | + <exec executable="git" dir="${ext.hacvcsinfo.path}" outputproperty="commit-tag" failifexecutionfails="false" failonerror="false" resultproperty="return.code" > |
22 | 11 | <arg value="describe"/> |
23 | 12 | <arg value="--always"/> |
24 | 13 | <arg value="--tags"/> |
25 | 14 | </exec> |
26 | | - <exec executable="git" outputproperty="commit-branch" failifexecutionfails="false" failonerror="false" resultproperty="return.code" > |
| 15 | + <exec executable="git" dir="${ext.hacvcsinfo.path}" outputproperty="commit-branch" failifexecutionfails="false" failonerror="false" resultproperty="return.code" > |
27 | 16 | <arg value="symbolic-ref"/> |
28 | 17 | <arg value="--short"/> |
29 | 18 | <arg value="HEAD"/> |
30 | 19 | </exec> |
| 20 | + <exec executable="git" dir="${ext.hacvcsinfo.path}" outputproperty="commit-msg" failifexecutionfails="false" failonerror="false" resultproperty="return.code" > |
| 21 | + <arg value="show"/> |
| 22 | + <arg value="-s"/> |
| 23 | + <arg value="--format=%s"/> |
| 24 | + <arg value="HEAD"/> |
| 25 | + </exec> |
| 26 | + <echo message="hacvcsinfo hash: ${commit-hash}" /> |
| 27 | + <echo message="hacvcsinfo tag: ${commit-tag}" /> |
| 28 | + <echo message="hacvcsinfo branch: ${commit-branch}" /> |
| 29 | + <echo message="hacvcsinfo message: ${commit-msg}" /> |
31 | 30 | <propertyfile file="${ext.hacvcsinfo.path}/resources/hacvcsinfo/vcs.properties"> |
32 | 31 | <entry key="commit" value="${commit-hash}"/> |
33 | 32 | <entry key="tag" value="${commit-tag}"/> |
34 | 33 | <entry key="branch" value="${commit-branch}"/> |
| 34 | + <entry key="message" value="${commit-msg}"/> |
35 | 35 | </propertyfile> |
36 | 36 | </sequential> |
37 | 37 | </macrodef> |
38 | | - |
39 | 38 | </project> |
0 commit comments