Skip to content

Commit

Permalink
Merge pull request #875 from mikepenz/develop
Browse files Browse the repository at this point in the history
develop -> main
  • Loading branch information
mikepenz authored May 3, 2023
2 parents 9bacd99 + e15947f commit e105915
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Project> {
Expand Down Expand Up @@ -70,7 +69,9 @@ class AboutLibrariesPlugin : Plugin<Project> {

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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
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<Variant, Map<Identifier, Set<Versions>>>
@get:Input val dependencies: Map<String, Map<String, Set<String>>>
@get:Input val dependencies: Map<String, Map<String, Set<String>>>,
) : Serializable {
/**
* Retrieves the dependencies for a specific variant, if no variant is provided, will merge all found variants together.
*/
fun dependenciesForVariant(variant: String? = null): Map<String, Set<String>> {
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()
}
Expand All @@ -37,6 +39,8 @@ data class CollectedContainer(
}

companion object {
internal val LOGGER: Logger = LoggerFactory.getLogger(CollectedContainer::class.java)

@JvmStatic
fun from(parsed: Map<String, Map<String, List<String>>>): CollectedContainer {
val target: MutableMap<String, MutableMap<String, Set<String>>> = mutableMapOf()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
}
Expand Down

0 comments on commit e105915

Please sign in to comment.