Skip to content

Commit

Permalink
JDBC-547 Generate maven relocation artifact
Browse files Browse the repository at this point in the history
+ Some ant condition cleanup/simplification
+ Put maven artifacts in specific subdirectories (simplifies manual steps)
  • Loading branch information
mrotteveel committed Sep 13, 2018
1 parent 437a7bf commit d81dc0c
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 37 deletions.
28 changes: 17 additions & 11 deletions build/dist.xml
Expand Up @@ -35,23 +35,29 @@
<!-- =================================================================== -->
<!-- Puts the files in the right place for a (manual) Maven release -->
<!-- =================================================================== -->
<target name="mavenPrepare" depends="jars,javadocs">
<mkdir dir="${build.maven}"/>
<copy file="${build.lib}/${archive.name.simple}" tofile="${build.maven}/${archive.maven.simple}"/>
<copy file="${build.lib}/${archive.name.sources}" tofile="${build.maven}/${archive.maven.sources}"/>
<copy file="${build.lib}/${archive.name.javadoc}" tofile="${build.maven}/${archive.maven.javadoc}"/>
<copy file="${maven.pom.template}" tofile="${build.maven}/${maven.pom.target}">
<filterset>
<filter token="ARTIFACT_ID" value="${maven.artifactId}"/>
<filter token="VERSION" value="${version.maven}"/>
</filterset>
<target name="mavenPrepare" depends="mavenDist,mavenRelocation"/>

<target name="mavenDist" depends="jars">
<mkdir dir="${maven.artifact.location}"/>
<copy file="${build.lib}/${archive.name.simple}" tofile="${maven.artifact.location}/${archive.maven.simple}"/>
<copy file="${build.lib}/${archive.name.sources}" tofile="${maven.artifact.location}/${archive.maven.sources}"/>
<copy file="${build.lib}/${archive.name.javadoc}" tofile="${maven.artifact.location}/${archive.maven.javadoc}"/>
<copy file="${maven.pom.template}" tofile="${maven.artifact.location}/${maven.pom.target}">
<filterset refid="maven.filterSet"/>
</copy>
</target>

<target name="mavenRelocation" depends="init" if="maven.generateRelocation">
<mkdir dir="${maven.relocation.location}"/>
<copy file="${maven.relocation.template}" tofile="${maven.relocation.location}/${maven.relocation.target}">
<filterset refid="maven.filterSet"/>
</copy>
</target>

<!-- =================================================================== -->
<!-- Creates the distribution -->
<!-- =================================================================== -->
<target name="dist" depends="jars,javadocs,buildalldocs,mavenPrepare">
<target name="dist" depends="jars,buildalldocs,mavenPrepare">
<mkdir dir="${build.dist}"/>
<zip zipfile="${build.dist}/${Name}-${version.full}.zip">
<fileset dir="${build.lib}">
Expand Down
56 changes: 30 additions & 26 deletions build/init.xml
@@ -1,4 +1,6 @@
<target name="init">
<echo message="Java version: ${ant.java.version}"/>
<echo message="Ant version: ${ant.version}"/>
<!-- External build properties
All properties can be overridden by adding them to build-local.properties
-->
Expand All @@ -13,54 +15,37 @@

<condition property="jdbc.40" value="true">
<or>
<equals arg1="${ant.java.version}" arg2="1.6"/>
<javaversion exactly="1.6"/>
<!-- Technically JDK 1.7 is JDBC 4.1, we use this here as an indication to use the jdbc4.0 sources -->
<equals arg1="${ant.java.version}" arg2="1.7"/>
<javaversion exactly="1.7"/>
</or>
</condition>

<condition property="use.16.jca" value="true">
<or>
<equals arg1="${ant.java.version}" arg2="1.6"/>
<equals arg1="${ant.java.version}" arg2="1.7"/>
<equals arg1="${ant.java.version}" arg2="1.8"/>
</or>
<javaversion atleast="1.6"/>
</condition>

<condition property="use.16.pool" value="true">
<or>
<equals arg1="${ant.java.version}" arg2="1.6"/>
<equals arg1="${ant.java.version}" arg2="1.7"/>
<equals arg1="${ant.java.version}" arg2="1.8"/>
</or>
<javaversion atleast="1.6"/>
</condition>

<condition property="jdbc.42" value="true">
<equals arg1="${ant.java.version}" arg2="1.8"/>
<javaversion exactly="1.8"/>
</condition>

<!-- Java 6 specific properties -->
<condition property="jdk1.6" value="true">
<equals arg1="${ant.java.version}" arg2="1.6"/>
</condition>
<condition property="maven.jdkversion" value="jdk16">
<equals arg1="${ant.java.version}" arg2="1.6"/>
<javaversion exactly="1.6"/>
</condition>

