Alessio Caiazza is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

nolith / PortableNotary http://abisso.org/projects/portablenotary/

PortableNotary permits you to verify pdf signature. It's OS independent and can be used from command line.

Clone this repository (size: 187.9 KB): HTTPS / SSH
hg clone https://bitbucket.org/nolith/portablenotary
hg clone ssh://hg@bitbucket.org/nolith/portablenotary

PortableNotary / build.xml

commit
21f1c36b2830
parent
4581103ec2ba
branch
trunk

[svn] Now should build generic, win and mac application fron any system....maybe... :D

1
01ea204f838e
<?xml version="1.0"?>
2
01ea204f838e
<!-- build file for PortableNotary program -->
3
c78f6d17dbe0
<!-- Created by: Alessio Caiazza &lt;ac@abisso.org&gt;	-->
4
01ea204f838e
5
5f24ee46836c
<project name="PortableNotary" default="build" basedir=".">
6
4581103ec2ba
	<import file="ant/user_pref.xml"/>
7
4581103ec2ba
  <!-- uncomment the following lines if using ANT outside Eclipse -->
8
4581103ec2ba
  <!--
9
4581103ec2ba
      <property name="fjepPath" value="plugins/net.sf.fjep.fatjar_0.0.25/fatjar.jar"/>
10
4581103ec2ba
      <taskdef name="fatjar.build" classname="net.sf.fjep.anttask.FJBuildTask" classpath="${fjepPath}"/>
11
4581103ec2ba
      <typedef name="fatjar.manifest" classname="net.sf.fjep.anttask.FJManifestType" classpath="${fjepPath}"/>
12
4581103ec2ba
      <typedef name="fatjar.exclude" classname="net.sf.fjep.anttask.FJExcludeType" classpath="${fjepPath}"/>
13
4581103ec2ba
      <typedef name="fatjar.jarsource" classname="net.sf.fjep.anttask.FJJarSourceType" classpath="${fjepPath}"/>
14
4581103ec2ba
      <typedef name="fatjar.filesource" classname="net.sf.fjep.anttask.FJFileSourceType" classpath="${fjepPath}"/>
15
4581103ec2ba
  -->
16
4581103ec2ba
  <!-- uncomment the above lines to use ANT outside of Eclipse -->
17
c78f6d17dbe0
	<!-- trick for legacy JVM -->
18
5f24ee46836c
	<condition property="source.version" value="1.6" else="1.5">
19
5f24ee46836c
		<equals arg1="${java5}" arg2="false"/>
20
776821e4f4ba
	</condition>
21
776821e4f4ba
	<condition property="ifdef.token" value="/*" else="">
22
5f24ee46836c
		<equals arg1="${java5}" arg2="false"/>
23
776821e4f4ba
	</condition>
24
776821e4f4ba
	<condition property="enddef.token" value="*/" else="">
25
5f24ee46836c
		<equals arg1="${java5}" arg2="false"/>
26
4581103ec2ba
	</condition> 
27
c78f6d17dbe0
	
28
5f24ee46836c
	<!-- http://informagen.com/JarBundler/ -->
29
c78f6d17dbe0
	<taskdef name="jarbundler" 
30
c78f6d17dbe0
	         classname="net.sourceforge.jarbundler.JarBundler" />
31
4581103ec2ba
	
32
c78f6d17dbe0
	<taskdef name="launch4j"
33
c78f6d17dbe0
	    classname="net.sf.launch4j.ant.Launch4jTask"
34
c78f6d17dbe0
	    classpath="${launch4j.dir}/launch4j.jar
35
c78f6d17dbe0
	        :${launch4j.dir}/lib/xstream.jar" />
36
776821e4f4ba
37
01ea204f838e
38
c78f6d17dbe0
	<path id="classpath">
39
c78f6d17dbe0
		<pathelement location="${itext}"/>
40
c78f6d17dbe0
		<pathelement location="${bcprov}"/>
41
c78f6d17dbe0
		<pathelement location="${commons-cli}"/>
42
c78f6d17dbe0
		<!-- <pathelement location="${junit.jar}"/> -->
43
c78f6d17dbe0
	</path>
44
01ea204f838e
45
c78f6d17dbe0
	<!-- 
46
c78f6d17dbe0
		Build all Java source files into destdir.	 This is common in Java
47
c78f6d17dbe0
		projects: the compile target is trivial, since it just says to build
48
c78f6d17dbe0
		everything.	 Fancier compiler targets are easy if you want to build
49
c78f6d17dbe0
		just one file at a time.
