[Libreoffice-commits] core.git: Branch 'aoo/trunk' - jurt/java ridljar/java solenv/ant

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Aug 29 18:09:43 UTC 2018


 ridljar/java/ridl/build.xml |    4 -
 solenv/ant/aoo-ant.xml      |   52 +++++++++++-----
 solenv/ant/idl.xml          |  143 +++++++++++++-------------------------------
 3 files changed, 84 insertions(+), 115 deletions(-)

New commits:
commit 063857bd52709009430d2c2a36d5b2dc80390769
Author:     Damjan Jovanovic <damjan at apache.org>
AuthorDate: Wed Aug 29 17:45:06 2018 +0000
Commit:     Damjan Jovanovic <damjan at apache.org>
CommitDate: Wed Aug 29 17:45:06 2018 +0000

    Automatically build .idl files found in src/main/idl and src/test/idl
    
    without having to specify them.
    
    Clean up the Ant build a little, removing the unused cppumaker
    functions I was experimenting with, and fully generalize IDL building
    so it doesn't use any Ant properties, only macrodefs.
    
    Patch by: me

diff --git a/jurt/java/jurt/src/test/java/com/sun/star/lib/uno/protocols/urp/interfaces.idl b/jurt/java/jurt/src/test/idl/com/sun/star/lib/uno/protocols/urp/interfaces.idl
similarity index 100%
rename from jurt/java/jurt/src/test/java/com/sun/star/lib/uno/protocols/urp/interfaces.idl
rename to jurt/java/jurt/src/test/idl/com/sun/star/lib/uno/protocols/urp/interfaces.idl
diff --git a/ridljar/java/ridl/build.xml b/ridljar/java/ridl/build.xml
index f4fcab15a901..b99799c34aae 100644
--- a/ridljar/java/ridl/build.xml
+++ b/ridljar/java/ridl/build.xml
@@ -44,8 +44,8 @@
     <target name="javamaker-udkapi" depends="check-javamaker-udkapi" extensionOf="pre-compile" unless="${javamaker.udkapi.skip}">
         <mkdir dir="${main.build.dir}"/>
         <javamaker
-            inputRdb="${OUTDIR}/bin/udkapi.rdb"
-            outputDirectory="${main.build.dir}"/>
+            rdbFile="${OUTDIR}/bin/udkapi.rdb"
+            outputDir="${main.build.dir}"/>
         <touch file="${javamaker.udkapi.flag}"/>
     </target>
 
diff --git a/solenv/ant/aoo-ant.xml b/solenv/ant/aoo-ant.xml
index 37ffb804e123..e47f2b52b1ed 100644
--- a/solenv/ant/aoo-ant.xml
+++ b/solenv/ant/aoo-ant.xml
@@ -35,11 +35,20 @@
     <property file="${aoo-ant.basedir}/../inc/minor.mk"/>
 
     <property name="build.base.dir" location="${WORKDIR}/Ant/${ant.project.name}"/>
+
     <property name="main.src.dir" location="src/main/java"/>
-    <property name="main.build.dir" location="${build.base.dir}/main"/>
+    <property name="idl.src.dir" location="src/main/idl"/>
     <property name="test.src.dir" location="src/test/java"/>
+    <property name="test-idl.src.dir" location="src/test/idl"/>
+
+    <property name="main.build.dir" location="${build.base.dir}/main"/>
+    <property name="idl.build.dir" location="${build.base.dir}/idl"/>
+    <property name="idl.build.classes.dir" location="${build.base.dir}/idl/classes"/>
     <property name="test.build.dir" location="${build.base.dir}/test"/>
+    <property name="test-idl.build.dir" location="${build.base.dir}/test-idl"/>
+    <property name="test-idl.classes.build.dir" location="${build.base.dir}/test-idl/classes"/>
     <property name="test.reports.dir" location="${build.base.dir}/test-reports"/>
+
     <property name="java.baseline.version" value="1.7"/>
     <property name="jar.dir" location="${WORKDIR}/Ant"/>
 
@@ -63,7 +72,10 @@
         <condition property="has.main.classpath">
             <isreference refid="main.classpath"/>
         </condition>
