[mongo-java-driver] 01/01: Switch build system from Maven to Gradle

Christopher Hoskin christopher.hoskin at gmail.com
Fri Aug 19 14:42:06 UTC 2016


This is an automated email from the git hooks/post-receive script.

grinorcole-guest pushed a commit to branch master
in repository mongo-java-driver.

commit d8f88b503592336b0be7f3f75827744008a2ea16
Author: Christopher Hoskin <christopher.hoskin at gmail.com>
Date:   Fri Aug 19 14:44:25 2016 +0100

    Switch build system from Maven to Gradle
---
 debian/changelog             |   1 +
 debian/control               |   3 +-
 debian/libmongodb-java.jlibs |   7 ++
 debian/maven.ignoreRules     |  20 +++-
 debian/patches/build.patch   | 237 +++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series        |   1 +
 debian/rules                 |   2 +-
 7 files changed, 266 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index feb839b..3fb4b2f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@ mongo-java-driver (3.3.0-1) UNRELEASED; urgency=medium
   [ Christopher Hoskin ]
   * Import new upstream (3.3.0)
   * Update debian/copyright
+  * Switch build system from Maven to Gradle
 
  -- Christopher Hoskin <christopher.hoskin at gmail.com>  Fri, 19 Aug 2016 13:50:19 +0100
 
diff --git a/debian/control b/debian/control
index ba2fe20..0ec4bb6 100644
--- a/debian/control
+++ b/debian/control
@@ -3,8 +3,7 @@ Section: java
 Priority: optional
 Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
 Uploaders: Emmanuel Bourg <ebourg at apache.org>
-Build-Depends: debhelper (>= 9), default-jdk, maven-debian-helper (>= 1.5)
-Build-Depends-Indep: libmaven-bundle-plugin-java, junit4
+Build-Depends: debhelper (>= 9), default-jdk, gradle-debian-helper, javahelper, libnetty-java
 Standards-Version: 3.9.6
 Vcs-Git: git://anonscm.debian.org/pkg-java/mongo-java-driver.git
 Vcs-Browser: http://anonscm.debian.org/cgit/pkg-java/mongo-java-driver.git
