xref: /trunk/main/scripting/examples/java/build.xml (revision cc697cd0)
1<!--***********************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 ***********************************************************-->
21
22
23<project name="Scripting Framework Java Examples" default="all" basedir=".">
24  <!-- =================== Environmental Properties ======================= -->
25
26  <property name="prj" value="../.."/>
27  <property environment="env"/>
28  <property name="outdir" value="${out}/class/examples/java"/>
29
30  <!-- ==================== classpath setting ============================ -->
31  <path id="idlclasspath">
32    <pathelement location="${solar.jar}/unoil.jar"/>
33    <pathelement location="${solar.jar}/jurt.jar"/>
34    <pathelement location="${solar.jar}/juh.jar"/>
35    <pathelement location="${solar.jar}/ridl.jar"/>
36    <pathelement location="${out}/class/ScriptFramework.jar"/>
37  </path>
38
39  <!-- ===================== HelloWorld example =========================== -->
40  <target name="HelloWorld">
41
42    <mkdir dir="${outdir}/HelloWorld"/>
43
44    <javac srcdir="HelloWorld" destdir="${outdir}/HelloWorld"
45           includes="**/*.java" classpathref="idlclasspath" includeantruntime="false"
46           debug="${debug}" optimize="${optimize}" deprecation="on"/>
47
48    <copy file="HelloWorld/HelloWorld.java" todir="${outdir}/HelloWorld"/>
49    <copy file="HelloWorld/parcel-descriptor.xml" todir="${outdir}/HelloWorld"/>
50
51    <jar jarfile="${outdir}/HelloWorld/HelloWorld.jar"
52         basedir="${outdir}/HelloWorld"
53         includes="**/*.class"
54         excludes="${outdir}/HelloWorld/HelloWorld.jar">
55    </jar>
56
57    <delete file="${outdir}/HelloWorld/HelloWorld.class"/>
58
59  </target>
60
61  <!-- ===================== Highlight example ========================== -->
62  <target name="Highlight">
63
64    <mkdir dir="${outdir}/Highlight"/>
65
66    <javac srcdir="Highlight" destdir="${outdir}/Highlight"
67           includes="**/*.java" classpathref="idlclasspath" includeantruntime="false"
68           debug="${debug}" optimize="${optimize}" deprecation="on"/>
69
70    <copy file="Highlight/HighlightText.java" todir="${outdir}/Highlight"/>
71    <copy file="Highlight/parcel-descriptor.xml" todir="${outdir}/Highlight"/>
72
73    <jar jarfile="${outdir}/Highlight/Highlight.jar"
74         basedir="${outdir}/Highlight"
75         includes="**/*.class"
76         excludes="${outdir}/Highlight/Highlight.jar">
77    </jar>
78
79    <delete file="${outdir}/Highlight/HighlightText.class"/>
80
81  </target>
82
83  <!-- ===================== MemoryUsage example ========================== -->
84  <target name="MemoryUsage">
85
86    <mkdir dir="${outdir}/MemoryUsage"/>
87
88    <javac srcdir="MemoryUsage" destdir="${outdir}/MemoryUsage"
89           includes="**/*.java" classpathref="idlclasspath" includeantruntime="false"
90           debug="${debug}" optimize="${optimize}" deprecation="on"/>
91
92    <copy file="MemoryUsage/MemoryUsage.java" todir="${outdir}/MemoryUsage"/>
93    <copy file="MemoryUsage/parcel-descriptor.xml" todir="${outdir}/MemoryUsage"/>
94
95    <jar jarfile="${outdir}/MemoryUsage/MemoryUsage.jar"
96         basedir="${outdir}/MemoryUsage"
97         includes="**/*.class"
98         excludes="${outdir}/MemoryUsage/MemoryUsage.jar">
99    </jar>
100
101    <delete file="${outdir}/MemoryUsage/MemoryUsage.class"/>
102
103  </target>
104
105  <!-- ===================== selector example ========================== -->
106  <target name="selector">
107
108    <mkdir dir="${outdir}/selector"/>
109
110    <javac srcdir="selector" destdir="${outdir}/selector"
111       	   includes="**/*.java" classpathref="idlclasspath"
112	       debug="${debug}" optimize="${optimize}" deprecation="on"/>
113
114    <copy todir="${outdir}/selector">
115        <fileset dir="selector">
116            <include name="**/*.java"/>
117            <include name="*.xml"/>
118            <include name="*.gif"/>
119        </fileset>
120    </copy>
121
122    <jar jarfile="${outdir}/selector/selector.jar"
123         basedir="${outdir}/selector" includes="*.class,*.gif">
124    </jar>
125
126    <delete>
127        <fileset dir="${outdir}/selector" includes="*.class,*.gif"/>
128    </delete>
129
130  </target>
131
132  <!-- ========================= All In One Build ======================= -->
133  <target name="all" depends="HelloWorld,Highlight,MemoryUsage"/>
134
135</project>
136