Author: damjan
Date: Wed Aug  9 17:43:42 2017
New Revision: 1804591

URL: http://svn.apache.org/viewvc?rev=1804591&view=rev
Log:
Write a main/ant.properties file from main/set_soenv, which can be used in
Ant projects to work out settings, locations, and paths to dependencies
without getting them from a parent build tool (dmake/gbuild), which allows
Ant projects to build by themselves, independently of AOO, and allows them
to be cleanly opened in (at least) Eclipse.

Also port main/connectivity's sdbc_hsqldb.jar to use these changes.    

Patch by: me


Added:
    openoffice/trunk/main/connectivity/java/
    openoffice/trunk/main/connectivity/java/sdbc_hsqldb/
    openoffice/trunk/main/connectivity/java/sdbc_hsqldb/build.xml   (with props)
    openoffice/trunk/main/connectivity/java/sdbc_hsqldb/makefile.mk
    openoffice/trunk/main/connectivity/java/sdbc_hsqldb/src/
    openoffice/trunk/main/connectivity/java/sdbc_hsqldb/src/com/
      - copied from r1804590, openoffice/trunk/main/connectivity/com/
    openoffice/trunk/main/connectivity/java/sdbc_hsqldb/src/org/
    openoffice/trunk/main/connectivity/java/sdbc_hsqldb/src/org/hsqldb/
    openoffice/trunk/main/connectivity/java/sdbc_hsqldb/src/org/hsqldb/lib/
    
openoffice/trunk/main/connectivity/java/sdbc_hsqldb/src/org/hsqldb/lib/FileSystemRuntimeException.java
      - copied unchanged from r1800578, 
openoffice/trunk/main/connectivity/com/sun/star/sdbcx/comp/hsqldb/FileSystemRuntimeException.java
Removed:
    openoffice/trunk/main/connectivity/com/
    
openoffice/trunk/main/connectivity/java/sdbc_hsqldb/src/com/sun/star/sdbcx/comp/hsqldb/FileSystemRuntimeException.java
    
openoffice/trunk/main/connectivity/java/sdbc_hsqldb/src/com/sun/star/sdbcx/comp/hsqldb/makefile.mk
Modified:
    
openoffice/trunk/main/connectivity/java/sdbc_hsqldb/src/com/sun/star/sdbcx/comp/hsqldb/StorageNativeOutputStream.java
    openoffice/trunk/main/connectivity/prj/build.lst
    openoffice/trunk/main/connectivity/prj/d.lst
    openoffice/trunk/main/set_soenv.in

