openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1839593 - in /openoffice/trunk: main/jurt/java/jurt/src/test/idl/ main/jurt/java/jurt/src/test/idl/com/ main/jurt/java/jurt/src/test/idl/com/sun/ main/jurt/java/jurt/src/test/idl/com/sun/star/ main/jurt/java/jurt/src/test/idl/com/sun/star/...
Date Wed, 29 Aug 2018 17:45:07 GMT
Author: damjan
Date: Wed Aug 29 17:45:06 2018
New Revision: 1839593

URL: http://svn.apache.org/viewvc?rev=1839593&view=rev
Log:
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


Added:
    openoffice/trunk/main/jurt/java/jurt/src/test/idl/
    openoffice/trunk/main/jurt/java/jurt/src/test/idl/com/
    openoffice/trunk/main/jurt/java/jurt/src/test/idl/com/sun/
    openoffice/trunk/main/jurt/java/jurt/src/test/idl/com/sun/star/
    openoffice/trunk/main/jurt/java/jurt/src/test/idl/com/sun/star/lib/
    openoffice/trunk/main/jurt/java/jurt/src/test/idl/com/sun/star/lib/uno/
    openoffice/trunk/main/jurt/java/jurt/src/test/idl/com/sun/star/lib/uno/protocols/
    openoffice/trunk/main/jurt/java/jurt/src/test/idl/com/sun/star/lib/uno/protocols/urp/
    openoffice/trunk/main/jurt/java/jurt/src/test/idl/com/sun/star/lib/uno/protocols/urp/interfaces.idl
      - copied unchanged from r1839592, openoffice/trunk/main/jurt/java/jurt/src/test/java/com/sun/star/lib/uno/protocols/urp/interfaces.idl
    openoffice/trunk/test/smoketestdoc/src/main/idl/
    openoffice/trunk/test/smoketestdoc/src/main/idl/com/
    openoffice/trunk/test/smoketestdoc/src/main/idl/com/sun/
    openoffice/trunk/test/smoketestdoc/src/main/idl/com/sun/star/
    openoffice/trunk/test/smoketestdoc/src/main/idl/com/sun/star/comp/
    openoffice/trunk/test/smoketestdoc/src/main/idl/com/sun/star/comp/smoketest/
    openoffice/trunk/test/smoketestdoc/src/main/idl/com/sun/star/comp/smoketest/TestExtension.idl
      - copied unchanged from r1839592, openoffice/trunk/test/smoketestdoc/src/main/java/com/sun/star/comp/smoketest/TestExtension.idl
Removed:
    openoffice/trunk/main/jurt/java/jurt/src/test/java/com/sun/star/lib/uno/protocols/urp/interfaces.idl
    openoffice/trunk/test/smoketestdoc/src/main/java/com/sun/star/comp/smoketest/TestExtension.idl
Modified:
    openoffice/trunk/main/ridljar/java/ridl/build.xml
    openoffice/trunk/main/solenv/ant/aoo-ant.xml
    openoffice/trunk/main/solenv/ant/idl.xml
    openoffice/trunk/test/smoketestdoc/build.xml

Modified: openoffice/trunk/main/ridljar/java/ridl/build.xml
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/ridljar/java/ridl/build.xml?rev=1839593&r1=1839592&r2=1839593&view=diff
==============================================================================
--- openoffice/trunk/main/ridljar/java/ridl/build.xml (original)
+++ openoffice/trunk/main/ridljar/java/ridl/build.xml Wed Aug 29 17:45:06 2018
@@ -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>
 

Modified: openoffice/trunk/main/solenv/ant/aoo-ant.xml
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/ant/aoo-ant.xml?rev=1839593&r1=1839592&r2=1839593&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/ant/aoo-ant.xml (original)
+++ openoffice/trunk/main/solenv/ant/aoo-ant.xml Wed Aug 29 17:45:06 2018
@@ -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"/>

Modified: openoffice/trunk/main/solenv/ant/idl.xml
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/ant/idl.xml?rev=1839593&r1=1839592&r2=1839593&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/ant/idl.xml (original)
+++ openoffice/trunk/main/solenv/ant/idl.xml Wed Aug 29 17:45:06 2018
@@ -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">
-        <sequential>
-            <local name="idl.files.exist"/>
-            <condition property="idl.files.exist">
-                <resourcecount refid="idl.files" when="greater" count="0"/>
+    <macrodef name="idl-javamaker">
+        <attribute name="idlFiles"/>
+        <attribute name="idlBuildDir"/>
+        <sequential>
+            <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">
-        <sequential>
-            <idlc urdDirectory="${idl.urd.build.dir}">
-                <idlFiles>
-                    <resources refid="idl.files"/>
-                </idlFiles>
-            </idlc>
+        <attribute name="idlFiles"/>
+        <attribute name="idlBuildDir"/>
+        <attribute name="targetFlagFile"/>
+        <sequential>
+            <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>
 

Modified: openoffice/trunk/test/smoketestdoc/build.xml
URL: http://svn.apache.org/viewvc/openoffice/trunk/test/smoketestdoc/build.xml?rev=1839593&r1=1839592&r2=1839593&view=diff
==============================================================================
--- openoffice/trunk/test/smoketestdoc/build.xml (original)
+++ openoffice/trunk/test/smoketestdoc/build.xml Wed Aug 29 17:45:06 2018
@@ -41,10 +41,6 @@
             <pathelement location="${OUTDIR}/bin/ridl.jar"/>
             <pathelement location="${OUTDIR}/bin/unoil.jar"/>
         </path>
-
-        <filelist id="idl.files">
-            <file name="${main.src.dir}/com/sun/star/comp/smoketest/TestExtension.idl"/>
-        </filelist>
     </target>
 
     <target name="pre-clean">
@@ -90,7 +86,7 @@
     </target>
 
     <target name="TestExtension" depends="main,smoketestdoc">
-        <copy tofile="${build.base.dir}/TestExtension/TestExtension.rdb" file="${idl.rdb.build.dir}/registry.rdb"/>
+        <copy tofile="${build.base.dir}/TestExtension/TestExtension.rdb" file="${idl.build.dir}/registry.rdb"/>
         <mkdir dir="${build.base.dir}/TestExtension/META-INF"/>
         <copy todir="${build.base.dir}/TestExtension/META-INF" file="${project.dir}/manifest.xml"/>
         <zip destfile="${build.base.dir}/TestExtension.oxt" basedir="${build.base.dir}/TestExtension"/>



Mime
View raw message