db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fuzzylo...@apache.org
Subject svn commit: r447970 - in /db/derby/code/trunk/tools/jdbc4: modules.patch update-with-jdbc4 update-with-jdbc4.bat
Date Tue, 19 Sep 2006 21:02:49 GMT
Author: fuzzylogic
Date: Tue Sep 19 14:02:49 2006
New Revision: 447970

URL: http://svn.apache.org/viewvc?view=rev&rev=447970
Log:
DERBY-1846: update-with-jdbc4 scripts need to patch up modules.properties
Many other minor fixes and tweaks to the scripts to get them working in
different environments.

Added:
    db/derby/code/trunk/tools/jdbc4/modules.patch   (with props)
Modified:
    db/derby/code/trunk/tools/jdbc4/update-with-jdbc4
    db/derby/code/trunk/tools/jdbc4/update-with-jdbc4.bat

Added: db/derby/code/trunk/tools/jdbc4/modules.patch
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/jdbc4/modules.patch?view=auto&rev=447970
==============================================================================
--- db/derby/code/trunk/tools/jdbc4/modules.patch (added)
+++ db/derby/code/trunk/tools/jdbc4/modules.patch Tue Sep 19 14:02:49 2006
@@ -0,0 +1,8 @@
+
+# jdbc40 - requires JDK 1.6 (which is constant 7 in Derby)
+#
+derby.module.jdbcJ6=org.apache.derby.jdbc.Driver40
+derby.env.jdk.jdbcJ6=7
+derby.env.classes.jdbcJ6=java.sql.Driver
+cloudscape.config.jdbcJ6=derby
+

Propchange: db/derby/code/trunk/tools/jdbc4/modules.patch
------------------------------------------------------------------------------
    svn:eol-style = CRLF

Modified: db/derby/code/trunk/tools/jdbc4/update-with-jdbc4
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/jdbc4/update-with-jdbc4?view=diff&rev=447970&r1=447969&r2=447970
==============================================================================
--- db/derby/code/trunk/tools/jdbc4/update-with-jdbc4 (original)
+++ db/derby/code/trunk/tools/jdbc4/update-with-jdbc4 Tue Sep 19 14:02:49 2006
@@ -25,6 +25,9 @@
   exit 1
 fi
 
+cygwin=false
+darwin=false
+mks=false
 case "`uname`" in 
   CYGWIN*) cygwin=true ;;
   Darwin*) darwin=true ;;
@@ -33,7 +36,7 @@
 if [ -z "$JAVA_HOME" ]; then
   if [ -n "$darwin" ]; then
     JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
-  fi else if [ -d /usr/j2se -a -x /usr/j2se/bin/javac ]; then
+  elif [ -d /usr/j2se -a -x /usr/j2se/bin/javac ]; then
     JAVA_HOME=/usr/j2se
   fi
 fi
@@ -56,29 +59,47 @@
 
 # Set up LOCALCLASSPATH, for cygwin or mks, use ;
 CPS=:
-if [ -n "$cygwin" ]; then
-  CPS=';'
-fi
-if [ ! `expr index` = "index" ]; then  # for MKS
-  if [ `expr index $SHELL sh.exe` -gt 0 ]; then
+if [ \( "`expr $SHELL : '.*sh.exe$'`" -gt 0 \) -a \( "$cygwin" = "false" \) ]; then
     CPS=';'
-  fi
+    mks=true
 fi
 LOCALCLASSPATH="$DERBY_HOME/lib/derby.jar$CPS$DERBY_HOME/lib/derbyclient.jar"
 
+# adjust paths for cygwin
+DERBY_HOME_NML=$DERBY_HOME
+if $cygwin; then
+  if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then
+    format=mixed
+  else
+    format=windows
+  fi
+  DERBY_HOME_NML=`cygpath --$format "$DERBY_HOME_NML"`
+  JAVA_HOME=`cygpath --$format "$JAVA_HOME"`
+  LOCALCLASSPATH=`cygpath --path --$format "$LOCALCLASSPATH"`
+  SRCDIR=`cygpath --path --$format "$SRCDIR"`
+  # now set CPS to ; for later use
+  CPS=';'
+fi
+
 # compile the client classes
 echo "Compiling the client classes for JDBC 4.0"
 for i in `cat client.list`
 do