Added: openoffice/trunk/main/connectivity/java/sdbc_hsqldb/build.xml
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_hsqldb/build.xml?rev=1804591&view=auto
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_hsqldb/build.xml (added)
+++ openoffice/trunk/main/connectivity/java/sdbc_hsqldb/build.xml Wed Aug  9 
17:43:42 2017
@@ -0,0 +1,239 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ ***********************************************************-->
+
+
+<project name="sdbc_hsqldb" default="main" basedir=".">
+
+    <!-- ================================================================= -->
+    <!-- settings                                                          -->
+    <!-- ================================================================= -->
+
+    <!-- global properties -->
+    <property file="../../../ant.properties"/>
+    <!-- version info -->
+    <property file="../../../solenv/inc/minor.mk"/>
+
+    <!-- name of this sub target used in recursive builds -->
+    <property name="target" value="sdbc_hsqldb"/>
+
+    <!-- name of jar file created, without .jar extension -->
+    <property name="jarname" value="sdbc_hsqldb"/>
+
+    <!-- relative path to project directory -->
+    <property name="prj" value="../.."/>
+
+    <!-- build output directory -->
+    <!-- FIXME: there are also extremely rare/obsolete 
dbcs/bndchk/truetime/hbtoolkit cases in main/solenv/inc/settings.mk -->
+    <condition property="out" value="${prj}/${OUTPATH}.cap">
+        <isset property="${profile}"/>
+    </condition>
+    <condition property="out" value="${prj}/${OUTPATH}.pro">
+        <isset property="${PRODUCT}"/>
+    </condition>
+    <property name="out" value="${prj}/${OUTPATH}"/>
+
+    <!-- build directories -->
+    <property name="build.dir" value="${out}"/>
+    <property name="build.class" value="${build.dir}/class/${target}"/>
+    <property name="build.misc" value="${build.dir}/misc/${target}"/>
+
+    <!-- start of java source code package structure -->
+    <property name="java.dir" value="src"/>
+
+    <!-- define how to handle CLASSPATH environment -->
+    <property name="build.sysclasspath" value="ignore"/>
+
+    <!-- classpath settings for compile and javadoc tasks -->
+    <condition property="jar-class-path" value="${HSQLDB_JAR}" 
else="hsqldb.jar">
+        <equals arg1="${SYSTEM_HSQLDB}" arg2="YES"/>
+    </condition>
+    <property name="HSQLDB_JAR" value="${OUTDIR}/bin/hsqldb.jar"/>
+    <path id="classpath">
+        <!-- 3rd party libs -->
+        <pathelement location="${HSQLDB_JAR}"/>
+    </path>
+
+    <!-- name to display in documentation -->
+    <property name="docname" value="sdbc_hsqldb"/>
+
+    <!-- set "modern" java compiler -->
+    <property name="build.compiler" value="modern"/>
+
+    <!-- set wether we want to compile with debug information -->
+    <property name="debug" value="on"/>
+
+    <!-- set wether we want to compile with optimisation -->
+    <property name="optimize" value="off"/>
+
+    <!-- set wether we want to compile with or without deprecation -->
+    <property name="deprecation" value="on"/>
+
+    <target name="info">
+        <echo message="--------------------"/>
+        <echo message="${target}"/>
+        <echo message="--------------------"/>
+    </target>
+
+    <!-- ================================================================= -->
+    <!-- custom targets                                                    -->
+    <!-- ================================================================= -->
+
+    <!-- the main target, called in recursive builds -->
+    <target name="main" depends="info,prepare,compile,jar,javadoc,zipdoc"/>
+
+    <!-- prepare output directories -->
+    <target name="prepare">
+        <mkdir dir="${build.dir}"/>
+        <mkdir dir="${build.dir}/doc/${target}"/>
+        <mkdir dir="${build.class}"/>
+        <mkdir dir="${build.misc}"/>
+    </target>
+
+
+    <target name="res" depends="prepare">
+        <copy todir="${build.class}">
+             <fileset dir="${java.dir}">
+                 <include name="**/*.properties"/>
+                 <include name="**/*.css"/>
+                 <include name="**/*.dtd"/>
+                 <include name="**/*.form"/>
+                 <include name="**/*.gif "/>
+                 <include name="**/*.htm"/>
+                 <include name="**/*.html"/>
+                 <include name="**/*.js"/>
+                 <include name="**/*.mod"/>
+                 <include name="**/*.sql"/>
+                 <include name="**/*.xml"/>
+                 <include name="**/*.xsl"/>
+                 <include name="**/*.map"/>
+
+             </fileset>
+        </copy>
+    </target>
+
+
+    <target name="compile" depends="prepare,res">
+       <javac destdir="${build.class}"
+              debug="${debug}"
+               deprecation="${deprecation}"
+              optimize="${optimize}"
+              classpathref="classpath">
+            <src path="${java.dir}"/>
+           <include name="**/*.java"/>
+       </javac>
+    </target>
+
+    <!-- check if javadoc is up to date -->
+    <target name="javadoc_check" depends="prepare" if="build.dir">
+       <uptodate property="javadocBuild.notRequired" value="true"
+            targetfile="${build.dir}/doc/${target}/${target}_javadoc.zip">
+               <srcfiles dir="${java.dir}" includes="**/*.java"/>
+       </uptodate>
+    </target>
+
+    <!-- generate java documentation -->
+    <target name="javadoc" depends="prepare,javadoc_check,compile"
+         unless="javadocBuild.notRequired"
+         if="build.dir">
+
+        <javadoc destdir="${build.dir}/doc/${target}/javadoc"
+                 verbose="false"
+                 author="false"
+                 nodeprecated="true"
+                 nodeprecatedlist="true"
+                 use="true"
+                 Doctitle="${docname}"
+                 windowtitle="${docname}"
+                 classpathref="classpath">
+
+            <packageset dir="${java.dir}" defaultexcludes="yes">
+                <include name="com/**"/>
+                <include name="org/**"/>
+            </packageset>
+
+            <link offline="true" href="http://java.sun.com/j2se/1.4.2/docs/api";
+                  packagelistLoc="${common.doc}/jdk1.4.2"/>
+            <link offline="true"
+                  href="http://java.sun.com/products/servlet/2.3/javadoc";
+                  packagelistLoc="${common.doc}/servlet2.3"/>
+            <link offline="true"
+                  href="http://logging.apache.org/log4j/docs/api";
+                  packagelistLoc="${common.doc}/log4j-1.2.8"/>
+            <link offline="true"
+                  
href="http://java.sun.com/products/javabeans/glasgow/javadocs";
+                  packagelistLoc="${common.doc}/jaf-1.0.2"/>
+            <link offline="true"
+                  href="http://java.sun.com/products/javamail/javadocs";
+                  packagelistLoc="${common.doc}/javamail-1.3.1"/>
+            <link offline="true"
+                  href="http://ws.apache.org/soap/docs";
+                  packagelistLoc="${common.doc}/soap-2.3.1"/>
+
+            <bottom>&lt;i&gt;Copyright &amp;#169; 2004 Sun Microsystems, Inc., 
901 San Antonio Road, Palo Alto, CA 94303 USA&lt;/i&gt;</bottom>
+            <header>${docname}</header>
+
+       </javadoc>
+    </target>
+
+    <!-- zip documentation and store in build/doc/${target} -->
+    <target name="zipdoc" depends="javadoc" if="build.dir" 
unless="javadocBuild.notRequired">
+       <zip zipfile="${build.dir}/doc/${target}/${target}_javadoc.zip"
+      basedir="${build.dir}/doc/${target}/javadoc"
+      update="true"/>
+    </target>
+
+    <!-- clean up -->
+    <target name="clean" depends="prepare">
+        <delete dir="${build.class}" includeEmptyDirs="true"/>
+        <delete dir="${build.dir}/doc/${target}" includeEmptyDirs="true"/>
+    </target>
+
+    <!-- create jar file -->
+    <target name="jar" depends="prepare,compile" if="build.class">
+        <jar jarfile="${build.class}/${jarname}.jar"
+             basedir="${build.class}">
+            <manifest>
+                <attribute name="Class-Path" value="${jar-class-path} .."/>
+                <attribute name="Solar-Version" value="${RSCREVISION}"/>
+            </manifest>
+            <include name="**/*.class"/>
+            <include name="**/*.properties"/>
+            <include name="**/*.css"/>
+            <include name="**/*.dtd"/>
+            <include name="**/*.form"/>
+            <include name="**/*.gif "/>
+            <include name="**/*.htm"/>
+            <include name="**/*.html"/>
+            <include name="**/*.js"/>
+            <include name="**/*.mod"/>
+            <include name="**/*.sql"/>
+            <include name="**/*.xml"/>
+            <include name="**/*.xsl"/>
+            <include name="**/*.map"/>
+        </jar>
+    </target>
+
+    <target name="test" depends="prepare">
+    </target>
+
+</project>
+

