Skip to content

Commit

Permalink
Enable build on JDK 1.7 (JDBC 4.1).
Browse files Browse the repository at this point in the history
git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@479 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
julianhyde committed Nov 7, 2011
1 parent ae37510 commit a411fbc
Show file tree
Hide file tree
Showing 9 changed files with 168 additions and 820 deletions.
67 changes: 54 additions & 13 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
== This software is subject to the terms of the Eclipse Public License v1.0
== Agreement, available at the following URL:
== http://www.eclipse.org/legal/epl-v10.html.
== Copyright (C) 2006-2010 Julian Hyde and others.
== Copyright (C) 2006-2011 Julian Hyde and others.
== All Rights Reserved.
== You must accept the terms of that agreement to use this software.
-->
Expand All @@ -24,10 +24,19 @@
${src.dir}/org/olap4j/mdx/parser/impl/DefaultMdxParser.java,
${src.dir}/org/olap4j/mdx/parser/impl/DefaultMdxParserSym.java" />

<target name="checkIsNotJdk16" if="jdk16.present">
<target name="checkIsJdk15" if="jdk15.not.present">
<fail message="The 'jar' target (and dependent targets 'release', 'binzip') must be run under JDK 1.5." />
</target>

<condition property="jdk15.present">
<equals arg1="${ant.java.version}" arg2="1.5" />
</condition>

<condition property="jdk15.not.present">
<not>
<equals arg1="${ant.java.version}" arg2="1.5" />
</not>
</condition>

<condition property="jdk16.present">
<equals arg1="${ant.java.version}" arg2="1.6" />
Expand All @@ -39,6 +48,16 @@ ${src.dir}/org/olap4j/mdx/parser/impl/DefaultMdxParserSym.java" />
</not>
</condition>

<condition property="jdk17.present">
<equals arg1="${ant.java.version}" arg2="1.7" />
</condition>

<condition property="jdk17.not.present">
<not>
<equals arg1="${ant.java.version}" arg2="1.7" />
</not>
</condition>

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

Expand Down Expand Up @@ -89,7 +108,7 @@ olap4j_api.pdf"
</tar>
</target>

<target name="jar" depends="checkIsNotJdk16,compile,compile-tests,compileJdk16,set-build.id,generate.manifest"
<target name="jar" depends="init, compile.pre, checkIsJdk15, compileJdk15, compileJdk16, compileJdk17, 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="${classes.dir}" prefix=""
Expand Down Expand Up @@ -133,12 +152,30 @@ VERSION.txt" />
</zip>
</target>

<target name="compileJdk15">
<exec osfamily="unix" executable="${basedir}/buildOnJdk.sh">
<arg line="jdk1.5 compile.compile"/>
</exec>
<exec osfamily="windows" dir="." executable="cmd">
<arg line="/c .\buildOnJdk.bat jdk1.5 compile.compile"/>
</exec>
</target>

<target name="compileJdk16">
<exec osfamily="unix" executable="${basedir}/buildJdk16.sh">
<arg line="compile"/>
<exec osfamily="unix" executable="${basedir}/buildOnJdk.sh">
<arg line="jdk1.6 compile.compile"/>
</exec>
<exec osfamily="windows" executable="${basedir}/buildJdk16.bat">
<arg line="compile"/>
<exec osfamily="windows" dir="." executable="cmd">
<arg line="/c .\buildOnJdk.bat jdk1.6 compile.compile"/>
</exec>
</target>

<target name="compileJdk17">
<exec osfamily="unix" executable="${basedir}/buildOnJdk.sh">
<arg line="jdk1.7 compile.compile"/>
</exec>
<exec osfamily="windows" dir="." executable="cmd">
<arg line="/c .\buildOnJdk.bat jdk1.7 compile.compile"/>
</exec>
</target>