-        <path id="main.classpath" unless:set="has.main.classpath"/>
+        <path id="internal.main.classpath">
+            <path refid="main.classpath" if:set="has.main.classpath"/>
+            <pathelement location="${idl.classes.build.dir}"/>
+        </path>
 
         <local name="has.test.classpath"/>
         <condition property="has.test.classpath">
@@ -71,19 +83,14 @@
         </condition>
         <path id="internal.test.classpath">
             <pathelement location="${main.build.dir}"/>
+            <pathelement location="${idl.classes.build.dir}"/>
             <pathelement location="${test.build.dir}"/>
+            <pathelement location="${test-idl.classes.build.dir}"/>
             <path refid="main.classpath"/>
             <path refid="test.classpath" if:set="has.test.classpath"/>
-            <pathelement location="${idl.classes.build.dir}"/>
             <pathelement location="${OOO_JUNIT_JAR}"/>
             <pathelement location="${HAMCREST_CORE_JAR}" if:set="HAMCREST_CORE_JAR"/>
         </path>
-
-        <local name="has.idl.files"/>
-        <condition property="has.idl.files">
-            <isreference refid="idl.files"/>
-        </condition>
-        <filelist id="idl.files" unless:set="has.idl.files"/>
     </target>
 
     <target name="res" depends="prepare">
@@ -109,7 +116,14 @@
 
     <extension-point name="pre-compile" depends="prepare,res"/>
 
-    <target name="compile" depends="pre-compile">
+    <target name="idl" depends="pre-compile">
+        <fileset id="idl.files" dir="${idl.src.dir}" includes="**/*.idl" erroronmissingdir="false"/>
+        <idl-javamaker
+            idlFiles="idl.files"
+            idlBuildDir="${idl.build.dir}"/>
+    </target>
+
+    <target name="compile" depends="idl">
         <mkdir dir="${main.build.dir}"/>
         <javac srcdir="${main.src.dir}"
                destdir="${main.build.dir}"
@@ -118,7 +132,7 @@
                debug="${main.debug}"
                debuglevel="lines,vars,source"
                deprecation="${main.deprecation}"
-               classpathref="main.classpath"
+               classpathref="internal.main.classpath"
                includeantruntime="false"/>
     </target>
 
@@ -146,7 +160,14 @@
         </sequential>
     </macrodef>
 
-    <target name="test-compile" depends="compile,idl">
+    <target name="test-idl" depends="pre-compile">
+        <fileset id="test-idl.files" dir="${test-idl.src.dir}" includes="**/*.idl" erroronmissingdir="false"/>
+        <idl-javamaker
+            idlFiles="test-idl.files"
+            idlBuildDir="${test-idl.build.dir}"/>
+    </target>
+
+    <target name="test-compile" depends="compile,test-idl">
         <check-test/>
         <mkdir dir="${test.build.dir}" unless:set="test.skip"/>
         <javac srcdir="${test.src.dir}"
@@ -178,12 +199,15 @@
 
     <target name="jar" depends="compile" if="${jar.enabled}">
         <jar destfile="${jar.dir}/${jar.name}.jar"
-             basedir="${main.build.dir}"
-             manifest="${jar.manifest}">
+             manifest="${jar.manifest}"
+             duplicate="fail">
             <manifest>
                 <attribute name="Class-Path" value="${jar.classpath}" unless:blank="${jar.classpath}"/>
                 <attribute name="Solar-Version" value="${RSCREVISION}"/>
             </manifest>
+            <fileset dir="${main.build.dir}"/>
+<!-- Breaks trunk/test/smoketestdoc by packaging different classes with the same name: -->
+<!--            <fileset dir="${idl.build.classes.dir}" erroronmissingdir="false"/> -->
             <include name="**/*.class"/>
             <include name="**/*.properties"/>
             <include name="**/*.css"/>
diff --git a/solenv/ant/idl.xml b/solenv/ant/idl.xml
index 24174332d01c..f7bf0ac3a17d 100644
--- a/solenv/ant/idl.xml
+++ b/solenv/ant/idl.xml
@@ -28,160 +28,105 @@
     <!-- global properties -->
     <property file="${idl.basedir}/../../ant.properties"/>
 
