forked from martinpaljak/GlobalPlatformPro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
80 lines (80 loc) · 3.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
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?xml version="1.0"?>
<project name="GlobalPlatform" default="dist" basedir=".">
<description>ANT build file for GlobalPlatformPro (javacard.pro)</description>
<!-- Build the software -->
<path id="build.classpath">
<pathelement location="lib/jopt-simple-4.8.jar"/>
<pathelement location="ext/apdu4j/apdu4j.jar"/>
<pathelement location="lib/bcprov-jdk15on-151.jar"/>
</path>
<target name="deps" description="build dependencies">
<ant dir="ext/apdu4j"/>
</target>
<target name="compile" description="compile the source" depends="deps">
<mkdir dir="build"/>
<javac srcdir="src" destdir="build" includeantruntime="false" excludes="**/tests/**" target="1.7" source="1.7" debug="true" debuglevel="lines,vars,source">
<compilerarg value="-Xlint"/>
<classpath refid="build.classpath"/>
</javac>
</target>
<!-- Package it into a nice little JAR -->
<target name="dist" depends="compile" description="generate the distribution">
<exec command="git describe --always" output="version.txt"/>
<java classname="proguard.ProGuard" fork="true" failonerror="true">
<arg line="@globalplatform.pro"/>
<classpath>
<pathelement location="ext/proguard.jar"/>
</classpath>
</java>
<jar destfile="openkms-gp.jar" level="9" basedir="build">
<fileset file="version.txt"/>
</jar>
<jar destfile="gp.jar" level="9">
<zipfileset src="ext/apdu4j/apdu4j.jar"/>
<zipfileset src="optimized-globalplatform.jar" excludes="org/bouncycastle/x509/"/>
<manifest><attribute name="Main-Class" value="pro.javacard.gp.GPTool"/></manifest>
<fileset file="version.txt"/>
</jar>
<delete file="optimized-globalplatform.jar"/>
</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.7.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>