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 4651527 commit 8457550
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 33 deletions.
26 changes: 16 additions & 10 deletions build/dist.xml
Expand Up @@ -35,16 +35,22 @@
<!-- =================================================================== -->
<!-- Puts the files in the right place for a (manual) Maven release -->
<!-- =================================================================== -->
<target name="mavenPrepare" depends="jars">
<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>

Expand Down
62 changes: 39 additions & 23 deletions build/init.xml
@@ -1,7 +1,8 @@
<?xml version="1.0"?>
<project name="init">
<target name="init">
<echo message="${ant.java.version}"/>
<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 @@ -16,54 +17,50 @@
<property name="build.id" value="${build.number}"/>

<!-- 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">
<istrue value="${jdk1.7}"/>
<javaversion exactly="1.7"/>
</condition>
<condition property="javac.level" value="1.7">
<istrue value="${jdk1.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">
<istrue value="${jdk1.8}"/>
<javaversion exactly="1.8"/>
</condition>
<condition property="javac.level" value="1.8">
<istrue value="${jdk1.8}"/>
<javaversion exactly="1.8"/>
</condition>

<!-- Java 9 specific properties -->
<condition property="jdk9" value="true">
<equals arg1="${ant.java.version}" arg2="9"/>
</condition>
<condition property="maven.jdkversion" value="jdk9">
<istrue value="${jdk9}"/>
<javaversion atleast="9"/>
</condition>
<condition property="javac.level" value="9">
<istrue value="${jdk9}"/>
<javaversion atleast="9"/>
</condition>

<condition property="java.module.arg" value="" else="">
<istrue value="${jdk9}"/>
<javaversion atleast="9"/>
</condition>

<condition property="jdbc.41" value="true">
<istrue value="${jdk1.7}"/>
<javaversion exactly="1.7"/>
</condition>

<condition property="jdbc.42" value="true">
<or>
<istrue value="${jdk1.8}"/>
<javaversion exactly="1.8"/>
<!-- temp fix TODO remove -->
<istrue value="${jdk9}"/>
<javaversion atleast="9"/>
</or>
</condition>

<echo message="maven.jdkversion: ${maven.jdkversion}"/>
<echo message="javac.level: ${javac.level}"/>
<echo message="jdbc.41: ${jdbc.41}"/>
<echo message="jdbc.42: ${jdbc.42}"/>

<property name="Name" value="Jaybird"/>
<property name="name" value="jaybird"/>

Expand All @@ -75,13 +72,13 @@
<!-- Manifest version info -->
<property name="specification.title" value="JSR 221 JDBC API"/>
<condition property="specification.version" value="4.1">
<istrue value="${jdk1.7}"/>
<javaversion exactly="1.7"/>
</condition>
<condition property="specification.version" value="4.2">
<istrue value="${jdk1.8}"/>
<javaversion exactly="1.8"/>
</condition>
<condition property="specification.version" value="4.3">
<istrue value="${jdk9}"/>
<javaversion atleast="9"/>
</condition>
<property name="specification.vendor" value="Oracle Corporation"/>

Expand Down Expand Up @@ -163,9 +160,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-template.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.8"/>
</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.jvm" value="java"/>
Expand Down Expand Up @@ -233,4 +244,9 @@
</condition>

</target>

<!-- dumps all properties to console, both defined by init and standard ant properties -->
<target name="showProperties" depends="init">
<echoproperties/>
</target>
</project>
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 8457550

Please sign in to comment.