forked from martinpaljak/GlobalPlatformPro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
66 lines (66 loc) · 2.96 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
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
54
55
56
57
58
59
60
61
62
63
64
65
66
<?xml version="1.0"?>
<project name="GlobalPlatform" default="dist" basedir=".">
<description>ANT build file for GlobalPlatformPro (javacard.pro)</description>
<!-- Build dependencies -->
<target name="fetch">
<mkdir dir="lib"/>
<get src="http://central.maven.org/maven2/net/sf/proguard/proguard-base/6.0.3/proguard-base-6.0.3.jar" dest="lib" verbose="true" skipexisting="true"/>
<checksum algorithm="SHA-256" file="lib/proguard-base-6.0.3.jar" property="75bc89695fa66e75374ecda439b802406f0ab1d826dd386eed0a23b1f0a9d264" verifyProperty="proguardOK"/>
<fail message="Checksum failure">
<condition>
<or>
<isfalse value="${proguardOK}"/>
</or>
</condition>
</fail>
</target>
<!-- Package it into a nice little JAR -->
<target name="dist" depends="fetch" description="generate the distribution">
<java classname="proguard.ProGuard" fork="true" failonerror="true">
<arg line="@globalplatform.pro"/>
<classpath>
<pathelement location="lib/proguard-base-6.0.3.jar"/>
</classpath>
</java>
</target>
<!-- Wrap the JAR into .EXE for Windows users -->
<target name="windist" depends="dist" description="package as .exe">
<property name="launch4j.dir" location="ext/launch4j"/>
<taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask" classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar"/>
<launch4j>
<config headerType="console" outfile="gp.exe" jar="gp.jar" errTitle="GlobalPlatformPro">
<jre minVersion="1.8.0"/>
</config>
</launch4j>
</target>
<!-- Clean the source tree -->
<target name="clean" description="clean up">
<delete dir="build"/>
<delete dir="javadoc"/>
<delete file="gp.jar"/>
</target>
<!-- Put javadocs online -->
<target name="javadoc">
<javadoc destdir="javadoc" Doctitle="GlobalPlatformPro Java" access="public" linksource="true">
<packageset dir="src">
<include name="pro/javacard/gp/"/>
<exclude name="pro/javacard/gp/tests/**"/>
</packageset>
<classpath refid="build.classpath"/>
</javadoc>
</target>
<!-- Do a full release to github -->
<target name="release" depends="clean,dist,javadoc">
<exec failonerror="true" command="test -n "$(git status -s)""/>
<input message="Publish version:" addproperty="release.version"/>
<input message="Do you want to release ${release.version}?" validargs="y,n" addproperty="do.release"/>
<condition property="do.abort">
<equals arg1="n" arg2="${do.release}"/>
</condition>
<fail if="do.abort">Not releasing ${release.version}.</fail>
<echo message="Releasing ${release.version} to Github"/>
<exec failonerror="true" command="git tag -s ${release.version} -m 'Release ${release.version}'"/>
<exec failonerror="true" command="git push --tags origin master"/>
<exec failonerror="true" command="ghp-import -n -m 'Release ${release.version}' -p javadoc"/>
</target>
</project>