-  FILE=`echo $i | tr '\\' '/' | sed 's/.$//g'`
+  FILE=`echo $i | tr '\\' '/'` 
+  if [ ! \( "$cygwin" = "true" \) -o \( "$mks" = "true" \) ]; then
+    FILE=`echo $FILE | sed 's/.$//g'`
+  fi
+  if $mks; then
+    FILE=$i
+  fi
   CLASSES="$FILE $CLASSES"
 done
 
 cd $SRCDIR/java/client
 mkdir -p "$DERBY_HOME/jdbc4classes/client"
-"$JAVA_HOME/bin/javac" -d "$DERBY_HOME/jdbc4classes/client" \
+"$JAVA_HOME/bin/javac" -d "$DERBY_HOME_NML/jdbc4classes/client" \
                        -cp "$LOCALCLASSPATH" \
-                       -sourcepath "$SRCDIR/java/client$CPS$SRCDIR/java/shared" \
+                       -sourcepath "$SRCDIR/java/client$CPS$SRCDIR/java/shared$CPS$SRCDIR/java/engine"
\
                         $CLASSES
 
 if [ $? -gt 0 ]; then
@@ -90,7 +111,7 @@
 cd $THISDIR
 
 echo "Updating derbyclient.jar"
-jar uf "$DERBY_HOME/lib/derbyclient.jar" -C "$DERBY_HOME/jdbc4classes/client" org
+"$JAVA_HOME/bin/jar" uf "$DERBY_HOME_NML/lib/derbyclient.jar" -C "$DERBY_HOME_NML/jdbc4classes/client"
org
 
 if [ $? -gt 0 ]; then
   echo "Error updating derbyclient.jar. It may no longer be usable."
@@ -102,17 +123,32 @@
 unset CLASSES
 for i in `cat engine.list`
 do
-  FILE=`echo $i | tr '\\' '/' | sed 's/.$//g'`
+  FILE=`echo $i | tr '\\' '/'` 
+  if [ ! "$cygwin" = "true" ]; then
+    FILE=`echo $FILE | sed 's/.$//g'`
+  fi
+  if $mks; then
+    FILE=$i
+  fi
   CLASSES="$FILE $CLASSES"
 done
 
 cd "$SRCDIR/java/engine"  
 mkdir -p "$DERBY_HOME/jdbc4classes/engine"
-"$JAVA_HOME/bin/javac" -d "$DERBY_HOME/jdbc4classes/engine" \
+"$JAVA_HOME/bin/javac" -d "$DERBY_HOME_NML/jdbc4classes/engine" \
                        -cp "$LOCALCLASSPATH" \
                        -sourcepath "$SRCDIR/java/engine$CPS$SRCDIR/java/shared" \
                         $CLASSES
 
+# patch up modules.properties do the driver will load
+cd "$DERBY_HOME/jdbc4classes/engine"
+"$JAVA_HOME/bin/jar" xf "$DERBY_HOME_NML/lib/derby.jar" org/apache/derby/modules.properties
+if $cygwin; then
+  cat "$THISDIR/modules.patch" >> "$DERBY_HOME/jdbc4classes/engine/org/apache/derby/modules.properties"
+elif [ ! "$cygwin" = "true" ]; then
+  cat "$THISDIR/modules.patch" | sed 's/.$//g' >> "$DERBY_HOME/jdbc4classes/engine/org/apache/derby/modules.properties"
+fi
+
 if [ $? -gt 0 ]; then
   echo "There was an error compiling the engine classes. Exiting."
   cd "$THISDIR"
@@ -122,7 +158,7 @@
 cd "$THISDIR"
 
 echo "Updating derby.jar"
