forked from alx3apps/jgit-buildnumber
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
26 lines (21 loc) · 1.59 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="JGitBuildNumberAntTask Example" default="main" basedir=".">
<property name="MavenRepo" value="/dev/maven_repo" />
<path id="dependencies">
<pathelement location="${MavenRepo}/com/labun/buildnumber/jgit-buildnumber-ant-task/2.7.0/jgit-buildnumber-ant-task-2.7.0.jar" />
<pathelement location="${MavenRepo}/com/labun/buildnumber/jgit-buildnumber-common/2.7.0/jgit-buildnumber-common-2.7.0.jar" />
<pathelement location="${MavenRepo}/org/eclipse/jgit/org.eclipse.jgit/5.13.0.202109080827-r/org.eclipse.jgit-5.13.0.202109080827-r.jar" />
<!-- to avoid slf4j related errors and warnings -->
<pathelement location="${MavenRepo}/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar" />
<pathelement location="${MavenRepo}/ch/qos/logback/logback-classic/1.2.11/logback-classic-1.2.11.jar" />
<pathelement location="${MavenRepo}/ch/qos/logback/logback-core/1.2.11/logback-core-1.2.11.jar" />
</path>
<target name="jgit-buildnumber">
<taskdef name="extract-buildnumber" classname="com.labun.buildnumber.JGitBuildNumberAntTask" classpathref="dependencies" />
<extract-buildnumber verbose = "true" buildNumberFormat = "branch + '.' + commitsCount + '/' + commitDate + '/' + shortRevision + (dirty.length > 0 ? '-' + dirty : '')" />
<echo message="buildNumber: ${git.buildNumber}, buildDate: ${git.buildDate}" />
</target>
<target name="main" depends="jgit-buildnumber">
<echo message="buildNumber: ${git.buildNumber}, buildDate: ${git.buildDate}" /><!-- extracted properties are available in subsequent tasks -->
</target>
</project>