Blob Blame History Raw
From d556394814576860ec401b03202b8cb70fd367c6 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Tue, 10 Oct 2017 00:08:27 +0300
Subject: [PATCH] gradle local fixes

---
 bson/build.gradle              |  15 +---
 build.gradle                   | 164 +----------------------------------------
 driver-async/build.gradle      |  15 +---
 driver-core/build.gradle       |  23 ++----
 driver/build.gradle            |  16 +---
 mongo-java-driver/build.gradle |  15 +---
 util/build.gradle              |   3 +
 7 files changed, 18 insertions(+), 233 deletions(-)

diff --git a/bson/build.gradle b/bson/build.gradle
index 24e594c..9c8a8fc 100644
--- a/bson/build.gradle
+++ b/bson/build.gradle
@@ -15,30 +15,19 @@
  */
 
 apply plugin: 'osgi'
-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 {
-        instruction 'Build-Version', getGitVersion()
         instruction 'Import-Package',
                     'javax.xml.bind.*',
                     'org.slf4j;resolution:=optional'
     }
 }
 
-modifyPom {
-    project {
-        name 'BSON'
-        description 'The BSON library'
-        url 'http://bsonspec.org'
-    }
+sourceSets {
+    main { java.srcDirs = ['src/main'] }
 }
diff --git a/build.gradle b/build.gradle
index 475937d..9a861dc 100644
--- a/build.gradle
+++ b/build.gradle
@@ -27,11 +27,6 @@ buildscript {
         mavenCentral()
         mavenLocal()
     }
-    dependencies {
-        classpath 'org.kordamp.gradle:clirr-gradle-plugin:0.2.2'
-        classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:1.12.+'
-        classpath 'com.bmuschko:gradle-nexus-plugin:2.2'
-    }
 }
 
 //////////////////////////////////////////