Expand All @@ -157,8 +194,8 @@ xmla-cache/**,
.project,
build.properties,
build.xml,
buildJdk16.bat,
buildJdk16.sh,
buildOnJdk16.bat,
buildOnJdk16.sh,
CHANGES.txt,
checkFile.sh,
checkFile.awk,
Expand Down Expand Up @@ -290,9 +327,13 @@ class XmlaOlap4jDriverVersion {
</classpath>
<src path="${src.dir}" />
<exclude name="org/olap4j/driver/xmla/FactoryJdbc3Impl.java"
if="jdk16.present" />
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>

Expand Down Expand Up @@ -407,7 +448,7 @@ class XmlaOlap4jDriverVersion {
<tag name="pre" description="Pre-condition:" scope="constructors,methods" />
<tag name="post" description="Post-condition:" scope="constructors,methods" />
<tag name="testcase" description="Test-case:" scope="constructors,methods,types" />
<link href="http://download.oracle.com/javase/6/docs/api/" />
<link href="http://download.oracle.com/javase/7/docs/api/" />
</javadoc>
</target>

Expand All @@ -426,7 +467,7 @@ class XmlaOlap4jDriverVersion {
<tag name="pre" description="Pre-condition:" scope="constructors,methods" />
<tag name="post" description="Post-condition:" scope="constructors,methods" />
<tag name="testcase" description="Test-case:" scope="constructors,methods,types" />
<link href="http://download.oracle.com/javase/6/docs/api/" />
<link href="http://download.oracle.com/javase/7/docs/api/" />
</javadoc>
</target>

Expand All @@ -450,7 +491,7 @@ class XmlaOlap4jDriverVersion {
<tag name="pre" description="Pre-condition:" scope="constructors,methods" />
<tag name="post" description="Post-condition:" scope="constructors,methods" />
<tag name="testcase" description="Test-case:" scope="constructors,methods,types" />
<link href="http://download.oracle.com/javase/6/docs/api/" />
<link href="http://download.oracle.com/javase/7/docs/api/" />
<link href="http://junit.sourceforge.net/javadoc/" />
<doclet name="ydoc.doclets.YStandard"
path="${ydoc.home}/lib/ydoc.jar${ps}${ydoc.home}/lib/class2svg.jar${ps}${ydoc.home}/resources${ps}${ydoc.home}/doc">
Expand Down
10 changes: 0 additions & 10 deletions buildJdk16.sh

This file was deleted.

2 changes: 1 addition & 1 deletion buildJdk16.bat → buildOnJdk.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo off
rem $Id$
rem $Id: buildJdk16.bat 207 2009-05-05 14:58:00Z lucboudreau $
rem Called recursively from 'ant release' to build the files which can only be
rem built under JDK 1.6.

Expand Down
27 changes: 27 additions & 0 deletions buildOnJdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# $Id: //open/mondrian/buildJdk16.sh#3 $
# Called recursively from 'ant release' to build the files which can only be
# built under a particular JDK version.
#
# Usage:
# buildOnJdk.sh <jdk version> <ant args>
#
# For example:
# buildOnJdk.sh jdk1.6 compile.java

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 [ ! -d "$JAVA_HOME" ]; then
echo "$0: Invalid JAVA_HOME $JAVA_HOME; skipping compile."
exit 1
fi

export PATH=$JAVA_HOME/bin:$PATH
ant -Dskip.download=true "$@"

# End buildOnJdk.sh
10 changes: 10 additions & 0 deletions src/org/olap4j/driver/xmla/Factory.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.olap4j.driver.xmla;

import org.olap4j.OlapException;
import org.olap4j.OlapStatement;
import org.olap4j.driver.xmla.proxy.XmlaOlap4jProxy;

import java.sql.*;
Expand Down Expand Up @@ -75,6 +76,15 @@ ResultSet newFixedResultSet(
XmlaOlap4jCellSet newCellSet(
XmlaOlap4jStatement olap4jStatement) throws OlapException;

/**
* Creates a statement.
*
* @param olap4jConnection Connection
* @return Statement
*/
XmlaOlap4jStatement newStatement(
XmlaOlap4jConnection olap4jConnection);

/**
* Creates a prepared statement.
*
Expand Down
Loading

0 comments on commit a411fbc

Please sign in to comment.