1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <project name="PosterDivider" basedir="." default="build">
3 <property environment="env"/>
4 <property name="VERSION" value="1.1.0.20110719"/>
5 <property name="SHORTVERSION" value="1.1.0"/>
6 <property name="ITEXTJAR" value="itextpdf-5.1.0.jar"/>
7 <property name="BCPROVJAR" value="bcprov-jdk16-146.jar"/>
8 <path id="PosterDivider.classpath">
9 <pathelement location="bin"/>
10 <pathelement location="iText.jar"/>
11 <pathelement location="bcprov.jar"/>
12 <pathelement location="lib/AppleJavaExtensions.jar"/>
16 <copy includeemptydirs="false" todir="bin">
17 <fileset dir="src" excludes="**/*.launch, **/*.java"/>
19 <exec executable="ln">
21 <arg value="../${ITEXTJAR}"/>
22 <arg value="iText.jar"/>
24 <exec executable="ln">
26 <arg value="../${BCPROVJAR}"/>
27 <arg value="bcprov.jar"/>
30 <target name="build" depends="build-subprojects,build-project"/>
31 <target name="build-subprojects"/>
32 <target name="build-project" depends="init">
33 <javac destdir="bin" encoding="UTF-8">
35 <classpath refid="PosterDivider.classpath"/>
36 <compilerarg value="-Xlint:deprecation"/>
39 <target name="build-refprojects"/>
40 <target name="run" depends="build">
41 <java classname="jp.sourceforge.posterdivider.Program" failonerror="true" fork="yes">
42 <classpath refid="PosterDivider.classpath"/>
45 <target name="srczip">
46 <zip destfile="PosterDivider-src-${VERSION}.zip">
47 <fileset dir="." includes="build.xml, History.txt, lib/**, macapp/**, Readme.txt, src/**, Todo.txt, winjvm/**" defaultexcludes="yes"/>
50 <target name="jar" depends="build">
51 <jar destfile="PosterDivider-${VERSION}.jar" basedir="bin">
53 <attribute name="Main-Class" value="jp.sourceforge.posterdivider.Program"/>
54 <attribute name="Class-Path" value="iText.jar bcprov.jar"/>
58 <target name="exe" depends="jar">
59 <mkdir dir="win/PosterDivider"/>
60 <mkdir dir="win/PosterDivider/Jar"/>
61 <copy file="../${ITEXTJAR}" tofile="win/PosterDivider/Jar/iText.jar"/>
62 <copy file="PosterDivider-${VERSION}.jar" tofile="win/PosterDivider/Jar/PosterDivider.jar"/>
63 <concat destfile="win/PosterDivider/Jar/fileversion.txt">iText.jar
PosterDivider.jar
</concat>
64 <replace file="win/PosterDivider/Jar/fileversion.txt" token="iText.jar" value="iText.jar -> ${ITEXTJAR}"/>
65 <replace file="win/PosterDivider/Jar/fileversion.txt" token="PosterDivider.jar" value="PosterDivider.jar -> PosterDivider-${VERSION}.jar"/>
66 <copy file="winjvm/PosterDivider.exe" todir="win/PosterDivider"/>
67 <copy file="Readme.txt" todir="win/PosterDivider"/>
69 <target name="zip" depends="exe">
70 <zip destfile="PosterDivider-${VERSION}.zip" basedir="win/PosterDivider" defaultexcludes="yes"/>
72 <target name="app" depends="jar">
73 <mkdir dir="mac/PosterDivider"/>
74 <copy todir="mac/PosterDivider/PosterDivider.app">
75 <fileset dir="macapp/PosterDivider.app" defaultexcludes="yes"/>
77 <chmod file="mac/PosterDivider/PosterDivider.app/Contents/MacOS/JavaApplicationStub" perm="+x"/>
78 <copy file="../${ITEXTJAR}" todir="mac/PosterDivider/PosterDivider.app/Contents/Resources/Java"/>
79 <exec executable="ln">
81 <arg value="${ITEXTJAR}"/>
82 <arg value="mac/PosterDivider/PosterDivider.app/Contents/Resources/Java/iText.jar"/>
84 <copy file="PosterDivider-${VERSION}.jar" todir="mac/PosterDivider/PosterDivider.app/Contents/Resources/Java"/>
85 <exec executable="ln">
87 <arg value="PosterDivider-${VERSION}.jar"/>
88 <arg value="mac/PosterDivider/PosterDivider.app/Contents/Resources/Java/PosterDivider.jar"/>
90 <copy file="Readme.txt" todir="mac/PosterDivider"/>
92 <target name="dmg" depends="app">
93 <exec executable="hdiutil">
95 <arg value="-srcfolder"/>
96 <arg value="mac/PosterDivider"/>
97 <arg value="-volname"/>
98 <arg value="PosterDivider"/>
99 <arg value="PosterDivider-${VERSION}.dmg"/>
102 <target name="all" depends="srczip, jar, zip, dmg"/>
103 <target name="updateversion">
104 <replaceregexp file="src/jp/sourceforge/posterdivider/Message.properties" match="App\.Version=[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" replace="App\.Version=${VERSION}" encoding="UTF-8"/>
105 <replaceregexp file="src/jp/sourceforge/posterdivider/Message.properties" match="App\.ShortVersion=[0-9]+\.[0-9]+\.[0-9]+" replace="App\.ShortVersion=${SHORTVERSION}" encoding="UTF-8"/>
106 <replaceregexp file="macapp/PosterDivider.app/Contents/Info.plist" match="<string>PosterDivider [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+</string>" replace="<string>PosterDivider ${VERSION}</string>" encoding="UTF-8"/>
107 <replaceregexp file="macapp/PosterDivider.app/Contents/Info.plist" match="<string>[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+</string>" replace="<string>${VERSION}</string>" encoding="UTF-8"/>
108 <replaceregexp file="Readme.txt" match="PosterDivider [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" replace="PosterDivider ${VERSION}" encoding="UTF-8"/>
110 <target name="release" depends="updateversion, all">
111 <copy file="PosterDivider-src-${VERSION}.zip" tofile="PosterDivider-src.zip"/>
112 <copy file="PosterDivider-${VERSION}.dmg" tofile="PosterDivider.dmg"/>
114 <target name="clean">
117 <fileset dir="." includes="iText.jar, bcprov.jar, **/._*, **/.DS_Store, **/*~, **/#*#" defaultexcludes="no"/>
120 <target name="cleanall" depends="clean">
124 <fileset dir="." includes="PosterDivider-src*.zip, PosterDivider*.jar, PosterDivider*.zip, PosterDivider*.dmg"/>