diff --git a/debian/libmongodb-java.jlibs b/debian/libmongodb-java.jlibs
new file mode 100644
index 0000000..ce838c8
--- /dev/null
+++ b/debian/libmongodb-java.jlibs
@@ -0,0 +1,7 @@
+mongo-java-driver/build/libs/mongo-java-driver-3.3.0.jar
+driver-core/build/libs/mongodb-driver-core-3.3.0.jar
+driver/build/libs/mongodb-driver-3.3.0.jar
+bson/build/libs/bson-3.3.0.jar
+driver-async/build/libs/mongodb-driver-async-3.3.0.jar
+util/build/libs/util.jar
+
diff --git a/debian/maven.ignoreRules b/debian/maven.ignoreRules
index ebc9a76..4337ab0 100644
--- a/debian/maven.ignoreRules
+++ b/debian/maven.ignoreRules
@@ -1,2 +1,18 @@
-
-org.apache.maven.plugins maven-source-plugin * * * *
+# Maven ignore rules - ignore some Maven dependencies and plugins
+# Format of this file is:
+# [group] [artifact] [type] [version] [classifier] [scope]
+# where each element can be either
+# - the exact string, for example org.apache for the group, or 3.1
+#   for the version. In this case, the element is simply matched
+#   and left as it is
+# - * (the star character, alone). In this case, anything will
+#   match and be left as it is. For example, using * on the
+#  position of the artifact field will match any artifact id
+# All elements much match before a rule can be applied
+# Example rule: match jar with groupid= junit, artifactid= junit
+# and version starting with 3., this dependency is then removed
+# from the POM
+#   junit junit jar s/3\..*/3.x/
+org.kordamp.gradle clirr-gradle-plugin * * * *
+com.bmuschko gradle-nexus-plugin * * * *
+org.sonatype.oss oss-parent * * * *
diff --git a/debian/patches/build.patch b/debian/patches/build.patch
new file mode 100644
index 0000000..ff45c18
--- /dev/null
+++ b/debian/patches/build.patch
@@ -0,0 +1,237 @@
+Description: Modify the Gradle build to work on Debian
+Author: Christopher Hoskin <christopher.hoskin at gmail.com>
+Forwarded: not-needed
+Last-Update: 2016-08-19
+
+--- a/build.gradle
++++ b/build.gradle
+@@ -29,7 +29,7 @@
+     }
+     dependencies {
+         classpath 'org.kordamp.gradle:clirr-gradle-plugin:0.2.2'
+-        classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:1.12.+'
++//        classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:1.12.+'
+         classpath 'com.bmuschko:gradle-nexus-plugin:2.2'
+     }
+ }
+@@ -40,7 +40,7 @@
+ 
+ configure(subprojects.findAll { it.name != 'util' }) {
+     apply plugin: 'java'
+-    apply plugin: 'optional-base'
++//    apply plugin: 'optional-base'
+ 
+     evaluationDependsOn(':util')
+ 
+@@ -56,7 +56,7 @@
+     }
+ 
+     dependencies {
+-        compile 'org.slf4j:slf4j-api:1.7.6', optional
++        compile 'org.slf4j:slf4j-api:1.7.6' //, optional
+     }
+ 
+     /* Compiling */
+--- a/gradle/deploy.gradle
++++ b/gradle/deploy.gradle
+@@ -20,8 +20,9 @@
+  * Ensure you have configured ~/.gradle/gradle.properties for both the nexus and signing plugins
+  */
+ configure(subprojects - project(':util')) {
+-    apply plugin: 'com.bmuschko.nexus'
++//    apply plugin: 'com.bmuschko.nexus'
+ 
++/*
+     modifyPom {
+         project {
+ 
+@@ -55,6 +56,7 @@
+         // no need to publish test dependencies
+         pom.dependencies.removeAll { it.scope == "test" }
+     }
++*/
+ 
+     task uploadSnapshotArchives(dependsOn: uploadArchives) {
+         if (!version.endsWith("-SNAPSHOT")) {
+--- a/bson/build.gradle
++++ b/bson/build.gradle
+@@ -15,16 +15,18 @@
+  */
+ 
+ apply plugin: 'osgi'
+-apply plugin: 'org.kordamp.gradle.clirr'
++//apply plugin: 'org.kordamp.gradle.clirr'
+ 
+ def configDir = new File(rootDir, 'config')
+ archivesBaseName = 'bson'
+ 
++/*
+ clirr {
+     excludeFilter = new File("$configDir/clirr-exclude.yml")
+     baseline 'org.mongodb:bson:3.2.0'
+     failOnErrors = true
+ }
++*/
+ 
+ jar {
+     manifest {
+@@ -34,6 +36,7 @@
+     }
+ }
+ 
++/*
+ modifyPom {
+     project {
+         name 'BSON'
+@@ -41,3 +44,4 @@
+         url 'http://bsonspec.org'
+     }
+ }
++*/
+--- a/driver-async/build.gradle
++++ b/driver-async/build.gradle
+@@ -15,7 +15,7 @@
+  */
+ 
+ apply plugin: 'osgi'
+-apply plugin: 'org.kordamp.gradle.clirr'
++//apply plugin: 'org.kordamp.gradle.clirr'
+ 
+ def configDir = new File(rootDir, 'config')
+ archivesBaseName = 'mongodb-driver-async'
+@@ -32,17 +32,20 @@
+     testCompile project(':driver-core').sourceSets.test.output
+ }
+ 
++/*
+ clirr {
+     excludeFilter = new File("$configDir/clirr-exclude.yml")
+     baseline 'org.mongodb:mongodb-driver-async:3.2.0'
+     failOnErrors = false
+ }
++*/
+ 
+ tasks.withType(Checkstyle) {
+     // needed so the Javadoc checks can find the code in other modules
+     classpath = files(project(':driver-core').sourceSets.main.output, sourceSets.main.output);
+ }
+ 
++/*
+ modifyPom {
+     project {
+         name 'MongoDB Asynchronous Driver'
+@@ -50,3 +53,4 @@
+         url 'http://www.mongodb.org'
+     }
+ }
++*/
+--- a/driver-core/build.gradle
++++ b/driver-core/build.gradle
+@@ -15,23 +15,25 @@
+  */
+ 
+ apply plugin: 'osgi'
+-apply plugin: 'org.kordamp.gradle.clirr'
++//apply plugin: 'org.kordamp.gradle.clirr'
+ 
+ def configDir = new File(rootDir, 'config')
+ archivesBaseName = 'mongodb-driver-core'
+ 
++/*
+ clirr {
+     excludeFilter = new File("$configDir/clirr-exclude.yml")
+     baseline 'org.mongodb:mongodb-driver-core:3.2.0'
+     failOnErrors = false
+ }
++*/
+ 
+ dependencies {
+     compile project(':bson')
+ 
+-    compile "io.netty:netty-buffer:$nettyVersion", optional
+-    compile "io.netty:netty-transport:$nettyVersion", optional
+-    compile "io.netty:netty-handler:$nettyVersion", optional
++    compile "io.netty:netty-buffer:$nettyVersion" //, optional
++    compile "io.netty:netty-transport:$nettyVersion" //, optional
++    compile "io.netty:netty-handler:$nettyVersion" //, optional
+ 
+     testCompile project(':bson').sourceSets.test.output
+ }
+@@ -53,6 +55,7 @@
+     }
+ }
+ 
++/*
+ modifyPom {
+     project {
+         name 'MongoDB Java Driver Core'
+@@ -61,3 +64,4 @@
+         url 'http://www.mongodb.org'
+     }
+ }
++*/
+--- a/driver/build.gradle
++++ b/driver/build.gradle
+@@ -14,7 +14,7 @@
+  * limitations under the License.
+  */
+ 
+-apply plugin: 'org.kordamp.gradle.clirr'
++//apply plugin: 'org.kordamp.gradle.clirr'
+ 
+ archivesBaseName = 'mongodb-driver'
+ def configDir = new File(rootDir, 'config')
+@@ -35,17 +35,20 @@
+     testCompile project(':driver-core').sourceSets.test.output
+ }
+ 
++/*
+ clirr {
+     excludeFilter = new File("$configDir/clirr-exclude.yml")
+     baseline 'org.mongodb:mongodb-driver:3.2.0'
+     failOnErrors = false
+ }
++*/
+ 
+ tasks.withType(Checkstyle) {
+     // needed so the Javadoc checks can find the code in other modules
+     classpath = files(project(':driver-core').sourceSets.main.output, sourceSets.main.output);
+ }
+ 
++/*
+ modifyPom {
+     project {
+         name 'MongoDB Driver'
+@@ -53,3 +56,4 @@
+         url 'http://www.mongodb.org'
+     }
+ }
++*/
+--- a/mongo-java-driver/build.gradle
++++ b/mongo-java-driver/build.gradle
+@@ -29,9 +29,9 @@
+ 
+ // dependencies copied from driver-core
+ dependencies {
+-    compile "io.netty:netty-buffer:$nettyVersion", optional
+-    compile "io.netty:netty-transport:$nettyVersion", optional
+-    compile "io.netty:netty-handler:$nettyVersion", optional
++    compile "io.netty:netty-buffer:$nettyVersion" //, optional
++    compile "io.netty:netty-transport:$nettyVersion" //, optional
++    compile "io.netty:netty-handler:$nettyVersion" //, optional
+ }
+ 
+ // srcDirs copied as well, so everything is compiled twice
+@@ -61,6 +61,7 @@
+     }
+     }
+ 
++/*
+ modifyPom {
+     project {
+         name 'MongoDB Java Driver'
+@@ -68,3 +69,4 @@
+         url 'http://www.mongodb.org'
+     }
+ }
++*/
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..5879227
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+build.patch
diff --git a/debian/rules b/debian/rules
index f39cf2f..5c3b520 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,7 +3,7 @@
 export JAVA_HOME := /usr/lib/jvm/default-java
 
 %:
-	dh $@ --buildsystem=maven
+	dh $@ --buildsystem=gradle --with javahelper
 
 get-orig-source:
 	uscan --download-current-version --force-download --rename

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/mongo-java-driver.git



More information about the pkg-java-commits mailing list