-
-
-    <property name="idl.build.dir" location="${build.base.dir}/idl"/>
-    <property name="idl.urd.build.dir" location="${idl.build.dir}/urd"/>
-    <property name="idl.rdb.build.dir" location="${idl.build.dir}/rdb"/>
-    <property name="idl.classes.build.dir" location="${idl.build.dir}/classes"/>
-    <property name="idl.javamaker.flag" location="${idl.build.dir}/idl.javamaker.flag"/>
-
-    <target name="idl">
-        <check-idl/>
-        <build-idl unless:set="idl.uptodate"/>
-    </target>
-
-    <target name="unoprivateapi-cppumaker">
-        <property name="idl.cppumaker.flag" location="${unoprivateapi.outdir}/idl.cppumaker.flag"/>
-        <check-idl-cppumaker/>
-        <build-idl-cppumaker unless:set="idl.cppumaker.uptodate"/>
-    </target>
-
-    <macrodef name="check-idl">
+    <macrodef name="idl-javamaker">
+        <attribute name="idlFiles"/>
+        <attribute name="idlBuildDir"/>
         <sequential>
-            <local name="idl.files.exist"/>
-            <condition property="idl.files.exist">
-                <resourcecount refid="idl.files" when="greater" count="0"/>
+            <local name="idl.javamaker.flag"/>
+            <property name="idl.javamaker.flag" location="@{idlBuildDir}/idl.javamaker.flag"/>
+
+            <local name="idl.uptodate"/>
+            <condition property="idl.uptodate">
+                <resourcecount property="idl.uptodate" when="equal" count="0">
+                    <resources refid="@{idlFiles}"/>
+                </resourcecount>
             </condition>
 
-            <uptodate property="idl.uptodate" targetfile="${idl.javamaker.flag}" if:set="idl.files.exist">
-                <srcresources>
-                    <resources refid="idl.files"/>
-                </srcresources>
-            </uptodate>
-            <property name="idl.uptodate" value="true" unless:set="idl.files.exist"/>
-        </sequential>
-    </macrodef>
-
-    <macrodef name="check-idl-cppumaker">
-        <sequential>
-            <uptodate property="idl.cppumaker.uptodate" targetfile="${idl.cppumaker.flag}">
-                <srcresources>
-                    <file name="${unoprivateapi.idl}"/>
-                </srcresources>
+            <uptodate property="idl.uptodate" targetfile="${idl.javamaker.flag}" unless:set="idl.uptodate">
+                <srcfiles refid="@{idlFiles}"/>
             </uptodate>
+            <build-idl
+                idlFiles="@{idlFiles}"
+                idlBuildDir="@{idlBuildDir}"
+                targetFlagFile="${idl.javamaker.flag}"
+                unless:set="idl.uptodate"/>
         </sequential>
     </macrodef>
 
     <macrodef name="build-idl">
+        <attribute name="idlFiles"/>
+        <attribute name="idlBuildDir"/>
+        <attribute name="targetFlagFile"/>
         <sequential>
-            <idlc urdDirectory="${idl.urd.build.dir}">
-                <idlFiles>
-                    <resources refid="idl.files"/>
-                </idlFiles>
-            </idlc>
+            <idlc
+                idlFiles="@{idlFiles}"
+                urdDir="@{idlBuildDir}/urd"/>
             <regmerge
-                urdDirectory="${idl.urd.build.dir}"
-                rdbDirectory="${idl.rdb.build.dir}"/>
+                urdDir="@{idlBuildDir}/urd"
+                rdbFile="@{idlBuildDir}/registry.rdb"/>
             <javamaker
-                inputRdb="${idl.rdb.build.dir}/registry.rdb"
-                outputDirectory="${idl.classes.build.dir}"
+                rdbFile="@{idlBuildDir}/registry.rdb"
+                outputDir="@{idlBuildDir}/classes"
                 noDependentTypes="true"
                 excludes="${OUTDIR}/bin/types.rdb"/>
