From f521228de75f21738f326257c247e46060eba005 Mon Sep 17 00:00:00 2001 From: Julian Hyde Date: Wed, 29 Feb 2012 06:37:31 +0000 Subject: [PATCH] Modify the multi-JDK build mechanism so that, by default, olap4j builds on just the current JDK. Files intended for other JDK versions don't get built. That's what most developers want, because they're not building a release, they're building for themselves or their organization, and their organization uses just one JDK version. If you are building a release (probably just me and Luc) you will need to modify buildOnJdk.sh to tell it where the various JDKs live. git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@517 c6a108a4-781c-0410-a6c6-c2d559e19af0 --- RELEASE_CHECKLIST.txt | 67 ++++++++++++++++++++++++++----------------- build.xml | 18 +++++++++++- buildOnJdk.bat | 5 ++-- buildOnJdk.sh | 19 ++++++++---- 4 files changed, 73 insertions(+), 36 deletions(-) diff --git a/RELEASE_CHECKLIST.txt b/RELEASE_CHECKLIST.txt index c099e5b..0d62303 100644 --- a/RELEASE_CHECKLIST.txt +++ b/RELEASE_CHECKLIST.txt @@ -1,42 +1,57 @@ +# $Id$ - - Update README.txt, CHANGES.txt, index.html. +olap4j release check-list +========================= - - Update build.properties + - Update README.txt, CHANGES.txt, index.html. - - Edit test.properties and run the test suite. Make sure everything is green. - Also make sure to run both the Mondrian and the XMLA TCKs. + - Update build.properties - - Make sure that you have all of the following Java JVM's installed - separately: + - Edit test.properties and run the test suite. Make sure everything is green. + Also make sure to run both the Mondrian and the XMLA TCKs. - * Java 5 - * Java 6 - * Java 7 + - Make sure that you have all of the following Java JVMs installed + separately: - - Update buildOnJdk.[sh|bat]. + * Java 1.5 + * Java 1.6 + * Java 1.7 - If you are building on a Linux/Unix/Whatever machine, you only need to create - symlinks to /usr/lib/jvm/${jdkVersion} where jdkVersion is one of 1.5, 1.6 or 1.7. + If you are building on a Linux/Unix/Whatever machine, you should create + symlinks /usr/lib/jvm/${jdkVersion} where jdkVersion is one of 1.5, 1.6 or + 1.7. - If you are building on a Windows system, including Cygwin users, edit the Batch - file and set the properties JAVA_HOME_1* to the paths of the corresponding JVM - installation paths. You can also set these variables in your system environment. + - Update buildOnJdk.sh (or buildOnJdk.bat if you are building on Windows). - - Make sure that the JVM 5 is the default JVM on the system path. + Important: Uncomment the "case" expression that sets JAVA_HOME. (These days + buildOnJdk is configured to work out-of-the-box for developers building for + just one JDK, whereas for a release you need it to build for 3 JDKs.) - - Run a test build: $ ant clean-all dist - - Pay close attention to the Ant targets named compileJdk1* and ensure that each - JVM compilation phase has compiled the files it needed to. The JDK 1.5 should compile - about 700+ files. The JDK 1.6 must compile the JDBC 4.0 classes (2 files) - and Java 7 should compile the JDBC 4.1 driver (1 file). + If you are building on a Windows system, including Cygwin users, edit the + Batch file and set the properties JAVA_HOME_1* to the paths of the + corresponding JVM installation paths. You can also set these variables in + your system environment. - Check the Javadoc warnings, and make sure that the only warnings are related to - the JDBC 4 and 4.1 classes. Any other error/warning must be fixed. + - Make sure that the Java 1.5 is the default JDK on the system path. + + - Run a test build: + + $ ant clean-all dist + + Pay close attention to the Ant targets named compileJdk1.5, compileJdk1.6 + and compileJdk1.7, and ensure that each JVM compilation phase has compiled + the files it needed to. The JDK 1.5 should compile about 700+ files. The JDK + 1.6 must compile the JDBC 4.0 classes (2 files) and JDK 1.7 should compile + the JDBC 4.1 driver (1 file). In each compileJdk1.x target, the first target + is called "apologise:", and must produce no output. + + Check the Javadoc warnings, and make sure that the only warnings are related + to the JDBC 4 and 4.1 classes. Any other error/warning must be fixed. - Check the zip file. - + * Make sure that it contains all the required files. * Make sure that the Javadoc links work correctly. * Make sure that all JAR files are present. - \ No newline at end of file + +# End RELEASE_CHECKLIST.txt diff --git a/build.xml b/build.xml index 4ebe58f..af0b394 100644 --- a/build.xml +++ b/build.xml @@ -81,6 +81,15 @@ src/org/olap4j/driver/xmla/XmlaOlap4jDriverVersion.java" /> + + + + + + + + + @@ -359,8 +368,15 @@ class XmlaOlap4jDriverVersion { + + Actual JVM Version (${java.runtime.version}) does not match +requested (${requested.java.version}); skipping compile for this JDK. +If you wish to build for this JDK, modify ${unix.script}. + + + - + diff --git a/buildOnJdk.bat b/buildOnJdk.bat index c9dc7b8..0ba9f1b 100755 --- a/buildOnJdk.bat +++ b/buildOnJdk.bat @@ -61,7 +61,7 @@ if %1==jdk1.7 ( set JAVA_HOME=%JAVA_HOME_17% ) -set ANT_ARGUMENTS= +set ANT_ARGUMENTS=-Drequested.java.version=%1 for %%A in (%*) do ( set ANT_ARGUMENTS=%ANT_ARGUMENTS% %%A ) @@ -77,5 +77,4 @@ echo Using Ant arguments: %ANT_ARGUMENTS% ant %ANT_ARGUMENTS% -rem End buildJdk16.bat - +rem End buildOnJdk.bat diff --git a/buildOnJdk.sh b/buildOnJdk.sh index 5948709..e8a5b35 100755 --- a/buildOnJdk.sh +++ b/buildOnJdk.sh @@ -30,10 +30,17 @@ jdkVersion=$1 shift -# Change the following line to point each JDK's home. -case "$jdkVersion" in -(*) export JAVA_HOME=/usr/lib/jvm/${jdkVersion};; -esac +# If you are building olap4j for a single JDK (most likely the +# case), leave the following lines commented. +# +# If you are building a release, you will need to compile different +# parts of Mondrian's source code under different JDKs. Uncomment the +# following lines to ensure that JAVA_HOME is assigned correctly for +# each JDK version. +# +#case "$jdkVersion" in +#(*) export JAVA_HOME=/usr/lib/jvm/${jdkVersion};; +#esac if [ ! -d "$JAVA_HOME" ]; then echo "$0: Invalid JAVA_HOME $JAVA_HOME; skipping compile." @@ -43,8 +50,8 @@ fi export PATH=$JAVA_HOME/bin:$PATH echo Using JAVA_HOME: $JAVA_HOME -echo Using Ant arguments: $@ +echo Using Ant arguments: -Drequested.java.version="$jdkVersion" $@ -ant "$@" +ant -Drequested.java.version="$jdkVersion" "$@" # End buildOnJdk.sh