-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.xml
143 lines (124 loc) · 5.23 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
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
<?xml version="1.0"?>
<project default="dist" name="Project Jreepad">
<description>
Java treepad - personal information manager
</description>
<property name="curVersion" value="1.7rc1" />
<property name="srcDir" location="src" />
<property name="imgDir" location="images" />
<property name="buildDir" location="build" />
<property name="imgTargetDir" location="${buildDir}/images" />
<property name="libDir" value="lib" />
<property name="distDir" location="dist" />
<property name="mainClass" location="jreepad.JreepadViewer" />
<property name="timeStamp" location="${DSTAMP}" />
<property name="packageName" location="jreepad" />
<!-- jars to be included in the distribution -->
<fileset id="distJars" dir="${libDir}">
<include name="*.jar"/>
<exclude name="AppleJavaExtensions.jar"/>
<exclude name="jarbundler*.jar"/>
</fileset>
<path id="distJarsPath">
<fileset refid="distJars"/>
</path>
<pathconvert property="distJarsProperty" pathsep=" ">
<path refid="distJarsPath"/>
<chainedmapper>
<flattenmapper/>
<globmapper from="*" to="lib/*"/>
</chainedmapper>
</pathconvert>
<!-- jars required for building -->
<path id="projectClasspath">
<pathelement path="${buildDir}" />
<fileset dir="${libDir}">
<include name="*.jar"/>
<exclude name="jarbundler*.jar"/>
</fileset>
</path>
<taskdef name="jarbundler"
classpath="${libDir}/jarbundler-1.9.jar"
classname="net.sourceforge.jarbundler.JarBundler" />
<target name="init">
<tstamp />
<mkdir dir="${buildDir}" />
<mkdir dir="${buildDir}/jreepad/lang" />
<mkdir dir="${distDir}" />
<mkdir dir="${distDir}/lib" />
<mkdir dir="${distDir}/Jreepad-${curVersion}-OSX/" />
</target>
<target name="compile" depends="init">
<javac srcdir="${srcDir}" destdir="${buildDir}" debug="on">
<classpath refid="projectClasspath"/>
</javac>
<copy todir="${buildDir}/jreepad/lang">
<fileset dir="${srcDir}/jreepad/lang" includes="*.properties" />
</copy>
<copy todir="${imgTargetDir}">
<fileset dir="${imgDir}" />
</copy>
</target>
<target name="jar" depends="compile">
<jar destfile="${distDir}/Jreepad-${curVersion}.jar" basedir="${buildDir}">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="jreepad.JreepadViewer" />
<attribute name="Class-Path" value="${distJarsProperty}"/>
</manifest>
</jar>
<copy todir="${distDir}/lib">
<fileset refid="distJars"/>
</copy>
</target>
<target name="run" depends="compile">
<java fork="yes" dir="${buildDir}" classname="jreepad.JreepadViewer" failonerror="true">
<classpath refid="projectClasspath"/>
</java>
</target>
<target name="runjar" depends="compile,jar">
<java fork="yes" jar="${distDir}/Jreepad-${curVersion}.jar" failonerror="true"/>
</target>
<target name="dist" depends="clean,compile,jar">
<jarbundler dir="${distDir}/Jreepad-${curVersion}-OSX"
name="Jreepad"
version="${curVersion}"
icon="icons/jreepadlogo-01.icns"
infostring="Jreepad, compiled ${DSTAMP}"
mainclass="jreepad.JreepadViewer"
bundleid="net.sf.jreepad"
screenmenu="true"
signature="JREE"
jvmversion="1.4+"
>
<jarfileset dir="${distDir}">
<include name="*.jar"/>
<include name="lib/*.jar"/>
</jarfileset>
<documenttype extensions="jree" iconFile="icons/jree.icns" name="Jreepad tree document" role="Editor"/>
<documenttype extensions="hjt" iconFile="icons/hjt.icns" name="Treepad tree document" role="Editor"/>
<documenttype ostypes="JREE" iconFile="icons/jree.icns" name="Jreepad tree document" role="Editor"/>
<!-- <documenttype ostypes="****" iconFile="icons/jree.icns" name="Jreepad file" role="Editor"/> -->
</jarbundler>
<!-- Copying these icon files should NOT be needed if/when the jarbundler task includes doc file parameters -->
<!-- <copy file="icons/jree.icns" tofile="${distDir}/Jreepad-${curVersion}-OSX/Jreepad.app/Contents/Resources/jree.icns" />
<copy file="icons/hjt.icns" tofile="${distDir}/Jreepad-${curVersion}-OSX/Jreepad.app/Contents/Resources/hjt.icns" />
-->
<tar destfile="${distDir}/Jreepad-${curVersion}-source.tar.gz" basedir="${srcDir}" compression="gzip"/>
<copy file="manual/JreepadManual.jree" tofile="${distDir}/JreepadManual-${curVersion}.jree" />
<copy file="manual/JreepadManual.jree" tofile="${distDir}/Jreepad-${curVersion}-OSX/JreepadManual-${curVersion}.jree" />
<copy file="${distDir}/Jreepad-${curVersion}-source.tar.gz" todir="${distDir}/Jreepad-${curVersion}-OSX/" />
<copy file="manual/osxreadme/Read me first.rtf" todir="${distDir}/Jreepad-${curVersion}-OSX/" />
<!-- OSX-only step - create the .DMG disk image -->
<exec dir="${distDir}" executable="hdiutil" os="Mac OS X">
<arg line="create -ov -srcfolder Jreepad-${curVersion}-OSX Jreepad-${curVersion}-OSX.dmg"/>
</exec>
<!-- <exec dir="${distDir}" executable="hdiutil" os="Mac OS X">
<arg line="internet-enable -yes Jreepad-${curVersion}-OSX.dmg"/>
</exec> -->
</target>
<target name="clean">
<delete dir="${buildDir}" />
<delete dir="${distDir}" />
</target>
</project>