-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.xml
130 lines (112 loc) · 5.01 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
<?xml version="1.0" encoding="UTF-8"?>
<project default="build" name="Create Runnable Jar for ImageFlow">
<!--this file was created by Eclipse Runnable JAR Export Wizard-->
<!--ANT 1.7 is required -->
<property name="project-name" value="ImageFlow" />
<property name="main-class" value="de.danielsenff.imageflow.ImageFlow"/>
<property name="bin.dir" location="${basedir}/bin" />
<property name="src.dir" location="${basedir}/src" />
<property name="dist.dir" location="${basedir}/dist" />
<property name="packaging.dir" location="${src.dir}/packaging" />
<property name="lib.dir" location="${basedir}/lib" />
<property name="ij.path" location="${basedir}/lib/ij.jar" />
<property name="release.dir" location="${dist.dir}/release/${project-name}" />
<property name="units.dir" location="${basedir}/xml_units" />
<property name="icons.dir" location="${basedir}/xml_icons" />
<property name="doc.dir" location="${basedir}/doc/release" />
<property name="example.dir" location="${basedir}/xml_flows" />
<tstamp>
<format property="TODAY" pattern="yyyy-MM-d-hh-mm" />
</tstamp>
<path id="classpath">
<pathelement location="${ij.path}" />
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<target name="clean" description="Clean and delete exisinst folders">
<delete dir="${release.dir}"/>
<delete dir="${bin.dir}"/>
</target>
<target name="copy" description="Copy stuff for plugin creation" depends="clean">
<mkdir dir="${bin.dir}" />
<mkdir dir="${release.dir}" />
<mkdir dir="${release.dir}/executable" />
<!-- copy folder for example flows and unit xml -->
<mkdir dir="${bin.dir}/xml_units" />
<copy todir="${bin.dir}/xml_units">
<fileset dir="${units.dir}" />
</copy>
<mkdir dir="${bin.dir}/xml_icons" />
<copy todir="${bin.dir}/xml_icons">
<fileset dir="${icons.dir}" />
</copy>
<mkdir dir="${release.dir}/executable/doc" />
<copy todir="${release.dir}/executable/doc">
<fileset dir="${doc.dir}" />
</copy>
<copy todir="${release.dir}/executable" file="${basedir}/ImageFlow" />
<mkdir dir="${bin.dir}/xml_flows" />
<copy todir="${bin.dir}/xml_flows">
<fileset dir="${example.dir}" />
</copy>
</target>
<target name="compile" description="Fresh compile Java class files">
<mkdir dir="${bin.dir}" />
<!-- copy all files from src which are not java-files -->
<copy todir="${bin.dir}">
<fileset dir="${src.dir}" excludes="**.java, packaging/" />
</copy>
<javac srcdir="src" destdir="${bin.dir}" classpathref="classpath"/>
</target>
<target name="create_plugin_jar" depends="copy, compile">
<mkdir dir="${release.dir}/plugin" />
<jar destfile="${release.dir}/plugin/${project-name}_.jar" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="${main-class}"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="${bin.dir}"/>
<zipfileset excludes="META-INF/*.SF" src="${basedir}/lib/jdom.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${basedir}/lib/appframework-1.0.3.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${basedir}/lib/swing-worker-1.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${basedir}/lib/swing-layout-1.0.3.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${basedir}/lib/jcommon-1.0.16.jar"/>
</jar>
</target>
<target name="create_run_jar" depends="copy, compile">
<!--<mkdir dir="${release.dir}/executable" />-->
<jar destfile="${release.dir}/executable/${project-name}_.jar" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="${main-class}"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="${bin.dir}"/>
<zipfileset excludes="META-INF/*.SF" src="${basedir}/lib/jdom.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${basedir}/lib/ij.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${basedir}/lib/appframework-1.0.3.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${basedir}/lib/swing-worker-1.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${basedir}/lib/swing-layout-1.0.3.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${basedir}/lib/jcommon-1.0.16.jar"/>
</jar>
</target>
<target name="build_osx_app" depends="create_run_jar" if="isOSX">
<!-- TODO -->
</target>
<target name="zip_for_release" depends="create_run_jar">
<zip destfile="${dist.dir}/Imageflow-${TODAY}.zip">
<fileset dir="${release.dir}/executable/"/>
</zip>
</target>
<target name="zip_plugin_for_release" depends="create_plugin_jar">
<zip destfile="${dist.dir}/Imageflow-ijplugin-${TODAY}.zip">
<fileset dir="${release.dir}/plugin/"/>
</zip>
</target>
<target name="build_plugin" description="Build project" depends="zip_plugin_for_release">
<!-- done -->
</target>
<target name="build" description="Build project" depends="build_osx_app, build_plugin, zip_for_release">
<!-- done -->
</target>
</project>