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

Branch
trunk
<?xml version="1.0"?>
<!-- build file for PortableNotary program -->
<!-- Created by: Alessio Caiazza &lt;ac@abisso.org&gt;  -->

<project name="PortableNotary" default="build" basedir=".">
        <import file="ant/user_pref.xml"/>
  <!-- uncomment the following lines if using ANT outside Eclipse -->
  <!--
      <property name="fjepPath" value="plugins/net.sf.fjep.fatjar_0.0.25/fatjar.jar"/>
      <taskdef name="fatjar.build" classname="net.sf.fjep.anttask.FJBuildTask" classpath="${fjepPath}"/>
      <typedef name="fatjar.manifest" classname="net.sf.fjep.anttask.FJManifestType" classpath="${fjepPath}"/>
      <typedef name="fatjar.exclude" classname="net.sf.fjep.anttask.FJExcludeType" classpath="${fjepPath}"/>
      <typedef name="fatjar.jarsource" classname="net.sf.fjep.anttask.FJJarSourceType" classpath="${fjepPath}"/>
      <typedef name="fatjar.filesource" classname="net.sf.fjep.anttask.FJFileSourceType" classpath="${fjepPath}"/>
  -->
  <!-- uncomment the above lines to use ANT outside of Eclipse -->
        <!-- trick for legacy JVM -->
        <condition property="source.version" value="1.6" else="1.5">
                <equals arg1="${java5}" arg2="false"/>
        </condition>
        <condition property="ifdef.token" value="/*" else="">
                <equals arg1="${java5}" arg2="false"/>
        </condition>
        <condition property="enddef.token" value="*/" else="">
                <equals arg1="${java5}" arg2="false"/>
        </condition> 
        
        <!-- http://informagen.com/JarBundler/ -->
        <taskdef name="jarbundler" 
                 classname="net.sourceforge.jarbundler.JarBundler" />
        
        <taskdef name="launch4j"
            classname="net.sf.launch4j.ant.Launch4jTask"
            classpath="${launch4j.dir}/launch4j.jar
                :${launch4j.dir}/lib/xstream.jar" />


        <path id="classpath">
                <pathelement location="${itext}"/>
                <pathelement location="${bcprov}"/>
                <pathelement location="${commons-cli}"/>
                <!-- <pathelement location="${junit.jar}"/> -->
        </path>

        <!-- 
                Build all Java source files into destdir.        This is common in Java
                projects: the compile target is trivial, since it just says to build
                everything.      Fancier compiler targets are easy if you want to build
                just one file at a time.
        -->
        <target name="build" depends="init">
                <javac srcdir="${src.right}" 
                        destdir="${build}"
                        debug="${compile.debug}"
                        source="${source.version}">
                        <classpath refid="classpath"/>
                </javac>
                <copy todir="${build}">
                        <fileset dir="${src}" excludes="**/*.java"/>
                </copy>
        </target>

        <target name="download_deps">
                <mkdir dir="${libs}"/>
                <get src="http://www.bouncycastle.org/download/bcprov-jdk15-136.jar" dest="${bcprov}" verbose="on" usetimestamp="on" />
                <get src="http://prdownloads.sourceforge.net/itext/itext-2.0.4.jar" dest="${itext}" verbose="on" usetimestamp="on" />
                <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" />
                <gunzip src="${libs}/cli-1.0.tar.gz" />
                <untar src="${libs}/cli-1.0.tar" dest="${libs}">
                        <patternset>
                                <include name="commons-cli-1.0/commons-cli-1.0.jar"/>
                        </patternset>
                </untar>
                <move file="${libs}/commons-cli-1.0/commons-cli-1.0.jar" todir="${libs}" />
                <delete file="${libs}/cli-1.0.tar" />
                <delete dir="${libs}/commons-cli-1.0" />
        </target>
        <!--
                init is a target that sets things up for the build.      Since we use the
                built-in ant function mkdir, it will only make the directory if it
                does not already exist.
        -->
        <target name="init">
                <mkdir dir="${release}"/>
                <mkdir dir="${build}"/>
                <mkdir dir="${src.right}"/>
                <copy todir="${src.right}">
                        <fileset dir="${src}">
                                <include name="**/*.java"/>
                        </fileset>
                        <filterset begintoken="//[" endtoken="]">
                                <filter token="ifdef" value="${ifdef.token}"/>
                                <filter token="enddef" value="${enddef.token}"/>
                        </filterset>
                </copy>
        </target>


        <target name="run" depends="build">
                <java classname="${main.class}" 
                        fork="true" 
                        dir="." 
                        classpath="${build}" 
                        maxmemory="500m">
                        <classpath refid="classpath"/>
                        <arg value="-g"/>
                </java>
        </target>
        <!--
                Always include a clean target to get rid of all the extra files
                created by the build process, so you can save storage safely, without
                thinking.        Also: sometimes you'll want to do a completely fresh build,
                such as when changing to a new version of the JDK.
        -->
        <target name="clean" description="Removes previous build">
                <delete verbose="true">
                        <fileset dir="${build}"/>
                        <fileset dir="${src.right}"/>
                        <fileset dir="${release}"/>
                </delete>
        </target>



<!--    <target name="jar" depends="build">
                <jar jarfile="${out.jar}">
                        <fileset dir="${build}"/>
                        <manifest>
                                <attribute name="Built-By" value="${user.name}"/>
                                <attribute name="Main-Class" value="${main.class}"/>
                                <attribute name="Class-Path" value=". ${itext} ${bcprov} ${commons-cli}"/>
                        </manifest>
                </jar>
        </target> -->
        
        
  <target name="deploy-generic" depends="build">
      <fatjar.build output="${out.fatjar}">
          <fatjar.manifest mainclass="${main.class}"/>
          <fatjar.filesource path="${build}" relpath="">
              <fatjar.exclude relpath=".svn/"/>
          </fatjar.filesource>
          <fatjar.jarsource file="${itext}" relpath=""/>
          <fatjar.jarsource file="${commons-cli}" relpath=""/>
          <fatjar.jarsource file="${bcprov}" relpath=""/>
          <fatjar.filesource path="./images/Icon.png" relpath="images/Icon.png"/>
      </fatjar.build>
  </target>

        <target name="deploy-osx" depends="deploy-generic">
                <jarbundler dir="release"
                            name="PortableNotary"
                            mainclass="${main.class}"
                        bundleid="org.abisso.PortableNotary"
                        icon="./images/Icon.icns"
                        jvmversion="1.5+" version="0.1" 
                        workingdirectory="$APP_PACKAGE/Contents/Resources" 
            stubfile="./ant/JavaApplicationStub">
                        <jarfileset dir="${release}" includes="*.jar" />
            <jarfileset dir="." includes="libs/*.jar"/>
                        <javaproperty name="apple.laf.useScreenMenuBar" value="true"/>
                        <!--<resourcefileset dir="." includes="images/**">
                                <exclude name="**/*.svg"/>
                                <exclude name="**/*.icns"/>
                        </resourcefileset> -->
                </jarbundler>
        </target>
        
        <target name="deploy-win" depends="deploy-generic">
                <launch4j configFile="./ant/launch4j.xml" 
                                jarPath="../${out.fatjar}" 
                                outfile="../${release}/PortableNotary.exe" />
        </target>
        
        <target name="deploy" depends="deploy-generic, deploy-osx, deploy-win" />

</project>