You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polaris.apache.org by sn...@apache.org on 2026/06/13 07:37:13 UTC

(polaris) branch main updated: Build: eliminate cross-project dependencies in license-report and checks (#4717)

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

snazy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git


The following commit(s) were added to refs/heads/main by this push:
     new a20d86dd09 Build: eliminate cross-project dependencies in license-report and checks (#4717)
a20d86dd09 is described below

commit a20d86dd09efbca80e7141ae9264e7d8649442c2
Author: Robert Stupp <sn...@snazy.de>
AuthorDate: Sat Jun 13 09:37:09 2026 +0200

    Build: eliminate cross-project dependencies in license-report and checks (#4717)
    
    This change eliminates cross-project dependencies, which can introduce configuration coordination issues.
    This is cleaner than relying on `afterEvaluate` and prevents eager subprojects resolution.
---
 .../main/kotlin/polaris-license-report.gradle.kts  | 48 +++++++++++-----------
 1 file changed, 23 insertions(+), 25 deletions(-)

diff --git a/build-logic/src/main/kotlin/polaris-license-report.gradle.kts b/build-logic/src/main/kotlin/polaris-license-report.gradle.kts
index b03303a907..ed6c66fd99 100644
--- a/build-logic/src/main/kotlin/polaris-license-report.gradle.kts
+++ b/build-logic/src/main/kotlin/polaris-license-report.gradle.kts
@@ -29,29 +29,27 @@ import licenses.QuarkusAppDependencyFilter
 
 plugins { id("com.github.jk1.dependency-license-report") }
 
-afterEvaluate {
-  licenseReport {
-    filters =
-      arrayOf(
-        QuarkusAppDependencyFilter(),
-        LicenseBundleNormalizer(
-          "${rootProject.projectDir}/gradle/license/normalizer-bundle.json",
-          false,
-        ),
-        NoticeFileLicenseFilter(),
-        LicenseFileValidation(),
-      )
-    allowedLicensesFile = rootProject.projectDir.resolve("gradle/license/allowed-licenses.json")
-    renderers =
-      arrayOf<ReportRenderer>(
-        InventoryHtmlReportRenderer("index.html"),
-        JsonReportRenderer(),
-        XmlReportRenderer(),
-      )
-    excludeBoms = true
-    outputDir = "${project.layout.buildDirectory.get()}/reports/dependency-license"
-    configurations = arrayOf("quarkusProdRuntimeClasspathConfiguration")
-  }
+val normalizerBundle = layout.settingsDirectory.file("gradle/license/normalizer-bundle.json")
+val allowedLicenses = layout.settingsDirectory.file("gradle/license/allowed-licenses.json")
+
+licenseReport {
+  filters =
+    arrayOf(
+      QuarkusAppDependencyFilter(),
+      LicenseBundleNormalizer(normalizerBundle.asFile.absolutePath, false),
+      NoticeFileLicenseFilter(),
+      LicenseFileValidation(),
+    )
+  allowedLicensesFile = allowedLicenses.asFile
+  renderers =
+    arrayOf<ReportRenderer>(
+      InventoryHtmlReportRenderer("index.html"),
+      JsonReportRenderer(),
+      XmlReportRenderer(),
+    )
+  excludeBoms = true
+  outputDir = layout.buildDirectory.dir("reports/dependency-license").get().asFile.absolutePath
+  configurations = arrayOf("quarkusProdRuntimeClasspathConfiguration")
 }
 
 val generateLicenseReport =
@@ -59,8 +57,8 @@ val generateLicenseReport =
     dependsOn("quarkusBuild")
     inputs
       .files(
-        rootProject.projectDir.resolve("gradle/license/normalizer-bundle.json"),
-        rootProject.projectDir.resolve("gradle/license/allowed-licenses.json"),
+        normalizerBundle,
+        allowedLicenses,
         project.layout.buildDirectory.file("quarkus-app/quarkus-app-dependencies.txt"),
       )
       .withPathSensitivity(PathSensitivity.RELATIVE)