Skip to content

Commit

Permalink
Modify the multi-JDK build mechanism so that, by default, olap4j buil…
Browse files Browse the repository at this point in the history
…ds 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
  • Loading branch information
julianhyde committed Feb 29, 2012
1 parent f0a1a2e commit f521228
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 36 deletions.
67 changes: 41 additions & 26 deletions RELEASE_CHECKLIST.txt
Original file line number Diff line number Diff line change
@@ -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.


# End RELEASE_CHECKLIST.txt
18 changes: 17 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ src/org/olap4j/driver/xmla/XmlaOlap4jDriverVersion.java" />
</not>
</condition>

<condition property="java.version.matches.requested">
<or>
<not>
<isset property="requested.java.version"/>
</not>
<matches pattern="^${requested.java.version}.*" string="jdk${java.runtime.version}" />
</or>
</condition>

<target name="setup" depends="version-properties,compile,create-dot-classpath"
description="Setups the project for eclipse." />

Expand Down Expand Up @@ -359,8 +368,15 @@ class XmlaOlap4jDriverVersion {
<!-- Purposely left empty. Exportable Ivy files are generated when resolving. -->
</target>

<target name="apologise" unless="java.version.matches.requested">
<echo>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}.
</echo>
</target>

<!-- override compile task to account for special jdk handling -->
<target name="compile.compile">
<target name="compile.compile" depends="apologise" if="java.version.matches.requested">
<javac destdir="${classes.dir}" debug="${javac.debug}"
deprecation="${javac.deprecation}" fork="true">
<classpath>
Expand Down
5 changes: 2 additions & 3 deletions buildOnJdk.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -77,5 +77,4 @@ echo Using Ant arguments: %ANT_ARGUMENTS%

ant %ANT_ARGUMENTS%

rem End buildJdk16.bat

rem End buildOnJdk.bat
19 changes: 13 additions & 6 deletions buildOnJdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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

0 comments on commit f521228

Please sign in to comment.