Skip to content

Commit

Permalink
Obsolete buildOnJdk.sh and buildOnJdk.bat. Ant now builds for multiple
Browse files Browse the repository at this point in the history
JDK versions using javac's bootclasspath option.


git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@555 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
julianhyde committed Nov 28, 2012
1 parent f8ac181 commit 4a56111
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 325 deletions.
13 changes: 4 additions & 9 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,16 @@ Building olap4j from source

1. Unzip olap4j-<version>-src.zip.

2. Update buildOnJdk.[sh|bat].

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 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.
2. Make sure that you are running JDK 1.7, the JAVA_HOME variable is
set, and $JAVA_HOME/bin is on your path.

3. Run a test build: $ ant clean-all dist

Writing a simple program
------------------------

You can now write and run a simple program against olap4j. For example, under Java 6,
You can now write and run a simple program against olap4j. For example, under
Java 1.6 or later,

import org.olap4j.*;
import org.olap4j.metadata.Member;
Expand Down
36 changes: 7 additions & 29 deletions RELEASE_CHECKLIST.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,18 @@ olap4j release check-list
- 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.

- Make sure that you have all of the following Java JVMs installed
separately:

* Java 1.5
* Java 1.6
* Java 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.

- Update buildOnJdk.sh (or buildOnJdk.bat if you are building on Windows).

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.)

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.

- Make sure that the Java 1.5 is the default JDK on the system path.
- Make sure that you have the following Java 1.7 installed and it 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.
Pay close attention to the Ant targets named compileJdk15, compileJdk16 and
compileJdk17, 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).

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.
Expand Down
139 changes: 59 additions & 80 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
-->
<project name="olap4j" basedir="." default="dist" xmlns:ivy="antlib:org.apache.ivy.ant">
<property file="${basedir}/test.properties"/>
<property name="unix.script" value="${basedir}/buildOnJdk.sh"/>
<import file="subfloor.xml" />

<property name="jar-jdk14.file"
Expand Down Expand Up @@ -47,50 +46,30 @@ src/org/olap4j/mdx/parser/impl/Token.java,
src/org/olap4j/mdx/parser/impl/TokenMgrError.java,
src/org/olap4j/driver/xmla/XmlaOlap4jDriverVersion.java" />

<target name="checkIsJdk15" if="jdk15.not.present">
<!--
<fail message="The 'dist' target (used to make an official release) must be run under JDK 1.5." />
-->
<target name="checkJdkVersion" unless="jdk17.present">
<fail message="The 'jar' target (and dependent targets 'dist', 'binzip')
must be run under JDK 1.7." />
</target>

<condition property="jdk15.present">
<contains string="${java.version}" substring="1.5." />
</condition>

<condition property="jdk15.not.present">
<not>
<contains string="${java.version}" substring="1.5." />
</not>
</condition>

<condition property="jdk16.present">
<contains string="${java.version}" substring="1.6." />
</condition>

<condition property="jdk16.not.present">
<not>
<contains string="${java.version}" substring="1.6." />
</not>
</condition>

<condition property="jdk17.present">
<contains string="${java.version}" substring="1.7." />
</condition>

<condition property="jdk17.not.present">
<not>
<contains string="${java.version}" substring="1.7." />
</not>
</condition>
<path id="project.bootclasspath.jdk15">
<pathelement location="${lib.dir}/rt-jdk1.5.jar"/>
</path>

<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>
<path id="project.bootclasspath.jdk16">
<pathelement location="${lib.dir}/rt-java6.jar"/>
</path>

<condition property="init.foodmart">
<not>
Expand All @@ -117,7 +96,7 @@ src/org/olap4j/driver/xmla/XmlaOlap4jDriverVersion.java" />
</target>

<!-- Override to create a proper release. -->
<target name="dist" depends="checkIsJdk15, all"/>
<target name="dist" depends="all"/>

<target name="all"
depends="clean,version-properties,jar,tck-jar,xmla-jar,javadoc,javadoc-pdf,jar-jdk14,source.zip"
Expand Down Expand Up @@ -165,7 +144,7 @@ olap4j_api.pdf"
depends="init, compile.pre, compileJdk15, compileJdk16, compileJdk17, compile.src_copy, compile.res_copy, compile.lic_copy, compile.post"
description="Performs all the steps to prepare the bin directory with a complete compilation" />

