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 3141f03cd9SDamjan Jovanovic 3241f03cd9SDamjan Jovanovic 3341f03cd9SDamjan Jovanovic <property name="idl.build.dir" location="${build.base.dir}/idl"/> 3441f03cd9SDamjan Jovanovic <property name="idl.urd.build.dir" location="${idl.build.dir}/urd"/> 3541f03cd9SDamjan Jovanovic <property name="idl.rdb.build.dir" location="${idl.build.dir}/rdb"/> 3641f03cd9SDamjan Jovanovic <property name="idl.classes.build.dir" location="${idl.build.dir}/classes"/> 3741f03cd9SDamjan Jovanovic <property name="idl.javamaker.flag" location="${idl.build.dir}/idl.javamaker.flag"/> 3841f03cd9SDamjan Jovanovic 3941f03cd9SDamjan Jovanovic <target name="idl" depends="idl-check,idl-javamaker"/> 4041f03cd9SDamjan Jovanovic 4141f03cd9SDamjan Jovanovic <target name="idl-check"> 4241f03cd9SDamjan Jovanovic <local name="idl.files.exist"/> 4341f03cd9SDamjan Jovanovic <condition property="idl.files.exist"> 4441f03cd9SDamjan Jovanovic <resourcecount refid="idl.files" when="greater" count="0"/> 4541f03cd9SDamjan Jovanovic </condition> 4641f03cd9SDamjan Jovanovic 4741f03cd9SDamjan Jovanovic <local name="idl.files.union"/> 4841f03cd9SDamjan Jovanovic <union id="idl.files.union" if:set="idl.files.exist"> 4941f03cd9SDamjan Jovanovic <filelist refid="idl.files"/> 5041f03cd9SDamjan Jovanovic </union> 5141f03cd9SDamjan Jovanovic <uptodate property="idl.uptodate" targetfile="${idl.javamaker.flag}" if:set="idl.files.exist"> 5241f03cd9SDamjan Jovanovic <srcresources refid="idl.files.union"/> 5341f03cd9SDamjan Jovanovic </uptodate> 5441f03cd9SDamjan Jovanovic <property name="idl.uptodate" value="true" unless:set="idl.files.exist"/> 5541f03cd9SDamjan Jovanovic </target> 5641f03cd9SDamjan Jovanovic 57*bee6bcb9SDamjan Jovanovic <macrodef name="javamaker"> 58*bee6bcb9SDamjan Jovanovic <attribute name="input-rdb"/> 59*bee6bcb9SDamjan Jovanovic <attribute name="output-directory"/> 60*bee6bcb9SDamjan Jovanovic <attribute name="no-dependent-types" default="false"/> 61*bee6bcb9SDamjan Jovanovic <attribute name="excludes" default=""/> 62*bee6bcb9SDamjan Jovanovic <sequential> 63*bee6bcb9SDamjan Jovanovic <mkdir dir="@{output-directory}"/> 64*bee6bcb9SDamjan Jovanovic <exec executable="${OUTDIR}/bin/javamaker" failonerror="true"> 65*bee6bcb9SDamjan Jovanovic <env key="LD_LIBRARY_PATH" value="${OUTDIR}/lib"/> 66*bee6bcb9SDamjan Jovanovic <env key="DYLD_LIBRARY_PATH" value="${OUTDIR}/lib"/> 67*bee6bcb9SDamjan Jovanovic <arg value="-O@{output-directory}"/> 68*bee6bcb9SDamjan Jovanovic <arg value="-BUCR"/> 69*bee6bcb9SDamjan Jovanovic <arg value="-nD" 70*bee6bcb9SDamjan Jovanovic if:true="@{no-dependent-types}"/> 71*bee6bcb9SDamjan Jovanovic <arg value="@{input-rdb}"/> 72*bee6bcb9SDamjan Jovanovic <arg value="-X@{excludes}" 73*bee6bcb9SDamjan Jovanovic unless:blank="@{excludes}"/> 74*bee6bcb9SDamjan Jovanovic </exec> 75*bee6bcb9SDamjan Jovanovic </sequential> 76*bee6bcb9SDamjan Jovanovic </macrodef> 77*bee6bcb9SDamjan Jovanovic 7841f03cd9SDamjan Jovanovic <target name="idl-javamaker" depends="idl-regmerge" unless="idl.uptodate"> 7941f03cd9SDamjan Jovanovic <mkdir dir="${idl.classes.build.dir}"/> 80*bee6bcb9SDamjan Jovanovic <javamaker 81*bee6bcb9SDamjan Jovanovic input-rdb="${idl.rdb.build.dir}/registry.rdb" 82*bee6bcb9SDamjan Jovanovic output-directory="${idl.classes.build.dir}" 83*bee6bcb9SDamjan Jovanovic no-dependent-types="true" 84*bee6bcb9SDamjan Jovanovic excludes="${OUTDIR}/bin/types.rdb"/> 8541f03cd9SDamjan Jovanovic <touch file="${idl.javamaker.flag}"/> 8641f03cd9SDamjan Jovanovic </target> 8741f03cd9SDamjan Jovanovic 8841f03cd9SDamjan Jovanovic <target name="idl-regmerge" depends="idl-idlc" unless="idl.uptodate"> 8941f03cd9SDamjan Jovanovic <mkdir dir="${idl.rdb.build.dir}"/> 9041f03cd9SDamjan Jovanovic <delete file="${idl.rdb.build.dir}/registry.rdb"/> 9141f03cd9SDamjan Jovanovic <apply executable="${OUTDIR}/bin/regmerge" failonerror="true"> 9241f03cd9SDamjan Jovanovic <env key="LD_LIBRARY_PATH" value="${OUTDIR}/lib"/> 9341f03cd9SDamjan Jovanovic <env key="DYLD_LIBRARY_PATH" value="${OUTDIR}/lib"/> 9441f03cd9SDamjan Jovanovic <arg value="${idl.rdb.build.dir}/registry.rdb"/> 9541f03cd9SDamjan Jovanovic <arg value="/UCR"/> 9641f03cd9SDamjan Jovanovic <fileset dir="${idl.urd.build.dir}" includes="**/*.urd"/> 9741f03cd9SDamjan Jovanovic </apply> 9841f03cd9SDamjan Jovanovic </target> 9941f03cd9SDamjan Jovanovic 10041f03cd9SDamjan Jovanovic <target name="idl-idlc" unless="idl.uptodate"> 10141f03cd9SDamjan Jovanovic <mkdir dir="${idl.urd.build.dir}"/> 10241f03cd9SDamjan Jovanovic <apply executable="${OUTDIR}/bin/idlc" failonerror="true"> 10341f03cd9SDamjan Jovanovic <env key="LD_LIBRARY_PATH" value="${OUTDIR}/lib"/> 10441f03cd9SDamjan Jovanovic <env key="DYLD_LIBRARY_PATH" value="${OUTDIR}/lib"/> 10541f03cd9SDamjan Jovanovic <arg value="-I${OUTDIR}/idl"/> 10641f03cd9SDamjan Jovanovic <arg value="-O"/> 10741f03cd9SDamjan Jovanovic <arg value="${idl.urd.build.dir}"/> 10841f03cd9SDamjan Jovanovic <arg value="-verbose"/> 10941f03cd9SDamjan Jovanovic <arg value="-cid"/> 11041f03cd9SDamjan Jovanovic <arg value="-we"/> 11141f03cd9SDamjan Jovanovic <filelist refid="idl.files"/> 11241f03cd9SDamjan Jovanovic </apply> 11341f03cd9SDamjan Jovanovic </target> 11441f03cd9SDamjan Jovanovic 11541f03cd9SDamjan Jovanovic</project> 11641f03cd9SDamjan Jovanovic 117