xref: /trunk/test/smoketestdoc/idl.xml (revision f420f949)
1<?xml version="1.0" encoding="UTF-8"?>
2<!--***********************************************************
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements.  See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership.  The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License.  You may obtain a copy of the License at
11 *
12 *   http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied.  See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 *
21 ***********************************************************-->
22
23
24<project name="idl" xmlns:if="ant:if" xmlns:unless="ant:unless">
25
26    <dirname property="idl.basedir" file="${ant.file.idl}"/>
27
28    <macrodef name="idl-javamaker">
29        <attribute name="idlFiles"/>
30        <attribute name="idlBuildDir"/>
31        <sequential>
32            <local name="idl.javamaker.flag"/>
33            <property name="idl.javamaker.flag" location="@{idlBuildDir}/idl.javamaker.flag"/>
34
35            <local name="idl.uptodate"/>
36            <condition property="idl.uptodate">
37                <resourcecount property="idl.uptodate" when="equal" count="0">
38                    <resources refid="@{idlFiles}"/>
39                </resourcecount>
40            </condition>
41
42            <uptodate property="idl.uptodate" targetfile="${idl.javamaker.flag}" unless:set="idl.uptodate">
43                <srcfiles refid="@{idlFiles}"/>
44            </uptodate>
45            <build-idl
46                idlFiles="@{idlFiles}"
47                idlBuildDir="@{idlBuildDir}"
48                targetFlagFile="${idl.javamaker.flag}"
49                unless:set="idl.uptodate"/>
50        </sequential>
51    </macrodef>
52
53    <macrodef name="build-idl">
54        <attribute name="idlFiles"/>
55        <attribute name="idlBuildDir"/>
56        <attribute name="targetFlagFile"/>
57        <sequential>
58            <idlc
59                idlFiles="@{idlFiles}"
60                urdDir="@{idlBuildDir}/urd"/>
61            <regmerge
62                urdDir="@{idlBuildDir}/urd"
63                rdbFile="@{idlBuildDir}/registry.rdb"/>
64            <javamaker
65                rdbFile="@{idlBuildDir}/registry.rdb"
66                outputDir="@{idlBuildDir}/classes"
67                noDependentTypes="true"
68                excludes="${openoffice.home}/program/types.rdb"/>
69            <touch file="@{targetFlagFile}"/>
70        </sequential>
71    </macrodef>
72
73    <macrodef name="idlc">
74        <attribute name="idlFiles"/>
75        <attribute name="urdDir"/>
76        <sequential>
77            <mkdir dir="@{urdDir}"/>
78            <apply executable="${openoffice.home}/sdk/bin/idlc" failonerror="true">
79                <env key="PATH" value="${openoffice.home}/program"/>
80                <env key="LD_LIBRARY_PATH" value="${openoffice.home}/program"/>
81                <env key="DYLD_LIBRARY_PATH" value="${openoffice.home}/program"/>
82                <arg value="-I${openoffice.home}/sdk/idl"/>
83                <arg value="-O"/>
84                <arg value="@{urdDir}"/>
85                <arg value="-verbose"/>
86                <arg value="-cid"/>
87                <arg value="-we"/>
88                <fileset refid="@{idlFiles}"/>
89            </apply>
90        </sequential>
91    </macrodef>
92
93    <macrodef name="regmerge">
94        <attribute name="urdDir"/>
95        <attribute name="rdbFile"/>
96        <sequential>
97            <delete file="@{rdbFile}"/>
98            <apply executable="${openoffice.home}/program/regmerge" failonerror="true">
99                <env key="PATH" value="${openoffice.home}/program"/>
100                <env key="LD_LIBRARY_PATH" value="${openoffice.home}/program"/>
101                <env key="DYLD_LIBRARY_PATH" value="${openoffice.home}/program"/>
102                <arg value="@{rdbFile}"/>
103                <arg value="/UCR"/>
104                <fileset dir="@{urdDir}" includes="**/*.urd"/>
105            </apply>
106        </sequential>
107    </macrodef>
108
109    <macrodef name="javamaker">
110        <attribute name="rdbFile"/>
111        <attribute name="outputDir"/>
112        <attribute name="noDependentTypes" default="false"/>
113        <attribute name="excludes" default=""/>
114        <sequential>
115            <mkdir dir="@{outputDir}"/>
116            <exec executable="${openoffice.home}/sdk/bin/javamaker" failonerror="true">
117                <env key="PATH" value="${openoffice.home}/program"/>
118                <env key="LD_LIBRARY_PATH" value="${openoffice.home}/program"/>
119                <env key="DYLD_LIBRARY_PATH" value="${openoffice.home}/program"/>
120                <arg value="-O@{outputDir}"/>
121                <arg value="-BUCR"/>
122                <arg value="-nD"
123                    if:true="@{noDependentTypes}"/>
124                <arg value="@{rdbFile}"/>
125                <arg value="-X@{excludes}"
126                    unless:blank="@{excludes}"/>
127            </exec>
128        </sequential>
129    </macrodef>
130
131</project>
132
133