xref: /aoo42x/main/solenv/ant/idl.xml (revision 4aa87146)
141f03cd9SDamjan Jovanovic<?xml version="1.0" encoding="UTF-8"?>
241f03cd9SDamjan Jovanovic<!--***********************************************************
341f03cd9SDamjan Jovanovic *
441f03cd9SDamjan Jovanovic * Licensed to the Apache Software Foundation (ASF) under one
541f03cd9SDamjan Jovanovic * or more contributor license agreements.  See the NOTICE file
641f03cd9SDamjan Jovanovic * distributed with this work for additional information
741f03cd9SDamjan Jovanovic * regarding copyright ownership.  The ASF licenses this file
841f03cd9SDamjan Jovanovic * to you under the Apache License, Version 2.0 (the
941f03cd9SDamjan Jovanovic * "License"); you may not use this file except in compliance
1041f03cd9SDamjan Jovanovic * with the License.  You may obtain a copy of the License at
1141f03cd9SDamjan Jovanovic *
1241f03cd9SDamjan Jovanovic *   http://www.apache.org/licenses/LICENSE-2.0
1341f03cd9SDamjan Jovanovic *
1441f03cd9SDamjan Jovanovic * Unless required by applicable law or agreed to in writing,
1541f03cd9SDamjan Jovanovic * software distributed under the License is distributed on an
1641f03cd9SDamjan Jovanovic * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1741f03cd9SDamjan Jovanovic * KIND, either express or implied.  See the License for the
1841f03cd9SDamjan Jovanovic * specific language governing permissions and limitations
1941f03cd9SDamjan Jovanovic * under the License.
2041f03cd9SDamjan Jovanovic *
2141f03cd9SDamjan Jovanovic ***********************************************************-->
2241f03cd9SDamjan Jovanovic
2341f03cd9SDamjan Jovanovic
2441f03cd9SDamjan Jovanovic<project name="idl" xmlns:if="ant:if" xmlns:unless="ant:unless">
2541f03cd9SDamjan Jovanovic
2641f03cd9SDamjan Jovanovic    <dirname property="idl.basedir" file="${ant.file.idl}"/>
2741f03cd9SDamjan Jovanovic
2841f03cd9SDamjan Jovanovic    <!-- global properties -->
2941f03cd9SDamjan Jovanovic    <property file="${idl.basedir}/../../ant.properties"/>
3041f03cd9SDamjan Jovanovic
31*4aa87146SDamjan Jovanovic    <macrodef name="idl-javamaker">
32*4aa87146SDamjan Jovanovic        <attribute name="idlFiles"/>
33*4aa87146SDamjan Jovanovic        <attribute name="idlBuildDir"/>
34a622bb93SDamjan Jovanovic        <sequential>
35*4aa87146SDamjan Jovanovic            <local name="idl.javamaker.flag"/>
36*4aa87146SDamjan Jovanovic            <property name="idl.javamaker.flag" location="@{idlBuildDir}/idl.javamaker.flag"/>
37*4aa87146SDamjan Jovanovic
38*4aa87146SDamjan Jovanovic            <local name="idl.uptodate"/>
39*4aa87146SDamjan Jovanovic            <condition property="idl.uptodate">
40*4aa87146SDamjan Jovanovic                <resourcecount property="idl.uptodate" when="equal" count="0">
41*4aa87146SDamjan Jovanovic                    <resources refid="@{idlFiles}"/>
42*4aa87146SDamjan Jovanovic                </resourcecount>
43a622bb93SDamjan Jovanovic            </condition>
44a622bb93SDamjan Jovanovic
45*4aa87146SDamjan Jovanovic            <uptodate property="idl.uptodate" targetfile="${idl.javamaker.flag}" unless:set="idl.uptodate">
46*4aa87146SDamjan Jovanovic                <srcfiles refid="@{idlFiles}"/>
478f71f2daSDamjan Jovanovic            </uptodate>
48*4aa87146SDamjan Jovanovic            <build-idl
49*4aa87146SDamjan Jovanovic                idlFiles="@{idlFiles}"
50*4aa87146SDamjan Jovanovic                idlBuildDir="@{idlBuildDir}"
51*4aa87146SDamjan Jovanovic                targetFlagFile="${idl.javamaker.flag}"
52*4aa87146SDamjan Jovanovic                unless:set="idl.uptodate"/>
538f71f2daSDamjan Jovanovic        </sequential>
548f71f2daSDamjan Jovanovic    </macrodef>
558f71f2daSDamjan Jovanovic
56a622bb93SDamjan Jovanovic    <macrodef name="build-idl">
57*4aa87146SDamjan Jovanovic        <attribute name="idlFiles"/>
58*4aa87146SDamjan Jovanovic        <attribute name="idlBuildDir"/>
59*4aa87146SDamjan Jovanovic        <attribute name="targetFlagFile"/>
60a622bb93SDamjan Jovanovic        <sequential>
61*4aa87146SDamjan Jovanovic            <idlc
62*4aa87146SDamjan Jovanovic                idlFiles="@{idlFiles}"
63*4aa87146SDamjan Jovanovic                urdDir="@{idlBuildDir}/urd"/>
648f71f2daSDamjan Jovanovic            <regmerge
65*4aa87146SDamjan Jovanovic                urdDir="@{idlBuildDir}/urd"
66*4aa87146SDamjan Jovanovic                rdbFile="@{idlBuildDir}/registry.rdb"/>
67a622bb93SDamjan Jovanovic            <javamaker
68*4aa87146SDamjan Jovanovic                rdbFile="@{idlBuildDir}/registry.rdb"
69*4aa87146SDamjan Jovanovic                outputDir="@{idlBuildDir}/classes"
70a622bb93SDamjan Jovanovic                noDependentTypes="true"
71a622bb93SDamjan Jovanovic                excludes="${OUTDIR}/bin/types.rdb"/>
72*4aa87146SDamjan Jovanovic            <touch file="@{targetFlagFile}"/>
738f71f2daSDamjan Jovanovic        </sequential>
748f71f2daSDamjan Jovanovic    </macrodef>
758f71f2daSDamjan Jovanovic
76a622bb93SDamjan Jovanovic    <macrodef name="idlc">
77*4aa87146SDamjan Jovanovic        <attribute name="idlFiles"/>
78*4aa87146SDamjan Jovanovic        <attribute name="urdDir"/>
79a622bb93SDamjan Jovanovic        <sequential>
80*4aa87146SDamjan Jovanovic            <mkdir dir="@{urdDir}"/>
81a622bb93SDamjan Jovanovic            <apply executable="${OUTDIR}/bin/idlc" failonerror="true">
82a622bb93SDamjan Jovanovic                <env key="LD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
83a622bb93SDamjan Jovanovic                <env key="DYLD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
84a622bb93SDamjan Jovanovic                <arg value="-I${OUTDIR}/idl"/>
85a622bb93SDamjan Jovanovic                <arg value="-O"/>
86*4aa87146SDamjan Jovanovic                <arg value="@{urdDir}"/>
87a622bb93SDamjan Jovanovic                <arg value="-verbose"/>
88a622bb93SDamjan Jovanovic                <arg value="-cid"/>
89a622bb93SDamjan Jovanovic                <arg value="-we"/>
90*4aa87146SDamjan Jovanovic                <fileset refid="@{idlFiles}"/>
91a622bb93SDamjan Jovanovic            </apply>
92a622bb93SDamjan Jovanovic        </sequential>
93a622bb93SDamjan Jovanovic    </macrodef>
94a622bb93SDamjan Jovanovic
95a622bb93SDamjan Jovanovic    <macrodef name="regmerge">
96*4aa87146SDamjan Jovanovic        <attribute name="urdDir"/>
97*4aa87146SDamjan Jovanovic        <attribute name="rdbFile"/>
98a622bb93SDamjan Jovanovic        <sequential>
99*4aa87146SDamjan Jovanovic            <delete file="@{rdbFile}"/>
100a622bb93SDamjan Jovanovic            <apply executable="${OUTDIR}/bin/regmerge" failonerror="true">
101a622bb93SDamjan Jovanovic                <env key="LD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
102a622bb93SDamjan Jovanovic                <env key="DYLD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
103*4aa87146SDamjan Jovanovic                <arg value="@{rdbFile}"/>
104a622bb93SDamjan Jovanovic                <arg value="/UCR"/>
105*4aa87146SDamjan Jovanovic                <fileset dir="@{urdDir}" includes="**/*.urd"/>
106a622bb93SDamjan Jovanovic            </apply>
107a622bb93SDamjan Jovanovic        </sequential>
108a622bb93SDamjan Jovanovic    </macrodef>
10941f03cd9SDamjan Jovanovic
110bee6bcb9SDamjan Jovanovic    <macrodef name="javamaker">
111*4aa87146SDamjan Jovanovic        <attribute name="rdbFile"/>
112*4aa87146SDamjan Jovanovic        <attribute name="outputDir"/>
113a622bb93SDamjan Jovanovic        <attribute name="noDependentTypes" default="false"/>
114bee6bcb9SDamjan Jovanovic        <attribute name="excludes" default=""/>
115bee6bcb9SDamjan Jovanovic        <sequential>
116*4aa87146SDamjan Jovanovic            <mkdir dir="@{outputDir}"/>
117bee6bcb9SDamjan Jovanovic            <exec executable="${OUTDIR}/bin/javamaker" failonerror="true">
118bee6bcb9SDamjan Jovanovic                <env key="LD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
119bee6bcb9SDamjan Jovanovic                <env key="DYLD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
120*4aa87146SDamjan Jovanovic                <arg value="-O@{outputDir}"/>
121bee6bcb9SDamjan Jovanovic                <arg value="-BUCR"/>
122bee6bcb9SDamjan Jovanovic                <arg value="-nD"
123a622bb93SDamjan Jovanovic                    if:true="@{noDependentTypes}"/>
124*4aa87146SDamjan Jovanovic                <arg value="@{rdbFile}"/>
125bee6bcb9SDamjan Jovanovic                <arg value="-X@{excludes}"
126bee6bcb9SDamjan Jovanovic                    unless:blank="@{excludes}"/>
127bee6bcb9SDamjan Jovanovic            </exec>
128bee6bcb9SDamjan Jovanovic        </sequential>
129bee6bcb9SDamjan Jovanovic    </macrodef>
1308f71f2daSDamjan Jovanovic
13141f03cd9SDamjan Jovanovic</project>
13241f03cd9SDamjan Jovanovic
133