You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by pr...@apache.org on 2018/12/06 01:10:34 UTC

[geode] branch develop updated: GEODE-5883: Add Nebula dependency linter as gradle utility (#2939)

This is an automated email from the ASF dual-hosted git repository.

prhomberg pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 3611f1b  GEODE-5883: Add Nebula dependency linter as gradle utility (#2939)
3611f1b is described below

commit 3611f1bea944c45e074e1ff902cc06ce8a148ee4
Author: Patrick Rhomberg <pr...@pivotal.io>
AuthorDate: Wed Dec 5 17:10:25 2018 -0800

    GEODE-5883: Add Nebula dependency linter as gradle utility (#2939)
    
    * Introduce Nebula lint plugin, version 10.1.0
    * Update Nebula project plugin version 4.0.1 -> 5.1.0
    * Update gradle-git plugin version 1.3.2 -> 1.7.2
    
    * The lint plugin is intentionally not yet run as part of the project :check.
    Early introduction will be required by some subprojects,
    so that they may reference the plugin configuration.
---
 build.gradle       | 14 ++++++++++----
 gradle/lint.gradle | 29 +++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/build.gradle b/build.gradle
index 0c6012f..49997a5 100755
--- a/build.gradle
+++ b/build.gradle
@@ -24,13 +24,18 @@ buildscript {
   }
 
   dependencies {
-    classpath "org.ajoberstar:gradle-git:1.3.2"
+    // Newer versions of the nebula plugins require gradle-info-plugin 4.0.2 or higher, which in 
+    // depends on JGit 5.0.  Conversely, gradle-git relies of JGit 4.0.
+    // Be mindful of potential classpath issues when updating any of these three dependencies.
+    classpath "com.netflix.nebula:nebula-project-plugin:5.1.0"
+    classpath "com.netflix.nebula:gradle-lint-plugin:10.1.0"
+    classpath "org.ajoberstar:gradle-git:1.7.2"
+
     classpath "gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.3.1"
     classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.2'
     classpath "com.diffplug.spotless:spotless-plugin-gradle:3.10.0"
     classpath "me.champeau.gradle:jmh-gradle-plugin:0.4.7"
     classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
-    classpath "com.netflix.nebula:nebula-project-plugin:4.0.1"
   }
 }
 
@@ -75,6 +80,7 @@ apply from: "${scriptDir}/sonar.gradle"
 apply from: "${scriptDir}/rat.gradle"
 apply from: "${scriptDir}/docker.gradle"
 apply from: "${scriptDir}/spotless.gradle"
+apply from: "${scriptDir}/lint.gradle"
 apply from: "${scriptDir}/resolve-dependencies.gradle"
 
 subprojects {
@@ -99,9 +105,9 @@ ext.readScmInfo = { proj ->
     def git = org.ajoberstar.grgit.Grgit.open(currentDir: project(proj).projectDir)
     try {
       return [
-          'Source-Repository': git.branch.getCurrent().name,
+          'Source-Repository': git.branch.current.name,
           'Source-Revision'  : git.head().id,
-          'Source-Date'      : git.head().getDate().format('yyyy-MM-dd HH:mm:ss Z')
+          'Source-Date'      : git.head().date.format('yyyy-MM-dd HH:mm:ss Z')
       ] as Properties
     } finally {
       git.close()
diff --git a/gradle/lint.gradle b/gradle/lint.gradle
new file mode 100644
index 0000000..9d91f5a
--- /dev/null
+++ b/gradle/lint.gradle
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+allprojects {
+  apply plugin: 'nebula.lint'
+  gradleLint.rules = []
+  gradleLint.rules += 'overridden-dependency-version'
+  gradleLint.rules += 'unused-dependency'
+  gradleLint.rules += 'unused-exclude-by-dep'
+  gradleLint.rules += 'unused-exclude-by-conf'
+
+  gradleLint.alwaysRun = false
+  fixGradleLint.mustRunAfter(':combineReports')
+  lintGradle.mustRunAfter(':combineReports')
+}