-jar uf "$DERBY_HOME/lib/derby.jar" -C "$DERBY_HOME/jdbc4classes/engine" org
+"$JAVA_HOME/bin/jar" uf "$DERBY_HOME_NML/lib/derby.jar" -C "$DERBY_HOME_NML/jdbc4classes/engine"
org
 
 if [ $? -gt 0 ]; then
   echo "Error updating derby.jar. It may no longer be usable."

Modified: db/derby/code/trunk/tools/jdbc4/update-with-jdbc4.bat
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/jdbc4/update-with-jdbc4.bat?view=diff&rev=447970&r1=447969&r2=447970
==============================================================================
--- db/derby/code/trunk/tools/jdbc4/update-with-jdbc4.bat (original)
+++ db/derby/code/trunk/tools/jdbc4/update-with-jdbc4.bat Tue Sep 19 14:02:49 2006
@@ -1,3 +1,4 @@
+@echo off
 @REM Licensed to the Apache Software Foundation (ASF) under one
 @REM or more contributor license agreements.  See the NOTICE file
 @REM distributed with this work for additional information
@@ -31,6 +32,7 @@
 
 :setLocalClasspath
 set LOCALCLASSPATH=%DERBY_HOME%\lib\derby.jar;%DERBY_HOME%\lib\derbyclient.jar
+@rmdir /s /q %DERBY_HOME%\jdbc4classes
 
 :checkJava
 set _JAVACMD=%JAVACMD%
@@ -46,25 +48,31 @@
 if "%_JARCMD%" == "" set _JAVACMD=jar.exe
 
 :endcheck
-echo "Building Derby client classes for JDBC 4.0"
+echo Building Derby client classes for JDBC 4.0...
 mkdir %DERBY_HOME%\jdbc4classes\client
 cd %SRCDIR%\java\client
 FOR /F %%G in (%THISDIR%client.list) do %_JAVACMD% -d %DERBY_HOME%\jdbc4classes\client -classpath
%LOCALCLASSPATH% -sourcepath "%CLIENTDIR%;%ENGINEDIR%;%SHAREDDIR%" %%G
 
-echo "Updating %DERBY_HOME%\lib\derbyclient.jar"
+echo Updating %DERBY_HOME%\lib\derbyclient.jar
 %_JARCMD% uf %DERBY_HOME%\lib\derbyclient.jar -C %DERBY_HOME%\jdbc4classes\client org
 
-echo "Building Derby engine classes for JDBC 4.0"
+echo Building Derby engine classes for JDBC 4.0
 mkdir %DERBY_HOME%\jdbc4classes\engine
+@rem stop the compiler from trying to recompile EmbedDatabaseMetaData
+cd %DERBY_HOME%\jdbc4classes\engine
+%_JARCMD% xf %DERBY_HOME%\lib\derby.jar org\apache\derby\impl\jdbc\EmbedDatabaseMetaData.class
+%_JARCMD% xf %DERBY_HOME%\lib\derby.jar org\apache\derby\modules.properties
 cd %SRCDIR%\java\engine
 FOR /F %%G in (%THISDIR%engine.list) do %_JAVACMD% -d %DERBY_HOME%\jdbc4classes\engine -classpath
%LOCALCLASSPATH% -sourcepath "%ENGINEDIR%;%SHAREDDIR%" %%G
+copy /b %DERBY_HOME%\jdbc4classes\engine\org\apache\derby\modules.properties+%THISDIR%\modules.patch
%DERBY_HOME%\jdbc4classes\engine\org\apache\derby\modules.properties
+del /q %DERBY_HOME%\jdbc4classes\engine\org\apache\derby\impl\jdbc\EmbedDatabaseMetaData.class
 
-echo "Updating %DERBY_HOME%\lib\derby.jar"
+echo Updating %DERBY_HOME%\lib\derby.jar
 %_JARCMD% uf %DERBY_HOME%\lib\derby.jar -C %DERBY_HOME%\jdbc4classes\engine org
 
 cd %THISDIR%
 
-echo "Cleaning up"
-@erase /s /q %DERBY_HOME%/jdbc4classes
-echo "Done."
+echo Cleaning up
+@rmdir /s /q %DERBY_HOME%\jdbc4classes
+echo Done.
 :end



Mime
View raw message