-            <touch file="${idl.javamaker.flag}"/>
-        </sequential>
-    </macrodef>
-
-    <macrodef name="build-idl-cppumaker">
-        <sequential>
-            <idlc urdDirectory="${unoprivateapi.outdir}/urd">
-                <idlFiles>
-                    <file name="${unoprivateapi.idl}"/>
-                </idlFiles>
-            </idlc>
-            <regmerge
-                urdDirectory="${unoprivateapi.outdir}/urd"
-                rdbDirectory="${unoprivateapi.outdir}/rdb"/>
-            <cppumaker
-                inputRdb="${unoprivateapi.outdir}/rdb/registry.rdb"
-                outputDirectory="${unoprivateapi.outdir}/inc"/>
-            <touch file="${idl.cppumaker.flag}"/>
+            <touch file="@{targetFlagFile}"/>
         </sequential>
     </macrodef>
 
     <macrodef name="idlc">
-        <element name="idlFiles"/>
-        <attribute name="urdDirectory"/>
+        <attribute name="idlFiles"/>
+        <attribute name="urdDir"/>
         <sequential>
-            <mkdir dir="@{urdDirectory}"/>
+            <mkdir dir="@{urdDir}"/>
             <apply executable="${OUTDIR}/bin/idlc" failonerror="true">
                 <env key="LD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
                 <env key="DYLD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
                 <arg value="-I${OUTDIR}/idl"/>
                 <arg value="-O"/>
-                <arg value="@{urdDirectory}"/>
+                <arg value="@{urdDir}"/>
                 <arg value="-verbose"/>
                 <arg value="-cid"/>
                 <arg value="-we"/>
-                <resources>
-                    <idlFiles/>
-                </resources>
+                <fileset refid="@{idlFiles}"/>
             </apply>
         </sequential>
     </macrodef>
 
     <macrodef name="regmerge">
-        <attribute name="urdDirectory"/>
-        <attribute name="rdbDirectory"/>
+        <attribute name="urdDir"/>
+        <attribute name="rdbFile"/>
         <sequential>
-            <mkdir dir="@{rdbDirectory}"/>
-            <delete file="@{rdbDirectory}/registry.rdb"/>
+            <delete file="@{rdbFile}"/>
             <apply executable="${OUTDIR}/bin/regmerge" failonerror="true">
                 <env key="LD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
                 <env key="DYLD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
-                <arg value="@{rdbDirectory}/registry.rdb"/>
+                <arg value="@{rdbFile}"/>
                 <arg value="/UCR"/>
-                <fileset dir="@{urdDirectory}" includes="**/*.urd"/>
+                <fileset dir="@{urdDir}" includes="**/*.urd"/>
             </apply>
         </sequential>
     </macrodef>
 
     <macrodef name="javamaker">
-        <attribute name="inputRdb"/>
-        <attribute name="outputDirectory"/>
+        <attribute name="rdbFile"/>
+        <attribute name="outputDir"/>
         <attribute name="noDependentTypes" default="false"/>
         <attribute name="excludes" default=""/>
         <sequential>
-            <mkdir dir="@{outputDirectory}"/>
+            <mkdir dir="@{outputDir}"/>
             <exec executable="${OUTDIR}/bin/javamaker" failonerror="true">
                 <env key="LD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
                 <env key="DYLD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
-                <arg value="-O@{outputDirectory}"/>
+                <arg value="-O@{outputDir}"/>
                 <arg value="-BUCR"/>
                 <arg value="-nD"
                     if:true="@{noDependentTypes}"/>
-                <arg value="@{inputRdb}"/>
+                <arg value="@{rdbFile}"/>
                 <arg value="-X@{excludes}"
                     unless:blank="@{excludes}"/>
             </exec>
         </sequential>
     </macrodef>
 
-    <macrodef name="cppumaker">
-        <attribute name="inputRdb"/>
-        <attribute name="outputDirectory"/>
-        <sequential>
-            <mkdir dir="@{outputDirectory}"/>
-            <exec executable="${OUTDIR}/bin/cppumaker" failonerror="true">
-                <env key="LD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
-                <env key="DYLD_LIBRARY_PATH" value="${OUTDIR}/lib"/>
-                <arg value="-O@{outputDirectory}"/>
-                <arg value="-BUCR"/>
-                <arg value="-C"/>
-                <arg value="@{inputRdb}"/>
-                <arg value="${OUTDIR}/bin/udkapi.rdb"/>
-            </exec>
-        </sequential>
-    </macrodef>
 </project>
 


More information about the Libreoffice-commits mailing list