50
c78f6d17dbe0
	-->
51
c78f6d17dbe0
	<target name="build" depends="init">
52
c78f6d17dbe0
		<javac srcdir="${src.right}" 
53
c78f6d17dbe0
			destdir="${build}"
54
c78f6d17dbe0
			debug="${compile.debug}"
55
c78f6d17dbe0
			source="${source.version}">
56
c78f6d17dbe0
			<classpath refid="classpath"/>
57
c78f6d17dbe0
		</javac>
58
c78f6d17dbe0
		<copy todir="${build}">
59
c78f6d17dbe0
			<fileset dir="${src}" excludes="**/*.java"/>
60
c78f6d17dbe0
		</copy>
61
c78f6d17dbe0
	</target>
62
01ea204f838e
63
c78f6d17dbe0
	<target name="download_deps">
64
c78f6d17dbe0
		<mkdir dir="${libs}"/>
65
5f24ee46836c
		<get src="http://www.bouncycastle.org/download/bcprov-jdk15-136.jar" dest="${bcprov}" verbose="on" usetimestamp="on" />
66
c78f6d17dbe0
		<get src="http://prdownloads.sourceforge.net/itext/itext-2.0.4.jar" dest="${itext}" verbose="on" usetimestamp="on" />
67
c78f6d17dbe0
		<get src="http://apache.markoer.org/jakarta/commons/cli/binaries/cli-1.0.tar.gz" dest="${libs}/cli-1.0.tar.gz" verbose="on" usetimestamp="on" />
68
c78f6d17dbe0
		<gunzip src="${libs}/cli-1.0.tar.gz" />
69
c78f6d17dbe0
		<untar src="${libs}/cli-1.0.tar" dest="${libs}">
70
c78f6d17dbe0
			<patternset>
71
c78f6d17dbe0
				<include name="commons-cli-1.0/commons-cli-1.0.jar"/>
72
c78f6d17dbe0
			</patternset>
73
c78f6d17dbe0
		</untar>
74
c78f6d17dbe0
		<move file="${libs}/commons-cli-1.0/commons-cli-1.0.jar" todir="${libs}" />
75
c78f6d17dbe0
		<delete file="${libs}/cli-1.0.tar" />
76
c78f6d17dbe0
		<delete dir="${libs}/commons-cli-1.0" />
77
c78f6d17dbe0
	</target>
78
c78f6d17dbe0
	<!--
79
c78f6d17dbe0
		init is a target that sets things up for the build.	 Since we use the
80
c78f6d17dbe0
		built-in ant function mkdir, it will only make the directory if it
81
c78f6d17dbe0
		does not already exist.
82
c78f6d17dbe0
	-->
83
c78f6d17dbe0
	<target name="init">
84
4581103ec2ba
		<mkdir dir="${release}"/>
85
c78f6d17dbe0
		<mkdir dir="${build}"/>
86
c78f6d17dbe0
		<mkdir dir="${src.right}"/>
87
c78f6d17dbe0
		<copy todir="${src.right}">
88
c78f6d17dbe0
			<fileset dir="${src}">
89
c78f6d17dbe0
				<include name="**/*.java"/>
90
c78f6d17dbe0
			</fileset>
91
c78f6d17dbe0
			<filterset begintoken="//[" endtoken="]">
92
c78f6d17dbe0
				<filter token="ifdef" value="${ifdef.token}"/>
93
c78f6d17dbe0
				<filter token="enddef" value="${enddef.token}"/>
94
c78f6d17dbe0
			</filterset>
95
c78f6d17dbe0
		</copy>
96
c78f6d17dbe0
	</target>
97
01ea204f838e
98
01ea204f838e
99
c78f6d17dbe0
	<target name="run" depends="build">
100
c78f6d17dbe0
		<java classname="${main.class}"	
101
c78f6d17dbe0
			fork="true" 
102
4581103ec2ba
			dir="." 
103
c78f6d17dbe0
			classpath="${build}" 
104
c78f6d17dbe0
			maxmemory="500m">
105
c78f6d17dbe0
			<classpath refid="classpath"/>
106
c78f6d17dbe0
			<arg value="-g"/>
107
c78f6d17dbe0
		</java>
108
c78f6d17dbe0
	</target>
109
c78f6d17dbe0
	<!--
110
c78f6d17dbe0
		Always include a clean target to get rid of all the extra files
111
c78f6d17dbe0
		created by the build process, so you can save storage safely, without
112
c78f6d17dbe0
		thinking.	 Also: sometimes you'll want to do a completely fresh build,