<target name="jar" depends="init, compile.pre, compileJdk15, compileJdk16, compileJdk17, compile, compile-tests, set-build.id, generate.manifest"
<target name="jar" depends="checkJdkVersion, compile, compile-tests, set-build.id, generate.manifest"
description="Jars up the bin directory after a compile">
<zip destfile="${dist.dir}/${ivy.artifact.id}-${project.revision}.jar">
<zipfileset dir="${basedir}" prefix=""
Expand Down Expand Up @@ -215,30 +194,59 @@ VERSION.txt" />
</target>

<target name="compileJdk15">
<exec osfamily="unix" executable="${unix.script}">
<arg line="jdk1.5 -Dskip.download=true compile.compile"/>
</exec>
<exec osfamily="windows" dir="." executable="cmd">
<arg line="/c .\buildOnJdk.bat jdk1.5 -Dskip.download=true compile.compile"/>
</exec>
<javac
destdir="${classes.dir}"
debug="${javac.debug}"
deprecation="${javac.deprecation}"
fork="true"
bootclasspathref="project.bootclasspath.jdk15"
source="1.5"
target="1.5"
includeantruntime="false">
<classpath>
<path refid="classpath" />
</classpath>
<src path="${src.dir}" />
<exclude name="org/olap4j/driver/xmla/FactoryJdbc4Impl.java"/>
<exclude name="org/olap4j/driver/xmla/FactoryJdbc4Plus.java"/>
<exclude name="org/olap4j/driver/xmla/FactoryJdbc41Impl.java"/>
</javac>
</target>

<target name="compileJdk16">
<exec osfamily="unix" executable="${unix.script}">
<arg line="jdk1.6 -Dskip.download=true compile.compile"/>
</exec>
<exec osfamily="windows" dir="." executable="cmd">
<arg line="/c .\buildOnJdk.bat jdk1.6 -Dskip.download=true compile.compile"/>
</exec>
<javac
destdir="${classes.dir}"
debug="${javac.debug}"
deprecation="${javac.deprecation}"
fork="true"
bootclasspathref="project.bootclasspath.jdk16"
source="1.6"
target="1.6"
includeantruntime="false">
<classpath>
<path refid="classpath" />
</classpath>
<src path="${src.dir}" />
<include name="org/olap4j/driver/xmla/FactoryJdbc4Impl.java"/>
<include name="org/olap4j/driver/xmla/FactoryJdbc4Plus.java"/>
</javac>
</target>

<target name="compileJdk17">
<exec osfamily="unix" executable="${unix.script}">
<arg line="jdk1.7 -Dskip.download=true compile.compile"/>
</exec>
<exec osfamily="windows" dir="." executable="cmd">
<arg line="/c .\buildOnJdk.bat jdk1.7 -Dskip.download=true compile.compile"/>
</exec>
<javac
destdir="${classes.dir}"
debug="${javac.debug}"
deprecation="${javac.deprecation}"
fork="true"
source="1.7"
target="1.7"
includeantruntime="false">
<classpath>
<path refid="classpath" />
</classpath>
<src path="${src.dir}" />
<include name="org/olap4j/driver/xmla/FactoryJdbc41Impl.java"/>
</javac>
</target>

<target name="source.zip">
Expand All @@ -263,8 +271,6 @@ xmla-cache/**,
.project,
build.properties,
build.xml,
buildOnJdk.bat,
buildOnJdk.sh,
checkFile.sh,
checkFile.awk,
ivy.xml,
Expand Down Expand Up @@ -397,34 +403,7 @@ 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" depends="apologise" if="java.version.matches.requested">
<javac destdir="${classes.dir}" debug="${javac.debug}"
deprecation="${javac.deprecation}" fork="true">
<classpath>
<path refid="classpath" />
</classpath>
<src path="${src.dir}" />
<exclude name="org/olap4j/driver/xmla/FactoryJdbc3Impl.java"
if="jdk15.not.present" />
<exclude name="org/olap4j/driver/xmla/FactoryJdbc4Impl.java"
if="jdk16.not.present" />
<exclude name="org/olap4j/driver/xmla/FactoryJdbc4Plus.java"
if="jdk16.not.present" />
<exclude name="org/olap4j/driver/xmla/FactoryJdbc41Impl.java"
if="jdk17.not.present" />
</javac>
</target>

<target name="compile.pre" depends="parser">
</target>
<target name="compile.pre" depends="parser"/>

<target name="compile.post">
<copy todir="${classes.dir}">
Expand Down
80 changes: 0 additions & 80 deletions buildOnJdk.bat

This file was deleted.

Loading

0 comments on commit 4a56111

Please sign in to comment.