forked from scratchfoundation/scratch-flash
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build-common.xml
29 lines (28 loc) · 1.22 KB
/
build-common.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
<?xml version="1.0" encoding="UTF-8"?>
<project name="common">
<!--
The git command must be available on the system path.
For Windows users using "git for Windows" this means selecting either
"Use Git from the Windows Command Prompt" or "Use Git and optional Unix tools from the Windows Command Prompt"
while installing.
-->
<!-- collect git commit ID -->
<macrodef name="git-commit-id">
<attribute name="repository" default="."/>
<attribute name="outputproperty"/>
<sequential>
<local name="git.present"/>
<local name="git.revision"/>
<available file="@{repository}/.git" property="git.present"/>
<exec executable="git" dir="@{repository}" outputproperty="git.revision" failifexecutionfails="false">
<arg line="describe --dirty --tags --always"/>
</exec>
<condition property="@{outputproperty}" value="${git.revision}" else="unknown">
<and>
<isset property="git.revision"/>
<length string="${git.revision}" trim="yes" when="greater" length="0"/>
</and>
</condition>
</sequential>
</macrodef>
</project>