-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathbuild.util.xml
53 lines (45 loc) · 2.1 KB
/
build.util.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
<!-- run with (from project root):
ant -f build.util.xml
-->
<project name="aws-tasks-util" >
<property name="root.dir" value="${basedir}" />
<import file="src/examples/ant/build-classpath.xml"/>
<!-- ================================================================== -->
<!-- Build jar/source-jar -->
<!-- ================================================================== -->
<macrodef name="buildJar">
<attribute name="jarName" />
<attribute name="mainClasses" />
<sequential>
<!--<echo-classpath classpathid="task.classpath"/>-->
<tstamp>
<format property="timestamp" timezone="UTC" locale="en" pattern="MMM dd yyyy, HH:mm:ss" />
</tstamp>
<!-- git version -->
<exec outputproperty="build.current.revision" executable="git">
<arg line=" log -1 --pretty=format:%H" />
</exec>
<echo>Git Revision: ${build.current.revision}</echo>
<echo>Building jar ${build.dir}/${jar.name}</echo>
<jar jarfile="${build.dir}/@{jarName}" basedir="@{mainClasses}">
<manifest>
<section name="datameer/aws-tasks">
<attribute name="Implementation-Vendor" value="Datameer Inc." />
<attribute name="Implementation-Title" value="${ant.project.name}" />
<attribute name="Implementation-Version" value="${version}" />
<attribute name="Compile-Time" value="${timestamp}" />
<attribute name="Compiled-By" value="${user.name}" />
<attribute name="Git-Revision" value="${build.current.revision}" />
</section>
</manifest>
</jar>
</sequential>
</macrodef>
<macrodef name="echo-classpath">
<attribute name="classpathId"/>
<sequential>
<property name="classpathToEcho" refid="@{classpathId}"/>
<echo message="Classpath[@{classpathId}] = ${classpathToEcho}"/>
</sequential>
</macrodef>
</project>