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 againPortableNotary / build.xml
- Branch
- sviluppo
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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | <?xml version="1.0"?>
<!-- build file for PortableNotary program -->
<!-- Created by: Alessio Caiazza <ac@abisso.org> -->
<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://mirror.tomato.it/apache/commons/cli/binaries/commons-cli-1.1.tar.gz" dest="${libs}/cli-1.1.tar.gz" verbose="on" usetimestamp="on" />
<gunzip src="${libs}/cli-1.1.tar.gz" />
<untar src="${libs}/cli-1.1.tar" dest="${libs}">
<patternset>
<include name="commons-cli-1.1/commons-cli-1.1.jar"/>
</patternset>
</untar>
<move file="${libs}/commons-cli-1.1/commons-cli-1.1.jar" todir="${libs}" />
<delete file="${libs}/cli-1.1.tar.gz" />
<delete file="${libs}/cli-1.1.tar" />
<delete dir="${libs}/commons-cli-1.1" />
</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>
|