From e4738364f7221fd77b49f1a4454eb95f62d6ceee Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Wed, 1 May 2024 11:28:54 +0200 Subject: [PATCH 1/2] - ensure the `project-name` (module name) is also used for caching the collector task output - not doing so might result in the same dependencies for 2 individual modules --- .../plugin/AboutLibrariesCollectorTask.kt | 15 ++++++++++++++- .../aboutlibraries/plugin/AboutLibrariesPlugin.kt | 6 +++--- .../aboutlibraries/plugin/api/GitHubApi.kt | 4 ++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesCollectorTask.kt b/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesCollectorTask.kt index 4f4144ea5..b2546adfa 100644 --- a/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesCollectorTask.kt +++ b/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesCollectorTask.kt @@ -3,7 +3,12 @@ package com.mikepenz.aboutlibraries.plugin import com.mikepenz.aboutlibraries.plugin.model.CollectedContainer import com.mikepenz.aboutlibraries.plugin.util.DependencyCollector import org.gradle.api.DefaultTask -import org.gradle.api.tasks.* +import org.gradle.api.tasks.CacheableTask +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.Internal +import org.gradle.api.tasks.OutputFile +import org.gradle.api.tasks.TaskAction +import org.slf4j.LoggerFactory import java.io.File @CacheableTask @@ -12,6 +17,9 @@ abstract class AboutLibrariesCollectorTask : DefaultTask() { @Internal protected val extension = project.extensions.getByName("aboutLibraries") as AboutLibrariesExtension + @Input + val projectName = project.name + @Input val includePlatform = extension.includePlatform @@ -37,9 +45,14 @@ abstract class AboutLibrariesCollectorTask : DefaultTask() { @TaskAction fun action() { + LOGGER.info("Collecting for: $projectName") if (!::collectedDependencies.isInitialized) { configure() } dependencyCache.writeText(groovy.json.JsonOutput.toJson(collectedDependencies)) } + + private companion object { + private val LOGGER = LoggerFactory.getLogger(AboutLibrariesCollectorTask::class.java)!! + } } \ No newline at end of file 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 1330ce30c..a94dfe0b1 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 @@ -69,9 +69,9 @@ class AboutLibrariesPlugin : Plugin { private val Project.experimentalCache: Boolean get() = hasProperty("org.gradle.unsafe.configuration-cache") && - property("org.gradle.unsafe.configuration-cache") == "true" || - hasProperty("org.gradle.configuration-cache") && - property("org.gradle.configuration-cache") == "true" + property("org.gradle.unsafe.configuration-cache") == "true" || + hasProperty("org.gradle.configuration-cache") && + property("org.gradle.configuration-cache") == "true" companion object { diff --git a/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/api/GitHubApi.kt b/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/api/GitHubApi.kt index 0b7158ba3..fd07627b7 100644 --- a/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/api/GitHubApi.kt +++ b/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/api/GitHubApi.kt @@ -13,7 +13,7 @@ import java.io.OutputStreamWriter import java.net.URL internal class GitHubApi( - private val gitHubToken: String? = null + private val gitHubToken: String? = null, ) : IApi { private var rateLimit: Int = 0 @@ -36,7 +36,7 @@ internal class GitHubApi( } limit } catch (t: Throwable) { - LOGGER.error("Could not retrieve `rate_limit`. Please check if the token is provided.") + LOGGER.error("Could not retrieve `rate_limit`. Please check if the token is provided. (${t.message})") 0 } } From dcb79303787cf14a71e97bfc42f086441c92d05e Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Wed, 1 May 2024 11:37:47 +0200 Subject: [PATCH 2/2] - [release] v11.1.4 --- README.md | 2 +- gradle.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2bef09234..51accab0f 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ ## Latest releases 🛠 -- Kotlin && Multiplatform && Compose && Plugin | [v11.1.3](https://github.com/mikepenz/AboutLibraries/tree/v11.1.3) +- Kotlin && Multiplatform && Compose && Plugin | [v11.1.4](https://github.com/mikepenz/AboutLibraries/tree/v11.1.4) ## Gradle Plugin diff --git a/gradle.properties b/gradle.properties index 32874ba86..8fc470863 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ GROUP=com.mikepenz -VERSION_NAME=11.1.3 -VERSION_CODE=110103 +VERSION_NAME=11.1.4 +VERSION_CODE=110104 POM_URL=https://github.com/mikepenz/AboutLibraries POM_SCM_URL=https://github.com/mikepenz/AboutLibraries POM_SCM_CONNECTION=scm:git@github.com:mikepenz/AboutLibraries.git