xref: /trunk/main/solenv/ant/idl.xml (revision 41f03cd9)
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    <!-- global properties -->
29    <property file="${idl.basedir}/../../ant.properties"/>
30
31
32
33    <property name="idl.build.dir" location="${build.base.dir}/idl"/>
34    <property name="idl.urd.build.dir" location="${idl.build.dir}/urd"/>
35    <property name="idl.rdb.build.dir" location="${idl.build.dir}/rdb"/>
36    <property name="idl.classes.build.dir" location="${idl.build.dir}/classes"/>
37    <property name="idl.javamaker.flag" location="${idl.build.dir}/idl.javamaker.flag"/>
38
39    <target name="idl" depends="idl-check,idl-javamaker"/>
40
41    <target name="idl-check">
42        <local name="idl.files.exist"/>
43        <condition property="idl.files.exist">
44            <resourcecount refid="idl.files" when="greater" count="0"/>
45        </condition>
46
47        <local name="idl.files.union"/>
48        <union id="idl.files.union" if:set="idl.files.exist">
49            <filelist refid="idl.files"/>
50        </union>
51        <uptodate property="idl.uptodate" targetfile="${idl.javamaker.flag}" if:set="idl.files.exist">
52            <srcresources refid="idl.files.union"/>
53        </uptodate>
54        <property name="idl.uptodate" value="true" unless:set="idl.files.exist"/>
55    </target>
56
57    <target name="idl-javamaker" depends="idl-regmerge" unless="idl.uptodate">
58        <mkdir dir="${idl.classes.build.dir}"/>
59        <exec executable="${OUTDIR}/bin/javamaker" failonerror="true">
60            <env key="LD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
61            <env key="DYLD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
62            <arg value="-O${idl.classes.build.dir}"/>
63            <arg value="-BUCR"/>
64            <arg value="-nD"/>
65            <arg value="${idl.rdb.build.dir}/registry.rdb"/>
66            <arg value="-X${OUTDIR}/bin/types.rdb"/>
67        </exec>
68        <touch file="${idl.javamaker.flag}"/>
69    </target>
70
71    <target name="idl-regmerge" depends="idl-idlc" unless="idl.uptodate">
72        <mkdir dir="${idl.rdb.build.dir}"/>
73        <delete file="${idl.rdb.build.dir}/registry.rdb"/>
74        <apply executable="${OUTDIR}/bin/regmerge" failonerror="true">
75            <env key="LD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
76            <env key="DYLD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
77            <arg value="${idl.rdb.build.dir}/registry.rdb"/>
78            <arg value="/UCR"/>
79            <fileset dir="${idl.urd.build.dir}" includes="**/*.urd"/>
80        </apply>
81    </target>
82
83    <target name="idl-idlc" unless="idl.uptodate">
84        <mkdir dir="${idl.urd.build.dir}"/>
85        <apply executable="${OUTDIR}/bin/idlc" failonerror="true">
86            <env key="LD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
87            <env key="DYLD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
88            <arg value="-I${OUTDIR}/idl"/>
89            <arg value="-O"/>
90            <arg value="${idl.urd.build.dir}"/>
91            <arg value="-verbose"/>
92            <arg value="-cid"/>
93            <arg value="-we"/>
94            <filelist refid="idl.files"/>
95        </apply>
96    </target>
97
98</project>
99
100