-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathbuild.xml
143 lines (126 loc) · 5.36 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
<!--
JWave is distributed under the MIT License (MIT); this file is part of.
Copyright (c) 2008-2020 Christian ([email protected])
see LICENSE.md
-->
<project name="JWave" default="dist" basedir=".">
<description>
ant build file for JWave; https://github.com/cscheiblich/JWave
TODO: Set your OS dependent path to the JUnit4 JAR file below!
For Windows OS also set the path to org.hamcrest.core JAR file!
</description>
<!-- setting static directories and files -->
<property name="src" location="src"/>
<property name="test" location="test"/>
<property name="dist" location="dist"/>
<property name="build" location="build"/>
<property name="jwave" location="${dist}/${ant.project.name}.jar"/>
<!-- set conditions for checking the OS -->
<condition property="isMac">
<os family="mac" />
</condition>
<condition property="isWin">
<os family="windows" />
</condition>
<condition property="isUnix">
<os family="unix" />
</condition>
<!-- Set the MAC OS specific parameters -->
<target name="doMac" if="isMac">
<echo message="OS is a Mac target" />
<!-- set the path to a MAC or Unix OS below -->
<property name="junit" location="IS NOT SET - SET IT!"/>
<!-- hamcrest NOT USED - DO NOOT SET -->
<property name="hamcr" location=""/>
<echo message="JUnit path: ${junit}" />
</target>
<!-- Set the Windows OS specific parameters -->
<target name="doWin" if="isWin">
<echo message="OS is a Windows target" />
<!-- set the path to a Windows OS below -->
<!-- property name="junit" location="C:\Portable\eclipse\plugins\org.junit_4.11.0.v201303080030\junit.jar"/-->
<property name="junit" location="C:/Portable/eclipse/plugins/org.junit_4.11.0.v201303080030/junit.jar"/>
<property name="hamcr" location="C:/Portable/eclipse/plugins/org.hamcrest.core_1.3.0.v201303031735.jar"/>
<echo message="JUnit path: ${junit}" />
</target>
<!-- Set the GNU/Linux or Unix OS specific parameters -->
<target name="doUnix" if="isUnix">
<echo message="OS is a Unix target" />
<!-- set the path to a GNU/Linux or Unix OS below -->
<!-- on regular driven GNU/Linux OS the following should hold -->
<!-- <property name="junit" location="/usr/share/java/junit4.jar"/> -->
<!-- for travis-ci.org, we change to while being in java directory -->
<!-- <property name="junit" location="./junit4.jar"/> -->
<property name="junit" location="./lib/junit4.jar"/>
<!-- hamcrest NOT USED - DO NOT SET -->
<property name="hamcr" location="./lib/hamcrest-all.jar"/>
<echo message="JUnit path: ${junit}" />
</target>
<!-- set the OS dependent class paths and create directories -->
<target name="init" depends="doMac, doWin, doUnix">
<tstamp/>
<path id="classpath.junit">
<pathelement location="${junit}"/>
</path>
<path id="classpath.hamcr">
<pathelement location="${hamcr}"/>
</path>
<path id="classpath.jwave">
<pathelement location="${jwave}"/>
</path>
<path id="classpath.tests">
<pathelement location="${test}"/>
</path>
<path id="classpath.build">
<pathelement location="${build}"/>
</path>
<mkdir dir="${build}"/>
<mkdir dir="${dist}"/>
<echo message="OS Name is: ${os.name}" />
<echo message="OS Arch. is: ${os.arch}" />
<echo message="OS Vers. is: ${os.version}" />
<echo message="JUnit path: ${junit}" />
<echo message="hamcrest path: ${hamcr}" />
</target>
<!-- compile all available Java classes -->
<target name="compile" depends="init" description="compile the source">
<javac srcdir="${src}" destdir="${build}" includeantruntime="false">
<classpath refid="classpath.junit"/>
</javac>
</target>
<!-- create JAR file from compiled class files without JUnit test cases -->
<target name="dist" depends="compile" description="generates distribution">
<jar jarfile="${dist}/JWave.jar" basedir="${build}"/>
<!-- jar jarfile="${dist}/JWave-${DSTAMP}.jar" basedir="${build}"/ -->
</target>
<!-- run console example for JWave -->
<target name="run" depends="dist" description="run console example">
<java fork="true" failonerror="yes" classname="jwave.JWave">
<classpath refid="classpath.jwave"/>
<arg line="Fast Wavelet Transform Daubechies 20"/>
</java>
</target>
<!-- compile JUnit test cases and run all available -->
<target name="test" depends="dist" description="build and run JUnit tests">
<javac srcdir="${test}" destdir="${build}" includeantruntime="false">
<classpath refid="classpath.junit"/>
<classpath refid="classpath.jwave"/>
</javac>
<junit haltonfailure="true" showoutput="true" printsummary="true">
<classpath refid="classpath.junit"/>
<classpath refid="classpath.hamcr"/>
<classpath refid="classpath.jwave"/>
<classpath refid="classpath.build"/>
<formatter type="plain"/>
<batchtest fork="yes" todir="${build}">
<fileset dir="${build}">
<include name="**/*Test.class"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- tidy up all built stuff: Java and JUnit test case classes -->
<target name="clean" description="clean up - delete build directory">
<delete dir="${build}"/>
</target>
</project>