You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by vl...@apache.org on 2021/03/08 19:26:30 UTC

[calcite] 01/02: Apply com.autonomousapps.dependency-analysis plugin only when -PenableDependencyAnalysis is provided on a command line

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

vladimirsitnikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/calcite.git

commit 0378a560cc558698b928c9ebc088b905bd2d14c8
Author: Vladimir Sitnikov <si...@gmail.com>
AuthorDate: Mon Mar 8 22:21:31 2021 +0300

    Apply com.autonomousapps.dependency-analysis plugin only when -PenableDependencyAnalysis is provided on a command line
    
    The plugin is not 100% accurate yet, and it seems to cause "sourcesJar not executed as a part of assemble task"
    
    See https://github.com/apache/calcite/commit/b49693d31964657bf5058bd9387e505992cebd51
---
 build.gradle.kts | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/build.gradle.kts b/build.gradle.kts
index 5934ebb..d2f5e84 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -54,7 +54,7 @@ plugins {
     id("com.github.vlsi.gradle-extensions")
     id("com.github.vlsi.license-gather") apply false
     id("com.github.vlsi.stage-vote-release")
-    id("com.autonomousapps.dependency-analysis")
+    id("com.autonomousapps.dependency-analysis") apply false
 }
 
 repositories {
@@ -70,6 +70,7 @@ val lastEditYear by extra(lastEditYear())
 val enableSpotBugs = props.bool("spotbugs")
 val enableCheckerframework by props()
 val enableErrorprone by props()
+val enableDependencyAnalysis by props()
 val skipJandex by props()
 val skipCheckstyle by props()
 val skipAutostyle by props()
@@ -234,18 +235,21 @@ val buildSqllineClasspath by tasks.registering(Jar::class) {
     }
 }
 
-dependencyAnalysis {
-    // See https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin
-    // Most of the time the recommendations are good, however, there are cases the suggestsions
-    // are off, so we don't include the dependency analysis to CI workflow yet
-    // ./gradlew buildHealth --no-parallel --no-daemon
-    issues {
-        all { // all projects
-            onAny {
-                severity("fail")
-            }
-            onRedundantPlugins {
-                severity("ignore")
+if (enableDependencyAnalysis) {
+    apply(plugin = "com.autonomousapps.dependency-analysis")
+    configure<com.autonomousapps.DependencyAnalysisExtension> {
+        // See https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin
+        // Most of the time the recommendations are good, however, there are cases the suggestsions
+        // are off, so we don't include the dependency analysis to CI workflow yet
+        // ./gradlew -PenableDependencyAnalysis buildHealth --no-parallel --no-daemon
+        issues {
+            all { // all projects
+                onAny {
+                    severity("fail")
+                }
+                onRedundantPlugins {
+                    severity("ignore")
+                }
             }
         }
     }