@@ -40,7 +35,6 @@ buildscript {
 
 configure(subprojects.findAll { it.name != 'util' }) {
     apply plugin: 'java'
-    apply plugin: 'optional-base'
 
     evaluationDependsOn(':util')
 
@@ -56,7 +50,7 @@ configure(subprojects.findAll { it.name != 'util' }) {
     }
 
     dependencies {
-        compile 'org.slf4j:slf4j-api:1.7.6', optional
+        compile 'org.slf4j:slf4j-api:1.7.6'
     }
 
     /* Compiling */
@@ -131,161 +125,6 @@ configure(subprojects.findAll { it.name != 'util' }) {
     }
 }
 
-def getGitVersion() {
-    def outputAsString
-    new ByteArrayOutputStream().withStream { os ->
-        def result = exec {
-            executable 'git'
-            args 'describe', '--tags', '--always', '--dirty'
-            standardOutput = os
-        }
-        outputAsString = os.toString().substring(1).trim()
-    }
-    return outputAsString
-}
-
-configure(subprojects.findAll { it.name != 'util' && it.name != 'mongo-java-driver' }) {
-    apply plugin: 'checkstyle'
-    apply plugin: 'findbugs'
-    apply plugin: 'jacoco'
-    apply plugin: 'groovy'
-    apply plugin: 'codenarc'
-
-    dependencies {
-        testCompile 'org.codehaus.groovy:groovy-all:2.3.9'
-        testCompile 'org.spockframework:spock-core:1.1-groovy-2.3-SNAPSHOT'
-        testCompile 'cglib:cglib-nodep:2.2.2'
-        testCompile 'org.objenesis:objenesis:1.3'
-        testCompile 'org.hamcrest:hamcrest-all:1.3'
-        testCompile 'ch.qos.logback:logback-classic:1.1.1'
-        testCompile project(':util') //Adding categories to classpath
-    }
-
-    sourceSets {
-        main {
-            java.srcDirs = ['src/main']
-        }
-        test {
-            groovy.srcDirs = ['src/test/functional', 'src/test/unit']
-            java.srcDirs = ['src/test/functional', 'src/test/unit']
-        }
-    }
-
-    /* Testing */
-    tasks.withType(Test) {
-        maxHeapSize = "3g"
-        maxParallelForks = 1
-
-        systemProperties(
-                'org.mongodb.test.uri': System.getProperty('org.mongodb.test.uri', null),
-                'org.mongodb.useSocket': System.getProperty('org.mongodb.useSocket', 'false'),
-                'org.mongodb.disableAsync': System.getProperty('org.mongodb.disableAsync', 'false'),
-                'org.mongodb.async.type': System.getProperty('org.mongodb.async.type', 'nio2'),
-
-                'javax.net.ssl.trustStore': System.getProperty('javax.net.ssl.trustStore', "${System.getProperty('user.home')}/.keystore"),
-                'javax.net.ssl.keyStore': System.getProperty('javax.net.ssl.keyStore', "${System.getProperty('user.home')}/.keystore"),
-                'javax.net.ssl.keyStorePassword': System.getProperty('javax.net.ssl.keyStorePassword', 'changeit'),
-                'javax.net.ssl.trustStorePassword': System.getProperty('javax.net.ssl.trustStorePassword', 'changeit')
-        )
-
-        if (project.buildingWith('ssl.enabled')) {
-            systemProperties(
-                    'javax.net.ssl.keyStoreType': project.property('ssl.keyStoreType'),
-                    'javax.net.ssl.keyStore': project.property('ssl.keyStore'),
-                    'javax.net.ssl.keyStorePassword': project.property('ssl.keyStorePassword'),
-                    'javax.net.ssl.trustStoreType': project.property('ssl.trustStoreType'),
-                    'javax.net.ssl.trustStore': project.property('ssl.trustStore'),
-                    'javax.net.ssl.trustStorePassword': project.property('ssl.trustStorePassword')
-            )
-        }
-
-        if (project.buildingWith('gssapi.enabled')) {
-            systemProperties(
-                    'sun.security.krb5.debug': project.getProperty('sun.security.krb5.debug'),
-                    'javax.security.auth.useSubjectCredsOnly': "false",
-                    'java.security.krb5.kdc': project.getProperty('krb5.kdc'),
-                    'java.security.krb5.realm': project.getProperty('krb5.realm'),
-                    'java.security.auth.login.config': project.getProperty('auth.login.config'),
-                    )
-        }
-
-        useJUnit {
-            if (!project.buildingWith('rs.enabled')) {
-                excludeCategories 'category.ReplicaSet'
-            }
-            if (project.buildingWith('quicktest')) {
-                excludeCategories 'category.SlowUnit'
-            }
-            if (project.buildingWith('travistest')) {
-                excludeCategories 'category.SlowUnit', 'category.Slow'
-            }
-        }
-
-        jacoco { enabled = false }
-
-        beforeTest { descr ->
-            logger.info("[Test ${descr.className} > ${descr.name}]")
-        }
-
-        afterTest { descr, result ->
-                def failureStartTime = result.getResultType().toString() == "FAILURE" ? " Started at: ${result.getStartTime()}" : ""
-                logger.info("[Test ${descr.className} > ${descr.name}] ${result.getResultType()} "
-                        + "(${result.getEndTime() - result.getStartTime()} ms) ${failureStartTime}")
-
-        }
-
-        testLogging { exceptionFormat = 'full' }
-    }
-
-    task testSlowUnit(type: Test) {
-        useJUnit {
-            includeCategories 'category.SlowUnit'
-        }
-    }
-
-    gradle.taskGraph.whenReady { taskGraph ->
-        if (taskGraph.hasTask(testCoverage)) {
-            tasks.withType(Test) { jacoco { enabled = true } }
-        }
-    }
-
-    task testCoverage(dependsOn: test)
-
-    /* Code quality */
-
-    checkstyle {
-        toolVersion = "6.2"
-        configFile = new File(configDir, 'checkstyle.xml')
-        configProperties.checkstyleConfigDir = configDir
-    }
-
-    findbugs {
-        excludeFilter = new File(configDir, 'findbugs-exclude.xml')
-        sourceSets = [sourceSets.main]
-        toolVersion = '3.0.1'
-    }
-
-    codenarc {
-        toolVersion = '0.24'
-        reportFormat = project.buildingWith('xmlReports.enabled') ? 'xml' : 'html'
-    }
-
-    tasks.withType(FindBugs) {
-        reports {
-            xml.enabled = project.buildingWith('xmlReports.enabled')
-            html.enabled = !project.buildingWith('xmlReports.enabled')
-        }
-    }
-}
-
-task docs(type: Javadoc) {
-    source subprojects.grep({ it.name != 'util' }).collect {project -> project.sourceSets.main.allJava }
-    options = subprojects.first().javadoc.options
-    dependsOn = subprojects.first().javadoc.dependsOn
-    excludes =  subprojects.first().javadoc.excludes
-    classpath = files(subprojects.collect {project -> project.sourceSets.main.compileClasspath})
-    destinationDir = new File(projectDir, 'build/docs')
-}
 
 //////////////////////////////////////////
 // Root project configuration           //
@@ -301,5 +140,4 @@ gradle.buildFinished { BuildResult result ->
     }
 }
 
