Skip to content

#37 Migrate build system away from Ant (WIP) #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@
/out/
/tmp/
junit*.properties
/target/
/.DS_Store
/.classpath
/.project
/.settings
6 changes: 3 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<project name="RabbitMQ Java client" default="build"
xmlns:bundlor="antlib:com.springsource.bundlor.ant">

<property file="build.properties"/>
<property file="config.properties"/>
<property file="${basedir}/src/test/resources/build.properties"/>
<property file="${basedir}/src/test/resources/config.properties"/>
<property environment="env"/>

<path id="javac.classpath">
Expand Down Expand Up @@ -81,7 +81,7 @@

<target name="build" depends="amqp-generate" description="Build the client library.">
<mkdir dir="${javac.out}"/>
<copy file="src/com/rabbitmq/client/impl/ClientVersion.java.in"
<copy file="${maven.src.home}/com/rabbitmq/client/impl/ClientVersion.java.in"
tofile="${src.generated}/com/rabbitmq/client/impl/ClientVersion.java">
<filterset>
<filter token="VERSION" value="${impl.version}"/>
Expand Down
352 changes: 276 additions & 76 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,77 +1,277 @@
<?xml version="1.0"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
<version>VERSION</version>
<packaging>jar</packaging>
<name>RabbitMQ Java Client</name>
<description>RabbitMQ Java client</description>
<url>http://www.rabbitmq.com</url>

<licenses>
<license>
<name>ASL 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
<license>
<name>GPL v2</name>
<url>http://www.gnu.org/licenses/gpl-2.0.txt</url>
<distribution>repo</distribution>
</license>
<license>
<name>MPL 1.1</name>
<url>http://www.mozilla.org/MPL/MPL-1.1.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<scm>
<url>https://github.com/rabbitmq/rabbitmq-java-client.git</url>
<connection>scm:git:https://github.com/rabbitmq/rabbitmq-java-client.git</connection>
</scm>

<developers>
<developer>
<id>rabbitmq.team</id>
<name>The RabbitMQ Team</name>
<roles>
<role>Developer</role>
</roles>
</developer>
</developers>

<dependencies>

<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>

</dependencies>

<distributionManagement>
<repository>
<id>sonatype-nexus-staging</id>
<name>Nexus Release Repository</name>
<url>http://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</project>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
<version>3.6.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>RabbitMQ Java Client</name>
<description>RabbitMQ Java client</description>
<url>http://www.rabbitmq.com</url>

<licenses>
<license>
<name>ASL 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
<license>
<name>GPL v2</name>
<url>http://www.gnu.org/licenses/gpl-2.0.txt</url>
<distribution>repo</distribution>
</license>
<license>
<name>MPL 1.1</name>
<url>http://www.mozilla.org/MPL/MPL-1.1.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<scm>
<url>https://github.com/rabbitmq/rabbitmq-java-client.git</url>
<connection>scm:git:https://github.com/rabbitmq/rabbitmq-java-client.git</connection>
</scm>

<developers>
<developer>
<id>rabbitmq.team</id>
<name>The RabbitMQ Team</name>
<roles>
<role>Developer</role>
</roles>
</developer>
</developers>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<!-- Clean generated sources at clean phase -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/build</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<target name="amqp-generate-check" description="check if codegen needs to be run">
<uptodate property="amqp.generate.notRequired">
<srcfiles file="codegen.py"/>
<srcfiles dir="${codegen.dir}">
<include name="*"/>
</srcfiles>
<compositemapper>
<mapper type="merge" to="${basedir}/${src.generated}/com/rabbitmq/client/impl/AMQImpl.java"/>
<mapper type="merge" to="${basedir}/${src.generated}/com/rabbitmq/client/AMQP.java"/>
</compositemapper>
</uptodate>
</target>
<target name="amqp-generate" depends="amqp-generate-check" unless="amqp.generate.notRequired"
description="generate AMQP.java and AMQImpl.java from AMQP spec">
<property name="AMQP_SPEC_JSON_PATH" value="${codegen.dir}/amqp-rabbitmq-${spec.version}.json"/>
<mkdir dir="${src.generated}/com/rabbitmq/client/"/>
<exec dir="." executable="${python.bin}" errorproperty="amqp.generate.error1" resultproperty="amqp.generate.result1">
<arg line="codegen.py"/>
<arg line="header"/>
<arg line="${AMQP_SPEC_JSON_PATH}"/>
<arg line="${src.generated}/com/rabbitmq/client/AMQP.java"/>
</exec>
<fail message="Generation of AMQP.java failed with message:${line.separator}${amqp.generate.error1}">
<condition>
<not>
<equals arg1="${amqp.generate.result1}" arg2="0"/>
</not>
</condition>
</fail>
<mkdir dir="${src.generated}/com/rabbitmq/client/impl"/>
<exec dir="." executable="${python.bin}" errorproperty="amqp.generate.error2" resultproperty="amqp.generate.result2">
<arg line="codegen.py"/>
<arg line="body"/>
<arg line="${AMQP_SPEC_JSON_PATH}"/>
<arg line="${src.generated}/com/rabbitmq/client/impl/AMQImpl.java"/>
</exec>
<fail message="Generation of AMQPImpl.java failed with message:${line.separator}${amqp.generate.error2}">
<condition>
<not>
<equals arg1="${amqp.generate.result2}" arg2="0"/>
</not>
</condition>
</fail>
</target>
<target>
<property file="${basedir}/src/test/resources/build.properties"/>
<ant target="amqp-generate"/>
<copy file="${maven.src.home}/com/rabbitmq/client/impl/ClientVersion.java.in" tofile="${src.generated}/com/rabbitmq/client/impl/ClientVersion.java">
<filterset>
<filter token="VERSION" value="${impl.version}"/>
<!-- <filter token="VERSION" value="${project.version}"/> -->
</filterset>
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>build/gensrc</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgs>
<arg>-Xlint:deprecation</arg>
<arg>-Xlint:unchecked</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version>
<configuration>
<systemPropertyVariables>
<buildDirectory>${project.build.directory}</buildDirectory>
</systemPropertyVariables>
<failIfNoTests>true</failIfNoTests>
<includes>
<include>**/ClientTests.*</include>
<include>**/FunctionalTests.*</include>
<include>**/SSLTests.*</include>
<include>**/ServerTests.*</include>
<include>**/FunctionalTests.*</include>
<include>**/HATests.*</include>
<include>**/TestMain.*</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<useDefaultManifestFile>true</useDefaultManifestFile>
<archive>
<addMavenDescriptor>true</addMavenDescriptor>
<index>true</index>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<goals>
<goal>jar</goal>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<goals>
<goal>jar</goal>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
<executions>
<execution>
<goals>
<goal>jar</goal>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
</plugins>
</build>

<distributionManagement>
<repository>
<id>sonatype-nexus-staging</id>
<name>Nexus Release Repository</name>
<url>http://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</project>
Loading