Propchange: openoffice/trunk/main/connectivity/java/sdbc_hsqldb/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openoffice/trunk/main/connectivity/java/sdbc_hsqldb/makefile.mk
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_hsqldb/makefile.mk?rev=1804591&view=auto
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_hsqldb/makefile.mk (added)
+++ openoffice/trunk/main/connectivity/java/sdbc_hsqldb/makefile.mk Wed Aug  9 
17:43:42 2017
@@ -0,0 +1,39 @@
+#**************************************************************
+#  
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#  
+#**************************************************************
+
+
+
+PRJ=..$/..
+PRJNAME=connectivity
+TARGET=sdbc_hsqldb
+
+.INCLUDE : ant.mk
+
+.IF defined(debug) || defined(DEBUG)
+ANTDEBUG=true
+.ELSE
+ANTDEBUG=off
+.ENDIF
+
+ANT_FLAGS+=-Dantdebug=$(ANTDEBUG)
+
+ALLTAR: ANTBUILD
+

Modified: 
openoffice/trunk/main/connectivity/java/sdbc_hsqldb/src/com/sun/star/sdbcx/comp/hsqldb/StorageNativeOutputStream.java
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_hsqldb/src/com/sun/star/sdbcx/comp/hsqldb/StorageNativeOutputStream.java?rev=1804591&r1=1804590&r2=1804591&view=diff
==============================================================================
--- 
openoffice/trunk/main/connectivity/java/sdbc_hsqldb/src/com/sun/star/sdbcx/comp/hsqldb/StorageNativeOutputStream.java
 (original)
+++ 
openoffice/trunk/main/connectivity/java/sdbc_hsqldb/src/com/sun/star/sdbcx/comp/hsqldb/StorageNativeOutputStream.java
 Wed Aug  9 17:43:42 2017
