Hi,

We use IDLJ via "exec". First we define a prop like this:

#
# CORBA IDL to Java compiler.
#
idlj.executable = ${java.home}/../bin/idlj

And then invoke like this:

    <target name="idl"
            depends="init, checkIdlBuildRequired"
            unless="idlBuild.notRequired"
            description="compile all IDL sources to Java source files">
        <mkdir dir="skel"/>
        <apply executable="${idlj.executable}" failonerror="true">
            <arg line="-verbose " /> <!-- Neccessary because of bug in
Windows version -->
            <arg line="-fall " />
            <arg line="-td ${skel} " />
            <arg line="-i ${idl.dir} " />
            <arg line="-pkgPrefix Common ${idl.package.prefix} " />
            <arg line="-pkgPrefix Control ${idl.package.prefix} " />
            <arg line="-pkgPrefix DataManagement ${idl.package.prefix} " />
            <arg line="-pkgPrefix GA ${idl.package.prefix} " />
            <arg line="-pkgPrefix OutcomeInferencing ${idl.package.prefix} "
/>
            <arg line="-pkgPrefix Project ${idl.package.prefix} " />
            <arg line="-pkgPrefix ProjectManagement ${idl.package.prefix} "
/>
            <arg line="-pkgPrefix StatisticManagement ${idl.package.prefix}
" />
            <arg line="-pkgPrefix TransformationManagement
${idl.package.prefix} " />

            <fileset dir="idl">
                <include name="**/*.idl" />
            </fileset>
        </apply>
        <touch file="${idl.dir}/.skelgenerated" />
    </target>

    <target name="checkIdlBuildRequired"
            depends="init">
        <uptodate property="idlBuild.notRequired"
                  targetfile="${idl.dir}/.skelgenerated" >
            <srcfiles dir= "${idl.dir}" includes="**/*.idl"/>
        </uptodate>
    </target>

Hope this helps.

-Otto Perdeck


----- Original Message -----
From: "Greg Callaghan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 13, 2002 12:38 AM
Subject: How to incorporate "idlj" in my ANT xml ???


> Hi,
>
> We're starting up with ANT here.  Part of the build process is to -:
>
> (1) create TEMP directory (will be deleted with CLEAN)
> (2) compile IDL from IDL to TEMP/SRC (using "idlj")
> (3) copy other source from SRC to TEMP/SRC
> (4) compile all source in TEMP to BUILD
>
> We of course we like to make the process cover not performing step 2
unless
> idl files have changed, ideally on a per IDL file basis.
>
> Q1 - Does anyone know of a custom task for "idlj" that may be just
>      around the corner?
>
> Q2 - If the answer to Q1 is no, what is the suggested ANT method of
>      implementing this?
>
> Q3 - I do have an approach (see XML below) which works in terms
>      of only recompiling IDL if one of the IDL files is updated
>      HOWEVER the problem is after a CLEAN the "idlcheck" target
>      doesn't work properly as there isn't the target area to check
>      for the <uptodate> tag.
>      Any suggestions in terms of how to incorporate condition
>      logic here to address this?
>
>
>   <!-- -------------------------------------- -->
>   <target name="idlcheck" >
>     <uptodate property="idl.required"
>                  targetfile="${dir.idl}/xxxx.idl">
>       <srcfiles dir="${temp.home}/src/xxx/yyy"/>
>     </uptodate>
>   </target>
>   <!-- -------------------------------------- -->
>   <target name="idl" depends="prepare" description="Compile IDL">
>       PUT IDL COMPILE USING EXEC HERE.EG.
>       <exec executable="idlj" failonerror="true" >
>         <arg value="-pkgPrefix"/>
>         <arg value="XMLError"/>
>         <arg value="xxx/yyy/zzz"/>
> <arg value="-i"/>
> <arg value="${dir.idl}"/>
> <arg value="-td"/>
> <arg value="${dir.idl.generated}"/>
> <arg value="-fclient"/>
> <arg value="${dir.idl}/xxxx.idl"/>
>     </exec>
>   </target>
>   <!-- -------------------------------------- -->
>   <target name="compile" depends="prepare, idl"
>    description="Compile Java sources">
>       PUT COMPILE LINES HERE
>
>   </target>
>   <!-- -------------------------------------- -->
>
>
> Regards
> Greg
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp.
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to