-apply from: 'gradle/deploy.gradle'
 
diff --git a/driver-async/build.gradle b/driver-async/build.gradle
index 67c3f14..6b22a90 100644
--- a/driver-async/build.gradle
+++ b/driver-async/build.gradle
@@ -15,7 +15,6 @@
  */
 
 apply plugin: 'osgi'
-apply plugin: 'org.kordamp.gradle.clirr'
 
 def configDir = new File(rootDir, 'config')
 archivesBaseName = 'mongodb-driver-async'
@@ -32,21 +31,11 @@ dependencies {
     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'
-        description 'The MongoDB Asynchronous Driver'
-        url 'http://www.mongodb.org'
-    }
+sourceSets {
+    main { java.srcDirs = ['src/main'] }
 }
diff --git a/driver-core/build.gradle b/driver-core/build.gradle
index 851fb74..aa6228d 100644
--- a/driver-core/build.gradle
+++ b/driver-core/build.gradle
@@ -15,30 +15,22 @@
  */
 
 apply plugin: 'osgi'
-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"
+    compile "io.netty:netty-transport:$nettyVersion"
+    compile "io.netty:netty-handler:$nettyVersion"
 
     testCompile project(':bson').sourceSets.test.output
 }
 
 jar {
     manifest {
-        instruction 'Build-Version', getGitVersion()
         instruction 'Import-Package',
                     'org.bson.*',                       // unfortunate that this is necessary, but if it's left out then it's not included
                     'javax.crypto.*',
@@ -54,11 +46,6 @@ jar {
     }
 }
 
-modifyPom {
-    project {
-        name 'MongoDB Java Driver Core'
-        description 'The Java operations layer for the MongoDB Java Driver. Third parties can \' +\n' +
-                    '                                                   \'wrap this layer to provide custom higher-level APIs'
-        url 'http://www.mongodb.org'
-    }
+sourceSets {
+    main { java.srcDirs = ['src/main'] }
 }
diff --git a/driver/build.gradle b/driver/build.gradle
index 43391f8..31922a5 100644
--- a/driver/build.gradle
+++ b/driver/build.gradle
@@ -14,8 +14,6 @@
  * limitations under the License.
  */
 
-apply plugin: 'org.kordamp.gradle.clirr'
-
 archivesBaseName = 'mongodb-driver'
 def configDir = new File(rootDir, 'config')
 
@@ -35,21 +33,11 @@ dependencies {
     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'
-        description 'The MongoDB Driver'
-        url 'http://www.mongodb.org'
-    }
+sourceSets {
+    main { java.srcDirs = ['src/main'] }
 }
diff --git a/mongo-java-driver/build.gradle b/mongo-java-driver/build.gradle
index 336db8c..99c0a1e 100644
--- a/mongo-java-driver/build.gradle
+++ b/mongo-java-driver/build.gradle
@@ -29,9 +29,9 @@ idea {
 
 // 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"
+    compile "io.netty:netty-transport:$nettyVersion"
+    compile "io.netty:netty-handler:$nettyVersion"
 }
 
 // srcDirs copied as well, so everything is compiled twice
@@ -46,7 +46,6 @@ sourceSets {
 // copied from driver-core
 jar {
     manifest {
-        instruction 'Build-Version', getGitVersion()
         instruction 'Import-Package',
                     'javax.xml.bind.*',
                     'javax.crypto.*',
@@ -61,12 +60,4 @@ jar {
                     'io.netty.*;resolution:=optional',
                     'org.slf4j;resolution:=optional'
     }
-    }
-
-modifyPom {
-    project {
-        name 'MongoDB Java Driver'
-        description 'The MongoDB Java Driver uber-artifact, containing mongodb-driver, mongodb-driver-core, and bson'
-        url 'http://www.mongodb.org'
-    }
 }
diff --git a/util/build.gradle b/util/build.gradle
index ba3d0e4..da4b4c7 100644
--- a/util/build.gradle
+++ b/util/build.gradle
@@ -19,6 +19,9 @@ apply plugin: 'java'
 sourceCompatibility = '1.6'
 targetCompatibility = '1.6'
 
+group = 'org.mongodb'
+archivesBaseName = 'mongodb-javadoc-utils'
+
 dependencies {
     compile files("${System.getProperty('java.home')}/../lib/tools.jar")
 }
-- 
2.13.6