113
c78f6d17dbe0
		such as when changing to a new version of the JDK.
114
c78f6d17dbe0
	-->
115
c78f6d17dbe0
	<target name="clean" description="Removes previous build">
116
c78f6d17dbe0
		<delete verbose="true">
117
c78f6d17dbe0
			<fileset dir="${build}"/>
118
c78f6d17dbe0
			<fileset dir="${src.right}"/>
119
4581103ec2ba
			<fileset dir="${release}"/>
120
c78f6d17dbe0
		</delete>
121
c78f6d17dbe0
	</target>
122
01ea204f838e
123
776821e4f4ba
124
776821e4f4ba
125
21f1c36b2830
<!--	<target name="jar" depends="build">
126
c78f6d17dbe0
		<jar jarfile="${out.jar}">
127
c78f6d17dbe0
			<fileset dir="${build}"/>
128
c78f6d17dbe0
			<manifest>
129
c78f6d17dbe0
				<attribute name="Built-By" value="${user.name}"/>
130
c78f6d17dbe0
				<attribute name="Main-Class" value="${main.class}"/>
131
c78f6d17dbe0
				<attribute name="Class-Path" value=". ${itext} ${bcprov} ${commons-cli}"/>
132
c78f6d17dbe0
			</manifest>
133
c78f6d17dbe0
		</jar>
134
21f1c36b2830
	</target> -->
135
c78f6d17dbe0
	
136
c78f6d17dbe0
	
137
4581103ec2ba
  <target name="deploy-generic" depends="build">
138
4581103ec2ba
      <fatjar.build output="${out.fatjar}">
139
4581103ec2ba
          <fatjar.manifest mainclass="${main.class}"/>
140
4581103ec2ba
          <fatjar.filesource path="${build}" relpath="">
141
4581103ec2ba
              <fatjar.exclude relpath=".svn/"/>
142
4581103ec2ba
          </fatjar.filesource>
143
4581103ec2ba
          <fatjar.jarsource file="${itext}" relpath=""/>
144
4581103ec2ba
          <fatjar.jarsource file="${commons-cli}" relpath=""/>
145
4581103ec2ba
          <fatjar.jarsource file="${bcprov}" relpath=""/>
146
4581103ec2ba
          <fatjar.filesource path="./images/Icon.png" relpath="images/Icon.png"/>
147
4581103ec2ba
      </fatjar.build>
148
4581103ec2ba
  </target>
149
776821e4f4ba
150
21f1c36b2830
	<target name="deploy-osx" depends="deploy-generic">
151
c78f6d17dbe0
		<jarbundler dir="release"
152
c78f6d17dbe0
		            name="PortableNotary"
153
c78f6d17dbe0
		            mainclass="${main.class}"
154
c78f6d17dbe0
			bundleid="org.abisso.PortableNotary"
155
c78f6d17dbe0
			icon="./images/Icon.icns"
156
21f1c36b2830
			jvmversion="1.5+" version="0.1" 
157
21f1c36b2830
			workingdirectory="$APP_PACKAGE/Contents/Resources" 
158
21f1c36b2830
	    stubfile="./ant/JavaApplicationStub">
159
21f1c36b2830
			<jarfileset dir="${release}" includes="*.jar" />
160
21f1c36b2830
	    <jarfileset dir="." includes="libs/*.jar"/>
161
2671a2d977f2
			<javaproperty name="apple.laf.useScreenMenuBar" value="true"/>
162
21f1c36b2830
			<!--<resourcefileset dir="." includes="images/**">
163
c78f6d17dbe0
				<exclude name="**/*.svg"/>
164
c78f6d17dbe0
				<exclude name="**/*.icns"/>
165
21f1c36b2830
			</resourcefileset> -->
166
c78f6d17dbe0
		</jarbundler>
167
c78f6d17dbe0
	</target>
168
c78f6d17dbe0
	
169
4581103ec2ba
	<target name="deploy-win" depends="deploy-generic">
170
21f1c36b2830
		<launch4j configFile="./ant/launch4j.xml" 
171
21f1c36b2830
				jarPath="../${out.fatjar}" 
172
21f1c36b2830
				outfile="../${release}/PortableNotary.exe" />
173
4581103ec2ba
	</target>
174
4581103ec2ba
	
175
21f1c36b2830
	<target name="deploy" depends="deploy-generic, deploy-osx, deploy-win" />
176
776821e4f4ba
177
01ea204f838e
</project>
178
01ea204f838e