-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.xml
92 lines (84 loc) · 2.87 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
<project name="kb_seed" basedir="." default="compile">
<description>
This module contains the CDMI java client interface.
</description>
<property name="app.name" value="kb_seed"/>
<property name="module.package" value="CDMI"/>
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="kb_top" location="../.."/>
<property name="jar_file" location="${dist}/lib/${app.name}.jar" />
<path id="project.class.path">
<fileset dir="..">
<include name="*/dist/lib/*.jar"/>
<exclude name="${jar_file}"/>
</fileset>
<fileset dir="${kb_top}">
<include name="*/lib/*.jar"/>
</fileset>
<!-- <pathelement path="${java.class.path}/"/> -->
</path>
<target name="init">
<tstamp/>
<mkdir dir="${build}"/>
</target>
<target name="-check-code-exists">
<available property="code.exists" file="${src}/us/kbase/${module.package}/code_generated_flag"/>
</target>
<target name="generate_java" depends="-check-code-exists" unless="code.exists"
description="Generate java code from type specification document.">
<delete dir="${src}/us/kbase/${module.package}"/>
<exec executable="gen_java_client"
failonerror="true"
>
<arg value="lib/CDMI-API.spec"/>
<arg value="lib/CDMI-EntityAPI.spec"/>
<arg value="us.kbase.${module.package}"/>
<arg value="${src}"/>
</exec>
<!-- Need to tweak a file since it clashes with a java keyword. -->
<exec executable="perl"
failonerror="true"
>
<arg value="-pi.bak"/>
<arg value="-e"/>
<arg value="s/private/m_private/"/>
<arg value="${src}/us/kbase/${module.package}/fields_Subsystem.java"/>
</exec>
<touch file="${src}/us/kbase/${module.package}/code_generated_flag" />
</target>
<target name="compile" depends="init,generate_java"
description="compile java source">
<javac
includeantruntime="false"
srcdir="${src}/us"
destdir="${build}">
<classpath refid="project.class.path"/>
</javac>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<delete file="${dist}/lib/${app.name}.jar" />
<jar jarfile="${dist}/lib/${app.name}.jar" basedir="${build}"/>
</target>
<target name="compile_test" depends="dist"
description="compile a simple test code">
<javac
includeantruntime="false"
srcdir="${src}/tests"
destdir="${build}"
>
<classpath refid="project.class.path"/>
</javac>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${src}/us/kbase/${module.package}"/>
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>