Files
loongoffice/scripting/workben/build.xml
2003-01-28 19:49:10 +00:00

340 lines
16 KiB
XML
Executable File

<!--
#*************************************************************************
#
# $RCSfile: build.xml,v $
#
# $Revision: 1.11 $
#
# last change: $Author: toconnor $ $Date: 2003-01-28 20:49:09 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
#
# - GNU Lesser General Public License Version 2.1
# - Sun Industry Standards Source License Version 1.1
#
# Sun Microsystems Inc., October, 2000
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2000 by Sun Microsystems, Inc.
# 901 San Antonio Road, Palo Alto, CA 94303, USA
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1, as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
#
# Sun Industry Standards Source License Version 1.1
# =================================================
# The contents of this file are subject to the Sun Industry Standards
# Source License Version 1.1 (the "License"); You may not use this file
# except in compliance with the License. You may obtain a copy of the
# License at http://www.openoffice.org/license.html.
#
# Software provided under this License is provided on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
# See the License for the specific provisions governing your rights and
# obligations concerning the Software.
#
# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
#
# Copyright: 2000 by Sun Microsystems, Inc.
#
# All Rights Reserved.
#
# Contributor(s): _______________________________________
#
#
#
#*************************************************************************
-->
<project name="Scipting Framework Installer" default="jar" basedir=".">
<!-- =================== Environmental Properties ======================= -->
<property name="prj" value=".."/>
<property file="${prj}/java/build.env"/>
<property name="build.compiler" value="classic"/>
<property name="optimize" value="on"/>
<property name="debug" value="on"/>
<property name="installerclasses" value="${out}/class/sframeworkinstall"/>
<property name="jardir" value="${out}/class"/>
<property name="bindir" value="${out}/bin"/>
<property name="sfversion" value="0.1"/>
<property name="installerjarname" value="SFrameworkInstall.jar"/>
<property environment="env"/>
<!-- ==================== classpath setting ============================ -->
<path id="idlclasspath">
<!-- <pathelement location="${solar.jar}/unoil.jar"/> -->
<pathelement location="${prj}/../unoil/${inpath}/class/unoil.jar"/>
<pathelement location="${solar.jar}/jurt.jar"/>
<pathelement location="${solar.jar}/jut.jar"/>
<pathelement location="${solar.jar}/juh.jar"/>
<pathelement location="${solar.jar}/java_uno.jar"/>
<pathelement location="${solar.jar}/ridl.jar"/>
<pathelement location="${solar.jar}/sandbox.jar"/>
</path>
<!-- ===================== Set up build conditionals ========================= -->
<target name="product.test">
<condition property="noproext">
<equals arg1="$${env.PROEXT}" arg2="${env.PROEXT}"/>
</condition>
</target>
<target name="nonproduct.set" if="noproext">
<property name="proext" value=""/>
</target>
<target name="product.set" unless="noproext">
<property name="proext" value="${env.PROEXT}"/>
</target>
<target name="build.conditions" depends="product.test,nonproduct.set,product.set">
<condition property="win9.build">
<available file="${prj}/wntmsci9${proext}"/>
</condition>
<condition property="win7.build">
<available file="${prj}/wntmsci9${proext}"/>
</condition>
<condition property="linx86.build">
<available file="${prj}/unxlngi4${proext}"/>
</condition>
<condition property="solsparc.build">
<available file="${prj}/unxsols3${proext}"/>
</condition>
<!-- <condition property="openoffice.build">
</condition> -->
</target>
<!-- ===================== Build the examples ========================= -->
<target name="buildexamples">
<mkdir dir="${out}/class/examples/Highlight"/>
<javac srcdir="${prj}/examples/java/" destdir="${out}/class/examples/Highlight/"
includes="**/Highlight*.java" classpathref="idlclasspath"
debug="${debug}" optimize="${optimize}" deprecation="on"/>
<copy todir="${out}/class/examples/Highlight/">
<fileset dir="${prj}/examples/java/">
<include name="**/Highlight*.java"/>
</fileset>
</copy>
<copy file="${prj}/examples/java/HighlightTextParcel.xml" tofile="${out}/class/examples/Highlight/parcel-descriptor.xml"/>
<jar jarfile="${out}/class/examples/Highlight/Highlight.jar"
basedir="${out}/class/examples/Highlight"
includes="**/*.java,**/*.class,**/*.xml"
excludes="${out}/class/examples/Highlight/Highlight.jar">
<manifest>
<attribute name="Built-By" value="Sun Microsystems"/>
<attribute name="ScriptFramework-Version" value="${sfversion}"/>
</manifest>
</jar>
<mkdir dir="${out}/class/examples/MemoryUsage"/>
<javac srcdir="${prj}/examples/java/" destdir="${out}/class/examples/MemoryUsage/"
includes="**/MemoryUsage.java" classpathref="idlclasspath"
debug="${debug}" optimize="${optimize}" deprecation="on"/>
<copy file="${prj}/examples/java/MemoryUsage.java" todir="${out}/class/examples/MemoryUsage/"/>
<copy file="${prj}/examples/java/MemoryUsageParcel.xml" tofile="${out}/class/examples/MemoryUsage/parcel-descriptor.xml"/>
<copy file="${prj}/examples/java/MemoryUsage.java" todir="${out}/class/examples/MemoryUsage/"/>
<copy file="${prj}/examples/java/ExampleSpreadSheet.sxc" todir="${out}/class/examples/MemoryUsage/"/>
<mkdir dir="${out}/class/examples/InteractiveBeanShell"/>
<copy file="${prj}/examples/java/interactive.bsh" todir="${out}/class/examples/InteractiveBeanShell/"/>
<copy file="${prj}/examples/java/interactive.xml" tofile="${out}/class/examples/InteractiveBeanShell/parcel-descriptor.xml"/>
</target>
<!-- ===================== Build UNO package ========================= -->
<target name="buildunopackage_win9" depends="build.conditions" if="win9.build">
<mkdir dir="${out}/class/sframeworkinstall/sframework"/>
<mkdir dir="${out}/class/sframework"/>
<exec executable="regmerge">
<arg value="${out}/class/sframework/ScriptFramework.rdb"/>
<arg value="/"/>
<arg value="${prj}/../offapi/wntmsci9${proext}/ucr/dcssscriptframework.db"/>
<arg value="${prj}/../offapi/wntmsci9${proext}/ucr/dcsssfprovider.db"/>
<arg value="${prj}/../offapi/wntmsci9${proext}/ucr/dcsssfstorage.db"/>
</exec>
<copy file="${out}/class/ScriptRuntimeForJava.jar"
todir="${out}/class/sframework/"/>
<mkdir dir="${out}/class/sframework/windows.plt"/>
<copy todir="${out}/class/sframework/windows.plt">
<fileset dir="${prj}/wntmsci9${proext}/bin/">
<include name="**/*.dll"/>
</fileset>
</copy>
<mkdir dir="${out}/class/sframework/skip_registration"/>
<copy file="${prj}/../unoil/wntmsci9${proext}/class/unoil.jar"
todir="${out}/class/sframework/skip_registration"/>
</target>
<target name="buildunopackage_win7" depends="build.conditions" if="win7.build">
<mkdir dir="${out}/class/sframeworkinstall/sframework"/>
<mkdir dir="${out}/class/sframework"/>
<exec executable="regmerge">
<arg value="${out}/class/sframework/ScriptFramework.rdb"/>
<arg value="/"/>
<arg value="${prj}/../offapi/wntmsci7${proext}/ucr/dcssscriptframework.db"/>
<arg value="${prj}/../offapi/wntmsci7${proext}/ucr/dcsssfprovider.db"/>
<arg value="${prj}/../offapi/wntmsci7${proext}/ucr/dcsssfstorage.db"/>
</exec>
<copy file="${out}/class/ScriptRuntimeForJava.jar"
todir="${out}/class/sframework/"/>
<mkdir dir="${out}/class/sframework/windows.plt"/>
<copy todir="${out}/class/sframework/windows.plt">
<fileset dir="${prj}/wntmsci7${proext}/bin/">
<include name="**/*.dll"/>
</fileset>
</copy>
<mkdir dir="${out}/class/sframework/skip_registration"/>
<copy file="${prj}/../unoil/wntmsci7${proext}/class/unoil.jar"
todir="${out}/class/sframework/skip_registration"/>
</target>
<target name="buildunopackage_linux" depends="build.conditions" if="linx86.build">
<mkdir dir="${out}/class/sframeworkinstall/sframework"/>
<mkdir dir="${out}/class/sframework"/>
<exec executable="regmerge">
<arg value="${out}/class/sframework/ScriptFramework.rdb"/>
<arg value="/"/>
<arg value="${prj}/../offapi/unxlngi4${proext}/ucr/dcssscriptframework.db"/>
<arg value="${prj}/../offapi/unxlngi4${proext}/ucr/dcsssfprovider.db"/>
<arg value="${prj}/../offapi/unxlngi4${proext}/ucr/dcsssfstorage.db"/>
</exec>
<copy file="${out}/class/ScriptRuntimeForJava.jar"
todir="${out}/class/sframework/"/>
<mkdir dir="${out}/class/sframework/linux_x86.plt"/>
<copy todir="${out}/class/sframework/linux_x86.plt">
<fileset dir="${prj}/unxlngi4${proext}/lib/">
<include name="**/lib*.so"/>
</fileset>
</copy>
<mkdir dir="${out}/class/sframework/skip_registration"/>
<copy file="${prj}/../unoil/unxlngi4${proext}/class/unoil.jar"
todir="${out}/class/sframework/skip_registration"/>
</target>
<target name="buildunopackage_solaris" depends="build.conditions" if="solsparc.build">
<mkdir dir="${out}/class/sframeworkinstall/sframework"/>
<mkdir dir="${out}/class/sframework"/>
<exec executable="regmerge">
<arg value="${out}/class/sframework/ScriptFramework.rdb"/>
<arg value="/"/>
<arg value="${prj}/../offapi/unxsols3${proext}/ucr/dcssscriptframework.db"/>
<arg value="${prj}/../offapi/unxsols3${proext}/ucr/dcsssfprovider.db"/>
<arg value="${prj}/../offapi/unxsols3${proext}/ucr/dcsssfstorage.db"/>
</exec>
<copy file="${out}/class/ScriptRuntimeForJava.jar"
todir="${out}/class/sframework/"/>
<mkdir dir="${out}/class/sframework/solaris_sparc.plt"/>
<copy todir="${out}/class/sframework/solaris_sparc.plt">
<fileset dir="${prj}/unxsols3${proext}/lib/">
<include name="**/lib*.so"/>
</fileset>
</copy>
<mkdir dir="${out}/class/sframework/skip_registration"/>
<copy file="${prj}/../unoil/unxsols3${proext}/class/unoil.jar"
todir="${out}/class/sframework/skip_registration"/>
</target>
<target name="buildunopackage" depends="buildunopackage_win9,buildunopackage_win7,buildunopackage_linux,buildunopackage_solaris">
<zip zipfile="${out}/class/sframeworkinstall/sframework/ooscriptframe.zip"
basedir="${out}/class/sframework">
</zip>
<copy file="${prj}/common/bin/scripting${env.UPD}01.res"
todir="${out}/class/sframeworkinstall/sframework/"/>
</target>
<!-- =================== Build BeanShell UNO package ===================== -->
<target name="buildbshuno">
<mkdir dir="${out}/class/bshruntime"/>
<copy file="${out}/class/ScriptRuntimeForBeanShell.jar"
todir="${out}/class/bshruntime/"/>
<mkdir dir="${out}/class/bshruntime/skip_registration"/>
<copy file="${install.dir}/bsh-1.2b7.jar"
todir="${out}/class/bshruntime/skip_registration"/>
<zip zipfile="${out}/class/bshruntime.zip"
basedir="${out}/class/bshruntime">
</zip>
</target>
<!-- ===================== Package regsingletons ========================= -->
<target name="packagesingletons_win7" depends="build.conditions" if="win7.build">
<mkdir dir="${out}/class/sframeworkinstall/windows"/>
<copy file="${env.SOLARVER}/wntmsci7${proext}/bin${env.UPDMINOREXT}/regsingleton.exe" todir="${out}/class/sframeworkinstall/windows"/>
</target>
<target name="packagesingletons_win9" depends="build.conditions" if="win9.build">
<mkdir dir="${out}/class/sframeworkinstall/windows"/>
<copy file="${env.SOLARVER}/wntmsci9${proext}/bin${env.UPDMINOREXT}/regsingleton.exe" todir="${out}/class/sframeworkinstall/windows"/>
</target>
<target name="packagesingletons_linux" depends="build.conditions" if="linx86.build">
<mkdir dir="${out}/class/sframeworkinstall/linux_x86"/>
<copy file="${env.SOLARVER}/unxlngi4${proext}/bin${env.UPDMINOREXT}/regsingleton" todir="${out}/class/sframeworkinstall/linux_x86"/>
</target>
<target name="packagesingletons_solaris" depends="build.conditions" if="solsparc.build">
<mkdir dir="${out}/class/sframeworkinstall/solaris_sparc"/>
<copy file="rs_solaris/regsingleton" todir="${out}/class/sframeworkinstall/solaris_sparc"/>
</target>
<target name="packagesingletons" depends="packagesingletons_win7,packagesingletons_win9,packagesingletons_linux,packagesingletons_solaris">
</target>
<!-- ===================== Package scripts, dialogs & examples =========== -->
<target name="packagedialogsandexamples" depends="buildexamples">
<mkdir dir="${out}/class/sframeworkinstall/bindingdialog"/>
<copy todir="${out}/class/sframeworkinstall/bindingdialog">
<fileset dir="bindings/">
<include name="**/*.x*"/>
</fileset>
</copy>
<mkdir dir="${out}/class/sframeworkinstall/examples"/>
<copy todir="${out}/class/sframeworkinstall/examples">
<fileset dir="${out}/class/examples/"/>
</copy>
</target>
<!-- ===================== Package scripts, dislogs & examples =========== -->
<target name="packageide">
<mkdir dir="${out}/class/sframeworkinstall/ide"/>
<copy todir="${out}/class/sframeworkinstall/ide">
<fileset dir="${out}/class/">
<include name="OfficeScripting.jar"/>
<include name="idesupport.jar"/>
<include name="office.jar"/>
</fileset>
</copy>
</target>
<!-- ======================== Compile Classes ========================== -->
<target name="compileinstaller">
<mkdir dir="${installerclasses}"/>
<javac srcdir="installer/" destdir="${installerclasses}"
includes="**/*.java" classpathref="idlclasspath"
debug="${debug}" optimize="${optimize}" deprecation="on"/>
<copy file="installer/sidebar.jpg" todir="${out}/class/sframeworkinstall/installer"/>
</target>
<!-- ===================== jar ========================= -->
<target name="jar" depends="compileinstaller,packagedialogsandexamples,packageide,packagesingletons,buildunopackage,buildbshuno">
<jar jarfile="${jardir}/${installerjarname}"
basedir="${installerclasses}">
<manifest>
<attribute name="Built-By" value="Sun Microsystems"/>
<attribute name="ScriptFramework-Version" value="${sfversion}"/>
<attribute name="Main-Class" value="installer.InstallWizard"/>
</manifest>
</jar>
</target>
<!-- ====================== Clean Generated Files ===================== -->
<target name="clean">
<delete dir="${scriptingclasses}"/>
<delete dir="${storageclasses}"/>
<delete dir="${jardir}/${scriptingjarname}"/>
</target>
<!-- ========================= All In One Build ======================= -->
<target name="all" depends="clean,jar"/>
</project>