forked from genericworkflownodes/GenericKnimeNodes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
190 lines (158 loc) · 7.44 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
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
179
180
181
182
183
184
185
186
187
188
189
190
<project name="pluginbuilder" default="custom.plugin.build" basedir=".">
<property name="debug" value="true" />
<property name="plugin.dir" value="sample" description="directory in which to find the files from which you want to generate a KNIME plugin"/>
<property name="base.plugin.name" value="org.ballproject.knime" />
<property name="base.plugin.version.major" value="0" />
<property name="base.plugin.version.minor" value="6" />
<property name="base.plugin.version.patch" value="1" />
<!-- do not edit below this line -->
<property file="build.properties" />
<property file="${plugin.dir}/plugin.properties" />
<property name="base.plugin.version" value="${base.plugin.version.major}.${base.plugin.version.minor}.${base.plugin.version.patch}" />
<property name="custom.plugin.name" value="${pluginPackage}" />
<property name="custom.plugin.version" value="${pluginVersion}" />
<tstamp>
<format property="fulltime" pattern="yyyy-MM-dd'T'HH-mm-ss-SZ"/> <!-- about ISO8601 -->
</tstamp>
<property name="tmp" value="${java.io.tmpdir}/GKN-${fulltime}" />
<property name="base.plugin.build.dir" value="${tmp}/basePlugin" />
<property name="base.plugin.build.jar" value="build/${base.plugin.name}_${base.plugin.version}.jar" />
<property name="custom.plugin.build.src" value="${tmp}/customPlugin-sources" />
<property name="custom.plugin.build.dir" value="${tmp}/customPlugin" />
<property name="custom.plugin.build.jar" value="build/${custom.plugin.name}_${custom.plugin.version}.jar" />
<property name="src" value="src" />
<!-- the classpath for the base plugin (KNIME and jars in lib/) -->
<path id="base.plugin.classpath">
<!-- include all jars found in KNIME SDK plugins -->
<fileset dir="${knime.sdk}/plugins">
<include name="**/*.jar" />
</fileset>
<!-- include our own dependencies -->
<fileset dir="lib">
<include name="*.jar" />
</fileset>
</path>
<!-- the classpath used to compile and generate the plugin sources -->
<path id="custom.plugin.classpath">
<pathelement location="${base.plugin.build.jar}"/>
<path refid="base.plugin.classpath"/>
</path>
<target name="clean">
<delete dir="${tmp}" />
</target>
<target name="knime.sdk.condition">
<!-- check if knime.sdk was set correctly -->
<condition property="knime.sdk.exists">
<available file="${knime.sdk}" type="dir"/>
</condition>
</target>
<target name="knime.sdk.check" depends="knime.sdk.condition" unless="knime.sdk.exists" >
<echo message="knime.sdk was not set properly. Please edit the a file build.properties containing the following settings:" />
<echo message="knime.sdk=/path/to/your/knime/sdk" />
<fail message="Cannot build without a valid knime.sdk."/>
</target>
<target name="prepare" depends="knime.sdk.check,clean">
<echo message="knime.sdk.exists: ${knime.sdk.exists}" />
<mkdir dir="${tmp}" />
<mkdir dir="build" />
</target>
<target name="base.plugin.build" depends="prepare">
<echo message="Debug: ${debug}" />
<mkdir dir="${base.plugin.build.dir}" />
<copy file="data/plugin.xml" todir="${base.plugin.build.dir}" />
<copy file="data/build.properties" todir="${base.plugin.build.dir}" />
<mkdir dir="${base.plugin.build.dir}/lib" />
<copy todir="${base.plugin.build.dir}/lib" failonerror="true" overwrite="true">
<fileset dir="lib/">
<include name="*.jar" />
</fileset>
</copy>
<mkdir dir="${base.plugin.build.dir}/META-INF" />
<copy todir="${base.plugin.build.dir}/META-INF" failonerror="true" overwrite="true">
<fileset dir="data">
<include name="MANIFEST.MF" />
</fileset>
</copy>
<replace file="${base.plugin.build.dir}/META-INF/MANIFEST.MF" token="@@pluginVersion@@" value="${base.plugin.version}" />
<antcall target="base.plugin.classes.build" />
<mkdir dir="${base.plugin.build.dir}/data" />
<copy file="data/org.ballproject.knime.base.mime.demangler.DemanglerProvider.exsd" todir="${base.plugin.build.dir}/data" />
<mkdir dir="${base.plugin.build.dir}/icons" />
<copy todir="${base.plugin.build.dir}/icons" failonerror="true" overwrite="true">
<fileset dir="data">
<include name="**/*.png"/>
<include name="**/*.jpg"/>
<include name="**/*.gif"/>
</fileset>
</copy>
<copy file="data/GKN.png" todir="${base.plugin.build.dir}/icons" />
<zip destfile="${base.plugin.build.jar}" basedir="${base.plugin.build.dir}" />
</target>
<target name="base.plugin.classes.build">
<javac srcdir="${src}" destdir="${base.plugin.build.dir}" includeantruntime="false" debug="on" debuglevel="lines,vars,source">
<classpath refid="base.plugin.classpath" />
<compilerarg value="-Xlint:unchecked" />
<compilerarg value="-Xlint:deprecation" />
</javac>
<touch file="${base.plugin.build.dir}/org/ballproject/knime/baseplugin.properties" />
<propertyfile file="${base.plugin.build.dir}/org/ballproject/knime/baseplugin.properties">
<entry key="debug" value="${debug}" />
</propertyfile>
<!-- copy factory-xmls and other stuff -->
<copy todir="${base.plugin.build.dir}" failonerror="true" overwrite="true">
<fileset dir="${src}">
<!--<exclude name="**/*.java"/>-->
<exclude name="**/package.htm*" />
</fileset>
</copy>
</target>
<target name="custom.plugin.build" depends="base.plugin.build">
<mkdir dir="${custom.plugin.build.dir}"/>
<antcall target="custom.plugin.generate_sources" />
<antcall target="custom.plugin.classes.build" />
<zip destfile="${custom.plugin.build.jar}" basedir="${custom.plugin.build.dir}" />
</target>
<target name="custom.plugin.generate_sources" description="run node generator">
<java classname="org.ballproject.knime.nodegeneration.Main" failonerror="true" fork="true">
<!-- we use the detour via env.CLASSPATH here since WinXP machines otherwise couldn't -->
<!-- handle the to long classpath -->
<env key="CLASSPATH" path="${env.CLASSPATH}:${toString:custom.plugin.classpath}"/>
<arg value="${plugin.dir}" />
<arg value="${custom.plugin.build.src}" />
</java>
</target>
<target name="custom.plugin.classes.build">
<javac srcdir="${custom.plugin.build.src}" destdir="${custom.plugin.build.dir}" includeantruntime="false" debug="on" debuglevel="lines,vars,source">
<classpath refid="custom.plugin.classpath" />
<compilerarg value="-Xlint:unchecked" />
<compilerarg value="-Xlint:deprecation" />
</javac>
<!-- copy factory-xmls and other stuff -->
<copy todir="${custom.plugin.build.dir}" failonerror="true" overwrite="true">
<fileset dir="${custom.plugin.build.src}/src">
<!--exclude name="**/*.java" /-->
<exclude name="**/package.htm*" />
</fileset>
</copy>
<copy todir="${custom.plugin.build.dir}" failonerror="true" overwrite="true">
<fileset dir="${custom.plugin.build.src}">
<include name="**/*.png" />
<include name="**/*.gif" />
<include name="**/*.jpg" />
<include name="**/build.properties" />
<include name="**/plugin.xml" />
<include name="**/MANIFEST.MF" />
</fileset>
</copy>
</target>
<target name="test" depends="base.plugin.build">
<junit printsummary="yes" haltonfailure="yes" showoutput="yes">
<classpath refid="base.plugin.classpath"/>
<!--<formatter type="plain"/>-->
<test name="org.ballproject.knime.test.CTDNodeConfigurationWriterTest" />
<test name="org.ballproject.knime.test.CTDNodeConfigurationReaderTest" />
<test name="org.ballproject.knime.test.ParameterTest" />
<test name="org.ballproject.knime.test.MIMEFileStuffTest" />
</junit>
</target>
</project>