<!-- Java 7 specific properties -->
<condition property="jdk1.7" value="true">
<equals arg1="${ant.java.version}" arg2="1.7"/>
</condition>
<condition property="maven.jdkversion" value="jdk17">
<equals arg1="${ant.java.version}" arg2="1.7"/>
<javaversion exactly="1.7"/>
</condition>

<!-- Java 8 specific properties -->
<condition property="jdk1.8" value="true">
<equals arg1="${ant.java.version}" arg2="1.8"/>
</condition>
<condition property="maven.jdkversion" value="jdk18">
<equals arg1="${ant.java.version}" arg2="1.8"/>
<javaversion exactly="1.8"/>
</condition>

<property name="Name" value="Jaybird"/>
Expand Down Expand Up @@ -172,9 +157,23 @@
<property name="archive.maven.simple" value="${maven.artifactId}-${version.maven}.jar"/>
<property name="archive.maven.sources" value="${maven.artifactId}-${version.maven}-sources.jar"/>
<property name="archive.maven.javadoc" value="${maven.artifactId}-${version.maven}-javadoc.jar"/>
<property name="maven.artifact.location" value="${build.maven}/${maven.artifactId}"/>
<property name="maven.pom.template" value="${module.root}/build/maven-release/jaybird-example.pom"/>
<property name="maven.pom.target" value="${maven.artifactId}-${version.maven}.pom"/>

<filterset id="maven.filterSet">
<filter token="ARTIFACT_ID" value="${maven.artifactId}"/>
<filter token="VERSION" value="${version.maven}"/>
</filterset>

<!-- generate maven relocation artifact for org.firebirdsql.jdbc:jaybird -->
<condition property="maven.generateRelocation" value="true">
<javaversion exactly="1.7"/>
</condition>
<property name="maven.relocation.location" value="${build.maven}/relocation"/>
<property name="maven.relocation.template" value="${module.root}/build/maven-release/jaybird-relocation.pom"/>
<property name="maven.relocation.target" value="jaybird-${version.maven}.pom"/>

<property name="junit.timeout" value="600000"/> <!-- 10 minutes -->
<property name="junit.batchtest.todir" value="${build.reports}"/>
<property name="junit.jvm" value="java"/>
Expand Down Expand Up @@ -274,7 +273,12 @@
For details see: http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html
-->
<condition property="javadoc.additionalparam" value="-Xdoclint:none" else="">
<equals arg1="${jdk1.8}" arg2="true"/>
<javaversion exactly="1.8"/>
</condition>

</target>

<!-- dumps all properties to console, both defined by init and standard ant properties -->
<target name="showProperties" depends="init">
<echoproperties/>
</target>
58 changes: 58 additions & 0 deletions build/maven-release/jaybird-relocation.pom
@@ -0,0 +1,58 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.firebirdsql.jdbc</groupId>
<artifactId>jaybird</artifactId>
<version>@VERSION@</version>
<distributionManagement>
<relocation>
<artifactId>@ARTIFACT_ID@</artifactId>
</relocation>
</distributionManagement>
<packaging>pom</packaging>
<name>Jaybird JDBC Driver</name>
<description>JDBC Driver for the Firebird RDBMS</description>
<url>https://www.firebirdsql.org/en/devel-jdbc-driver/</url>
<developers>
<developer>
<id>mrotteveel</id>
<name>Mark Rotteveel</name>
<email>mark@lawinegevaar.nl</email>
<roles>
<role>Administrator</role>
<role>Developer</role>
</roles>
</developer>
</developers>

<licenses>
<license>
<name>GNU Lesser General Public License</name>
<url>https://www.gnu.org/copyleft/lesser.html</url>
<distribution>repo</distribution>
<comments>
The Jaybird JCA/JDBC driver is distributed free of charge under the
GNU Lesser General Public License (LGPL). Text of the license can be
obtained from http://www.gnu.org/copyleft/lesser.html
</comments>
</license>
<license>
<name>Modified BSD (3-clause) License</name>
<url>https://opensource.org/licenses/BSD-3-Clause</url>
<distribution>repo</distribution>
<comments>
The extension interfaces of Jaybird are defined under a modified BSD license
</comments>
</license>
</licenses>

<scm>
<connection>scm:git:https://github.com/FirebirdSQL/jaybird.git</connection>
<developerConnection>scm:git:git@github.com:FirebirdSQL/jaybird.git</developerConnection>
<url>https://github.com/FirebirdSQL/jaybird</url>
</scm>

<issueManagement>
<system>JIRA Tracker</system>
<url>http://tracker.firebirdsql.org/browse/JDBC</url>
</issueManagement>
</project>

0 comments on commit d81dc0c

Please sign in to comment.