xref: /trunk/test/smoketestdoc/idl.xml (revision 6ad462b0)
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="LD_LIBRARY_PATH" value="${openoffice.home}/program"/>
80                <env key="DYLD_LIBRARY_PATH" value="${openoffice.home}/program"/>
81                <arg value="-I${openoffice.home}/sdk/idl"/>
82                <arg value="-O"/>
83                <arg value="@{urdDir}"/>
84                <arg value="-verbose"/>
85                <arg value="-cid"/>
86                <arg value="-we"/>
87                <fileset refid="@{idlFiles}"/>
88            </apply>
89        </sequential>
90    </macrodef>
91
92    <macrodef name="regmerge">
93        <attribute name="urdDir"/>
94        <attribute name="rdbFile"/>
95        <sequential>
96            <delete file="@{rdbFile}"/>
97            <apply executable="${openoffice.home}/program/regmerge" failonerror="true">
98                <env key="LD_LIBRARY_PATH" value="${openoffice.home}/program"/>
99                <env key="DYLD_LIBRARY_PATH" value="${openoffice.home}/program"/>
100                <arg value="@{rdbFile}"/>
101                <arg value="/UCR"/>
102                <fileset dir="@{urdDir}" includes="**/*.urd"/>
103            </apply>
104        </sequential>
105    </macrodef>
106
107    <macrodef name="javamaker">
108        <attribute name="rdbFile"/>
109        <attribute name="outputDir"/>
110        <attribute name="noDependentTypes" default="false"/>
111        <attribute name="excludes" default=""/>
112        <sequential>
113            <mkdir dir="@{outputDir}"/>
114            <exec executable="${openoffice.home}/sdk/bin/javamaker" failonerror="true">
115                <env key="LD_LIBRARY_PATH" value="${openoffice.home}/program"/>
116                <env key="DYLD_LIBRARY_PATH" value="${openoffice.home}/program"/>
117                <arg value="-O@{outputDir}"/>
118                <arg value="-BUCR"/>
119                <arg value="-nD"
120                    if:true="@{noDependentTypes}"/>
121                <arg value="@{rdbFile}"/>
122                <arg value="-X@{excludes}"
123                    unless:blank="@{excludes}"/>
124            </exec>
125        </sequential>
126    </macrodef>
127
128</project>
129
130