From 50d4f02567032a2e18ba3fffec9dd4b82b524370 Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Wed, 3 May 2023 20:34:12 +0200 Subject: [PATCH 1/3] - use LOGGER instead of `println` in core plugin components - FIX https://github.com/mikepenz/AboutLibraries/issues/872 --- .../plugin/model/CollectedContainer.kt | 12 ++++++++---- .../aboutlibraries/plugin/util/LibrariesProcessor.kt | 2 +- .../mikepenz/aboutlibraries/plugin/util/PomLoader.kt | 9 +++++++-- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/model/CollectedContainer.kt b/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/model/CollectedContainer.kt index f8712fea3..ba0aa2d4d 100644 --- a/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/model/CollectedContainer.kt +++ b/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/model/CollectedContainer.kt @@ -1,11 +1,13 @@ package com.mikepenz.aboutlibraries.plugin.model import org.gradle.api.tasks.Input +import org.slf4j.Logger +import org.slf4j.LoggerFactory import java.io.Serializable data class CollectedContainer( // Map>> - @get:Input val dependencies: Map>> + @get:Input val dependencies: Map>>, ) : Serializable { /** * Retrieves the dependencies for a specific variant, if no variant is provided, will merge all found variants together. @@ -13,10 +15,10 @@ data class CollectedContainer( fun dependenciesForVariant(variant: String? = null): Map> { if (variant != null) { return dependencies[variant] ?: run { - println("Variant ($variant) was missing from dependencies, this should never happen") - println("Available variants:") + LOGGER.warn("Variant ($variant) was missing from dependencies, this should never happen") + LOGGER.warn("Available variants:") dependencies.keys.forEach { - println("-- $it") + LOGGER.warn("-- $it") } emptyMap() } @@ -37,6 +39,8 @@ data class CollectedContainer( } companion object { + internal val LOGGER: Logger = LoggerFactory.getLogger(CollectedContainer::class.java) + @JvmStatic fun from(parsed: Map>>): CollectedContainer { val target: MutableMap>> = mutableMapOf() diff --git a/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/util/LibrariesProcessor.kt b/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/util/LibrariesProcessor.kt index a718b3ded..9abf96c4f 100644 --- a/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/util/LibrariesProcessor.kt +++ b/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/util/LibrariesProcessor.kt @@ -153,7 +153,7 @@ class LibrariesProcessor( for (pattern in exclusionPatterns) { if (pattern.matcher(uniqueId).matches()) { - println("--> Skipping ${uniqueId}, matching exclusion pattern") + LOGGER.info("--> Skipping ${uniqueId}, matching exclusion pattern") return null } } diff --git a/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/util/PomLoader.kt b/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/util/PomLoader.kt index 641586c20..89de20f5d 100644 --- a/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/util/PomLoader.kt +++ b/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/util/PomLoader.kt @@ -18,7 +18,12 @@ object PomLoader { * * Logic based on: https://github.com/ben-manes/gradle-versions-plugin */ - fun DependencyHandler.resolvePomFile(uniqueId: String?, id: ModuleVersionIdentifier, parent: Boolean, prefix: String = ""): File? { + fun DependencyHandler.resolvePomFile( + uniqueId: String?, + id: ModuleVersionIdentifier, + parent: Boolean, + prefix: String = "", + ): File? { try { LOGGER.debug("Attempting to resolve POM file for uniqueId={}, ModuleVersionIdentifier id={}", uniqueId, id); val resolutionResult = createArtifactResolutionQuery() @@ -39,7 +44,7 @@ object PomLoader { // todo identify if that ever has more than 1 if (artifact is ResolvedArtifactResult) { if (parent) { - println("${prefix}--> Retrieved POM for: $uniqueId from ${id.group}:${id.name}:${id.version}") + LOGGER.info("${prefix}--> Retrieved POM for: $uniqueId from ${id.group}:${id.name}:${id.version}") } return artifact.file } From b40c6e2f2c709bae685d1ce7dbc97e98f9c13cd5 Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Wed, 3 May 2023 21:45:24 +0200 Subject: [PATCH 2/3] - detect different property to enable configuration cache with gradle 8.x - FIX https://github.com/mikepenz/AboutLibraries/issues/870 --- .../mikepenz/aboutlibraries/plugin/AboutLibrariesPlugin.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesPlugin.kt b/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesPlugin.kt index 984eec201..259b39be4 100644 --- a/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesPlugin.kt +++ b/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesPlugin.kt @@ -5,7 +5,6 @@ import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.util.GradleVersion import org.slf4j.LoggerFactory -import java.util.* @Suppress("unused") // Public API for Gradle build scripts. class AboutLibrariesPlugin : Plugin { @@ -70,7 +69,9 @@ class AboutLibrariesPlugin : Plugin { private val Project.experimentalCache: Boolean get() = hasProperty("org.gradle.unsafe.configuration-cache") && - property("org.gradle.unsafe.configuration-cache") == "true" + property("org.gradle.unsafe.configuration-cache") == "true" || + hasProperty("org.gradle.configuration-cache") && + property("org.gradle.configuration-cache") == "true" companion object { From e15947fefd9ffbf1ec599e8be8a25f9d6077d203 Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Wed, 3 May 2023 21:53:42 +0200 Subject: [PATCH 3/3] - [release] v10.6.3 --- README.md | 2 +- gradle.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7820dc555..63fb19c55 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ ## Latest releases 🛠 -- (Next Gen) Kotlin && Multiplatform && Plugin | [v10.6.2](https://github.com/mikepenz/AboutLibraries/tree/v10.6.2) +- (Next Gen) Kotlin && Multiplatform && Plugin | [v10.6.3](https://github.com/mikepenz/AboutLibraries/tree/v10.6.3) - Kotlin && Gradle Plugin | [v8.9.4](https://github.com/mikepenz/AboutLibraries/tree/v8.9.4) ## Gradle Plugin diff --git a/gradle.properties b/gradle.properties index a4aac928e..a60fea457 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ GROUP=com.mikepenz -VERSION_NAME=10.6.2 -VERSION_CODE=100602 +VERSION_NAME=10.6.3 +VERSION_CODE=100603 POM_URL=https://github.com/mikepenz/AboutLibraries POM_SCM_URL=https://github.com/mikepenz/AboutLibraries