@@ -154,7 +154,7 @@ public class StorageNativeOutputStream {
      * be flushed (for example, by invoking
      * OutputStream.flush) before that data will be affected by sync.
      *
-     * @exception IOException
+     * @exception java.io.IOException
      *       Thrown when the buffers cannot be flushed,
      *       or because the system cannot guarantee that all the
      *       buffers have been synchronized with physical media.

Modified: openoffice/trunk/main/connectivity/prj/build.lst
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/prj/build.lst?rev=1804591&r1=1804590&r2=1804591&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/prj/build.lst (original)
+++ openoffice/trunk/main/connectivity/prj/build.lst Wed Aug  9 17:43:42 2017
@@ -1,7 +1,7 @@
 cn  connectivity    :    shell  L10N:l10n comphelper SO:moz_prebuilt svl 
UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb qadevOOo officecfg 
LIBXSLT:libxslt NULL
 cn  connectivity                                    usr1    -   all cn_mkout 
NULL
 cn  connectivity\inc                                nmake   -   all cn_inc NULL
-cn  connectivity\com\sun\star\sdbcx\comp\hsqldb     nmake   -   all 
cn_jhsqldbdb cn_hsqldb cn_inc NULL
+cn  connectivity\java\sdbc_hsqldb                   nmake   -   all 
cn_jhsqldbdb cn_hsqldb cn_inc NULL
 cn  connectivity\source\commontools                 nmake   -   all cn_cmtools 
cn_parse cn_inc NULL
 cn  connectivity\source\manager                     nmake   -   all cn_manager 
cn_dbtools cn_inc NULL
 cn  connectivity\source\cpool                       nmake   -   all cn_cpool 
cn_dbtools cn_inc NULL

Modified: openoffice/trunk/main/connectivity/prj/d.lst
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/prj/d.lst?rev=1804591&r1=1804590&r2=1804591&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/prj/d.lst (original)
+++ openoffice/trunk/main/connectivity/prj/d.lst Wed Aug  9 17:43:42 2017
@@ -20,6 +20,7 @@
 ..\source\drivers\calc\*.xml %_DEST%\xml%_EXT%\*.xml
 ..\source\drivers\mysql\*.xml %_DEST%\xml%_EXT%\*.xml
 ..\%__SRC%\class\*.jar %_DEST%\bin%_EXT%\*.jar
+..\%__SRC%\class\sdbc_hsqldb\*.jar %_DEST%\bin%_EXT%\*.jar
 
 mkdir: %_DEST%\inc%_EXT%\connectivity
 mkdir: %_DEST%\inc%_EXT%\connectivity\sdbcx

Modified: openoffice/trunk/main/set_soenv.in
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/set_soenv.in?rev=1804591&r1=1804590&r2=1804591&view=diff
==============================================================================
--- openoffice/trunk/main/set_soenv.in (original)
+++ openoffice/trunk/main/set_soenv.in Wed Aug  9 17:43:42 2017
@@ -1536,6 +1536,9 @@ if(defined($outfile_bat))
    die "Cannot open $outfile_bat: $!\n";
 }
 
+open( OUT_PROPS, ">ant.properties" ) ||
+  die "Cannot open ant.properties: $!\n";
+
 #
 #------------------------------------------
 # VII. Writing the data to the output file.
@@ -2099,6 +2102,7 @@ if(defined($outfile_bat))
 #---------------------------
 #
 close( OUT_SH ) || print "Can't close $outfile_sh: $!";
+close( OUT_PROPS ) || print "Can't close ant.properties: $!";
 
 if( defined($outfile_bat))
 {  close( OUT_BAT ) || print "Can't close $outfile_bat: $!";
@@ -2303,6 +2307,9 @@ sub ToFile {
          $envvar =~ s/\\/\\\\/g;
          $envvarbash = $envvar;
 
+         my $antvar = $envvarbash;
+         $antvar =~ s/(\$\{?\w+\}?)/$1/eeg ;
+
          if ($platform =~ m/os2/) {
              # expand the variables
              $envvar =~ s/(\$\{?\w+\}?)/$1/eeg ;
@@ -2316,6 +2323,7 @@ sub ToFile {
          printf("%-12s %-17s %-10s %s\n", "The variable", $_[ 0 ], "is set 
to:", $envvar);
          print OUT_SH "$_[ 0 ]=\"$envvarbash\"$newline";   # to sh file
          $exportvars .= " $_[ 0 ]";                        # add to export 
list for sh file
+         print OUT_PROPS "$_[ 0 ]=$antvar$newline";    # to Ant properties file
 
          if(defined($outfile_bat)) {
              print OUT_BAT "IF DEFINED $_[ 0 ] $unset $_[ 0 ]$newline";


Reply via email to