blob: e5dca15de7bf3b7b9fe033e8b9155ff53171974c [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
***********************************************************-->
<project name="idl" xmlns:if="ant:if" xmlns:unless="ant:unless">
<dirname property="idl.basedir" file="${ant.file.idl}"/>
<macrodef name="idl-javamaker">
<attribute name="idlFiles"/>
<attribute name="idlBuildDir"/>
<sequential>
<local name="idl.javamaker.flag"/>
<property name="idl.javamaker.flag" location="@{idlBuildDir}/idl.javamaker.flag"/>
<local name="idl.uptodate"/>
<condition property="idl.uptodate">
<resourcecount property="idl.uptodate" when="equal" count="0">
<resources refid="@{idlFiles}"/>
</resourcecount>
</condition>
<uptodate property="idl.uptodate" targetfile="${idl.javamaker.flag}" unless:set="idl.uptodate">
<srcfiles refid="@{idlFiles}"/>
</uptodate>
<build-idl
idlFiles="@{idlFiles}"
idlBuildDir="@{idlBuildDir}"
targetFlagFile="${idl.javamaker.flag}"
unless:set="idl.uptodate"/>
</sequential>
</macrodef>
<macrodef name="build-idl">
<attribute name="idlFiles"/>
<attribute name="idlBuildDir"/>
<attribute name="targetFlagFile"/>
<sequential>
<idlc
idlFiles="@{idlFiles}"
urdDir="@{idlBuildDir}/urd"/>
<regmerge
urdDir="@{idlBuildDir}/urd"
rdbFile="@{idlBuildDir}/registry.rdb"/>
<javamaker
rdbFile="@{idlBuildDir}/registry.rdb"
outputDir="@{idlBuildDir}/classes"
noDependentTypes="true"
excludes="${openoffice.home}/program/types.rdb"/>
<touch file="@{targetFlagFile}"/>
</sequential>
</macrodef>
<macrodef name="idlc">
<attribute name="idlFiles"/>
<attribute name="urdDir"/>
<sequential>
<mkdir dir="@{urdDir}"/>
<apply executable="${openoffice.home}/sdk/bin/idlc" failonerror="true">
<env key="PATH" value="${openoffice.home}/program"/>
<env key="LD_LIBRARY_PATH" value="${openoffice.home}/program"/>
<env key="DYLD_LIBRARY_PATH" value="${openoffice.home}/program"/>
<arg value="-I${openoffice.home}/sdk/idl"/>
<arg value="-O"/>
<arg value="@{urdDir}"/>
<arg value="-verbose"/>
<arg value="-cid"/>
<arg value="-we"/>
<fileset refid="@{idlFiles}"/>
</apply>
</sequential>
</macrodef>
<macrodef name="regmerge">
<attribute name="urdDir"/>
<attribute name="rdbFile"/>
<sequential>
<delete file="@{rdbFile}"/>
<apply executable="${openoffice.home}/program/regmerge" failonerror="true">
<env key="PATH" value="${openoffice.home}/program"/>
<env key="LD_LIBRARY_PATH" value="${openoffice.home}/program"/>
<env key="DYLD_LIBRARY_PATH" value="${openoffice.home}/program"/>
<arg value="@{rdbFile}"/>
<arg value="/UCR"/>
<fileset dir="@{urdDir}" includes="**/*.urd"/>
</apply>
</sequential>
</macrodef>
<macrodef name="javamaker">
<attribute name="rdbFile"/>
<attribute name="outputDir"/>
<attribute name="noDependentTypes" default="false"/>
<attribute name="excludes" default=""/>
<sequential>
<mkdir dir="@{outputDir}"/>
<exec executable="${openoffice.home}/sdk/bin/javamaker" failonerror="true">
<env key="PATH" value="${openoffice.home}/program"/>
<env key="LD_LIBRARY_PATH" value="${openoffice.home}/program"/>
<env key="DYLD_LIBRARY_PATH" value="${openoffice.home}/program"/>
<arg value="-O@{outputDir}"/>
<arg value="-BUCR"/>
<arg value="-nD"
if:true="@{noDependentTypes}"/>
<arg value="@{rdbFile}"/>
<arg value="-X@{excludes}"
unless:blank="@{excludes}"/>
</exec>
</sequential>
</macrodef>
</project>