xref: /trunk/main/scripting/examples/java/build.xml (revision cdf0e10c)
1<!--
2
3  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
5  Copyright 2000, 2010 Oracle and/or its affiliates.
6
7  OpenOffice.org - a multi-platform office productivity suite
8
9  This file is part of OpenOffice.org.
10
11  OpenOffice.org is free software: you can redistribute it and/or modify
12  it under the terms of the GNU Lesser General Public License version 3
13  only, as published by the Free Software Foundation.
14
15  OpenOffice.org is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  GNU Lesser General Public License version 3 for more details
19  (a copy is included in the LICENSE file that accompanied this code).
20
21  You should have received a copy of the GNU Lesser General Public License
22  version 3 along with OpenOffice.org.  If not, see
23  <http://www.openoffice.org/license.html>
24  for a copy of the LGPLv3 License.
25
26-->
27<project name="Scripting Framework Java Examples" default="all" basedir=".">
28  <!-- =================== Environmental Properties ======================= -->
29
30  <property name="prj" value="../.."/>
31  <property environment="env"/>
32  <property name="outdir" value="${out}/class/examples/java"/>
33
34  <!-- ==================== classpath setting ============================ -->
35  <path id="idlclasspath">
36    <pathelement location="${solar.jar}/unoil.jar"/>
37    <pathelement location="${solar.jar}/jurt.jar"/>
38    <pathelement location="${solar.jar}/juh.jar"/>
39    <pathelement location="${solar.jar}/ridl.jar"/>
40    <pathelement location="${out}/class/ScriptFramework.jar"/>
41  </path>
42
43  <!-- ===================== HelloWorld example =========================== -->
44  <target name="HelloWorld">
45
46    <mkdir dir="${outdir}/HelloWorld"/>
47
48    <javac srcdir="HelloWorld" destdir="${outdir}/HelloWorld"
49           includes="**/*.java" classpathref="idlclasspath"
50           debug="${debug}" optimize="${optimize}" deprecation="on"/>
51
52    <copy file="HelloWorld/HelloWorld.java" todir="${outdir}/HelloWorld"/>
53    <copy file="HelloWorld/parcel-descriptor.xml" todir="${outdir}/HelloWorld"/>
54
55    <jar jarfile="${outdir}/HelloWorld/HelloWorld.jar"
56         basedir="${outdir}/HelloWorld"
57         includes="**/*.class"
58         excludes="${outdir}/HelloWorld/HelloWorld.jar">
59    </jar>
60
61    <delete file="${outdir}/HelloWorld/HelloWorld.class"/>
62
63  </target>
64
65  <!-- ===================== Highlight example ========================== -->
66  <target name="Highlight">
67
68    <mkdir dir="${outdir}/Highlight"/>
69
70    <javac srcdir="Highlight" destdir="${outdir}/Highlight"
71           includes="**/*.java" classpathref="idlclasspath"
72           debug="${debug}" optimize="${optimize}" deprecation="on"/>
73
74    <copy file="Highlight/HighlightText.java" todir="${outdir}/Highlight"/>
75    <copy file="Highlight/parcel-descriptor.xml" todir="${outdir}/Highlight"/>
76
77    <jar jarfile="${outdir}/Highlight/Highlight.jar"
78         basedir="${outdir}/Highlight"
79         includes="**/*.class"
80         excludes="${outdir}/Highlight/Highlight.jar">
81    </jar>
82
83    <delete file="${outdir}/Highlight/HighlightText.class"/>
84
85  </target>
86
87  <!-- ===================== MemoryUsage example ========================== -->
88  <target name="MemoryUsage">
89
90    <mkdir dir="${outdir}/MemoryUsage"/>
91
92    <javac srcdir="MemoryUsage" destdir="${outdir}/MemoryUsage"
93           includes="**/*.java" classpathref="idlclasspath"
94           debug="${debug}" optimize="${optimize}" deprecation="on"/>
95
96    <copy file="MemoryUsage/MemoryUsage.java" todir="${outdir}/MemoryUsage"/>
97    <copy file="MemoryUsage/parcel-descriptor.xml" todir="${outdir}/MemoryUsage"/>
98
99    <jar jarfile="${outdir}/MemoryUsage/MemoryUsage.jar"
100         basedir="${outdir}/MemoryUsage"
101         includes="**/*.class"
102         excludes="${outdir}/MemoryUsage/MemoryUsage.jar">
103    </jar>
104
105    <delete file="${outdir}/MemoryUsage/MemoryUsage.class"/>
106
107  </target>
108
109  <!-- ===================== selector example ========================== -->
110  <target name="selector">
111
112    <mkdir dir="${outdir}/selector"/>
113
114    <javac srcdir="selector" destdir="${outdir}/selector"
115       	   includes="**/*.java" classpathref="idlclasspath"
116	       debug="${debug}" optimize="${optimize}" deprecation="on"/>
117
118    <copy todir="${outdir}/selector">
119        <fileset dir="selector">
120            <include name="**/*.java"/>
121            <include name="*.xml"/>
122            <include name="*.gif"/>
123        </fileset>
124    </copy>
125
126    <jar jarfile="${outdir}/selector/selector.jar"
127         basedir="${outdir}/selector" includes="*.class,*.gif">
128    </jar>
129
130    <delete>
131        <fileset dir="${outdir}/selector" includes="*.class,*.gif"/>
132    </delete>
133
134  </target>
135
136  <!-- ========================= All In One Build ======================= -->
137  <target name="all" depends="HelloWorld,Highlight,MemoryUsage"/>
138
139</project>
140