From afee16eb98dc5d276d87d5ddca9cfdf5a2c171e4 Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Fri, 17 Apr 2020 09:39:15 +0100 Subject: [PATCH 01/20] Try support implementation --- .../plugins/license/LicenseResolver.groovy | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy index b5ad1a8..3dd6cb9 100644 --- a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy +++ b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy @@ -45,6 +45,8 @@ class LicenseResolver { private boolean ignoreFatalParseErrors private List patternsToIgnore + private static final Set PACKAGED_DEPENDENCIES_PREFIXES = ["compile","implementation","api"] + /** * Provide set with dependencies metadata. * @@ -142,7 +144,7 @@ class LicenseResolver { Set dependenciesToHandle = new HashSet() def subprojects = project.rootProject.subprojects.groupBy { Project p -> "$p.group:$p.name:$p.version".toString()} - if (project.configurations.any { it.name == dependencyConfiguration && isResolvable(it) }) { + if (project.configurations.any { it.name == dependencyConfiguration && (isResolvable(it) || isPackagedDependency(it)) }) { def configuration = project.configurations.getByName(dependencyConfiguration) configuration.resolvedConfiguration.resolvedArtifacts.each { ResolvedArtifact d -> String dependencyDesc = "$d.moduleVersion.id.group:$d.moduleVersion.id.name:$d.moduleVersion.id.version".toString() @@ -200,6 +202,27 @@ class LicenseResolver { boolean isResolvable(Configuration conf) { return conf.metaClass.respondsTo(conf, "isCanBeResolved") ? conf.isCanBeResolved() : true } + + + /** + * Checks if the configuration is for a packaged dependency (rather than e.g. a build or test time dependency) + * @param configuration + * @return true if the configuration is in the set of @link #BINARY_DEPENDENCIES + */ + protected boolean isPackagedDependency(Configuration configuration) { + boolean isPackagedDependency = PACKAGED_DEPENDENCIES_PREFIXES.any { + configuration.name.startsWith(it) + } + configuration.hierarchy.each { + String configurationHierarchyName = it.name + isPackagedDependency |= PACKAGED_DEPENDENCIES_PREFIXES.any { + configurationHierarchyName.startsWith(it) + } + } + + return isPackagedDependency + } + boolean isDependencyIncluded(String depName){ for(Pattern pattern: this.patternsToIgnore){ From ea6fac258db76ab5389008a7a44a9d7f4b9787b1 Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Fri, 17 Apr 2020 10:17:18 +0100 Subject: [PATCH 02/20] Trying to resolve dependencies. --- .../plugins/license/LicenseResolver.groovy | 207 ++++++++++-------- 1 file changed, 120 insertions(+), 87 deletions(-) diff --git a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy index 3dd6cb9..897b450 100644 --- a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy +++ b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy @@ -21,12 +21,14 @@ import org.gradle.api.artifacts.Configuration import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.FileCollectionDependency import org.gradle.api.artifacts.ResolvedArtifact +import org.gradle.api.artifacts.ResolvedDependency import org.gradle.api.logging.Logger import org.gradle.api.logging.Logging import java.util.regex.Pattern import static DependencyMetadata.noLicenseMetaData + /** * License resolver for dependencies. */ @@ -45,7 +47,7 @@ class LicenseResolver { private boolean ignoreFatalParseErrors private List patternsToIgnore - private static final Set PACKAGED_DEPENDENCIES_PREFIXES = ["compile","implementation","api"] + private static final Set PACKAGED_DEPENDENCIES_PREFIXES = ["compile", "implementation", "api"] /** * Provide set with dependencies metadata. @@ -57,7 +59,7 @@ class LicenseResolver { */ public Set provideLicenseMap4Dependencies() { Set licenseSet = new HashSet() - def subprojects = project.rootProject.subprojects.groupBy { Project p -> "$p.group:$p.name:$p.version".toString()} + def subprojects = project.rootProject.subprojects.groupBy { Project p -> "$p.group:$p.name:$p.version".toString() } Set projects = new HashSet() projects.add(project) @@ -66,68 +68,68 @@ class LicenseResolver { projects.each { p -> - // Resolve each dependency - resolveProjectDependencies(p).each { - rd -> - String dependencyDesc = "$rd.moduleVersion.id.group:$rd.moduleVersion.id.name:$rd.moduleVersion.id.version".toString() - Map.Entry licenseEntry = licenses.find { - dep -> - if(dep.key instanceof String) { - dep.key == dependencyDesc - } else if (dep.key instanceof DependencyGroup) { - rd.moduleVersion.id.group == dep.key.group - } - } - if (licenseEntry != null) { - def license = licenseEntry.value - def licenseMetadata = license instanceof String ? DownloadLicensesExtension.license(license) : license - licenseSet << new DependencyMetadata( - dependency: dependencyDesc, dependencyFileName: rd.file.name, licenseMetadataList: [ licenseMetadata ] - ) - } else { - Closure dependencyMetadata = { - if(!subprojects[dependencyDesc]) { - def depMetadata = retrieveLicensesForDependency(p, dependencyDesc) - depMetadata.dependencyFileName = rd.file.name - depMetadata - } else { - noLicenseMetaData(dependencyDesc, rd.file.name) + // Resolve each dependency + resolveProjectDependencies(p).each { + rd -> + String dependencyDesc = "$rd.moduleVersion.id.group:$rd.moduleVersion.id.name:$rd.moduleVersion.id.version".toString() + Map.Entry licenseEntry = licenses.find { + dep -> + if (dep.key instanceof String) { + dep.key == dependencyDesc + } else if (dep.key instanceof DependencyGroup) { + rd.moduleVersion.id.group == dep.key.group + } } - } + if (licenseEntry != null) { + def license = licenseEntry.value + def licenseMetadata = license instanceof String ? DownloadLicensesExtension.license(license) : license + licenseSet << new DependencyMetadata( + dependency: dependencyDesc, dependencyFileName: rd.file.name, licenseMetadataList: [licenseMetadata] + ) + } else { + Closure dependencyMetadata = { + if (!subprojects[dependencyDesc]) { + def depMetadata = retrieveLicensesForDependency(p, dependencyDesc) + depMetadata.dependencyFileName = rd.file.name + depMetadata + } else { + noLicenseMetaData(dependencyDesc, rd.file.name) + } + } - licenseSet << dependencyMetadata() + licenseSet << dependencyMetadata() + } } - } - provideFileDependencies(p).each { - fileDependency -> - Closure licenseMetadata = { - if (licenses.containsKey(fileDependency)) { - def license = licenses[fileDependency] - LicenseMetadata licenseMetadata = license instanceof String ? DownloadLicensesExtension.license(license) : license - def alias = aliases.find { - aliasEntry -> - aliasEntry.value.any { - aliasElem -> - if (aliasElem instanceof String) { - return aliasElem == licenseMetadata.licenseName - } else if(aliasElem instanceof LicenseMetadata) { - return aliasElem == licenseMetadata - } - - } + provideFileDependencies(p).each { + fileDependency -> + Closure licenseMetadata = { + if (licenses.containsKey(fileDependency)) { + def license = licenses[fileDependency] + LicenseMetadata licenseMetadata = license instanceof String ? DownloadLicensesExtension.license(license) : license + def alias = aliases.find { + aliasEntry -> + aliasEntry.value.any { + aliasElem -> + if (aliasElem instanceof String) { + return aliasElem == licenseMetadata.licenseName + } else if (aliasElem instanceof LicenseMetadata) { + return aliasElem == licenseMetadata + } + + } + } + if (alias) { + licenseMetadata = alias.key + } + new DependencyMetadata(dependency: fileDependency, dependencyFileName: fileDependency, licenseMetadataList: [licenseMetadata]) + } else { + noLicenseMetaData(fileDependency, fileDependency) } - if (alias) { - licenseMetadata = alias.key - } - new DependencyMetadata(dependency: fileDependency, dependencyFileName: fileDependency, licenseMetadataList: [licenseMetadata]) - } else { - noLicenseMetaData(fileDependency, fileDependency) } - } - licenseSet << licenseMetadata() - } + licenseSet << licenseMetadata() + } } licenseSet @@ -136,36 +138,67 @@ class LicenseResolver { /** * Provide full list of resolved artifacts to handle for a given project. * - * @param project the project + * @param project the project * @return Set with resolved artifacts */ Set resolveProjectDependencies(Project project) { Set dependenciesToHandle = new HashSet() - def subprojects = project.rootProject.subprojects.groupBy { Project p -> "$p.group:$p.name:$p.version".toString()} + def subprojects = project.rootProject.subprojects.groupBy { Project p -> "$p.group:$p.name:$p.version".toString() } - if (project.configurations.any { it.name == dependencyConfiguration && (isResolvable(it) || isPackagedDependency(it)) }) { + if (project.configurations.any { + it.name == dependencyConfiguration && (isResolvable(it) || isPackagedDependency(it)) + }) { def configuration = project.configurations.getByName(dependencyConfiguration) - configuration.resolvedConfiguration.resolvedArtifacts.each { ResolvedArtifact d -> - String dependencyDesc = "$d.moduleVersion.id.group:$d.moduleVersion.id.name:$d.moduleVersion.id.version".toString() - if(isDependencyIncluded(dependencyDesc)) { - Project subproject = subprojects[dependencyDesc]?.first() - if (subproject) { - if(includeProjectDependencies) { - dependenciesToHandle.add(d) - } - dependenciesToHandle.addAll(resolveProjectDependencies(subproject)) - } else if (!subproject) { - dependenciesToHandle.add(d) - } - } - } + + dependenciesToHandle.addAll(getResolvedArtifactsFromResolvedDependencies(configuration.getResolvedConfiguration() + .getLenientConfiguration() + .getFirstLevelModuleDependencies())) + +// configuration.resolvedConfiguration.resolvedArtifacts.each { ResolvedArtifact d -> +// String dependencyDesc = "$d.moduleVersion.id.group:$d.moduleVersion.id.name:$d.moduleVersion.id.version".toString() +// if (isDependencyIncluded(dependencyDesc)) { +// Project subproject = subprojects[dependencyDesc]?.first() +// if (subproject) { +// if (includeProjectDependencies) { +// dependenciesToHandle.add(d) +// } +// dependenciesToHandle.addAll(resolveProjectDependencies(subproject)) +// } else if (!subproject) { +// dependenciesToHandle.add(d) +// } +// } +// } } logger.debug("Project $project.name found ${dependenciesToHandle.size()} dependencies to handle.") dependenciesToHandle } + protected Set getResolvedArtifactsFromResolvedDependencies(Set resolvedDependencies) { + HashSet resolvedArtifacts = new HashSet<>() + + for (resolvedDependency in resolvedDependencies) { + try { + if (resolvedDependency.getModuleVersion() == LOCAL_LIBRARY_VERSION) { + /** + * Attempting to getAllModuleArtifacts on a local library project will result + * in AmbiguousVariantSelectionException as there are not enough criteria + * to match a specific variant of the library project. Instead we skip the + * the library project itself and enumerate its dependencies. + */ + resolvedArtifacts.addAll(getResolvedArtifactsFromResolvedDependencies(resolvedDependency.getChildren())) + } else { + resolvedArtifacts.addAll(resolvedDependency.getAllModuleArtifacts()) + } + } catch (Exception exception) { + logger.warn("Failed to process $resolvedDependency.name", exception) + } + } + return resolvedArtifacts + } + + Set provideFileDependencies(Project project) { Set fileDependencies = new HashSet() @@ -197,13 +230,13 @@ class LicenseResolver { * @param conf Configuration * @return whether conf is resolvable * - * @see Gradle 3.4 release notes + * @see Gradle 3.4 release notes */ boolean isResolvable(Configuration conf) { return conf.metaClass.respondsTo(conf, "isCanBeResolved") ? conf.isCanBeResolved() : true } - - + + /** * Checks if the configuration is for a packaged dependency (rather than e.g. a build or test time dependency) * @param configuration @@ -222,11 +255,11 @@ class LicenseResolver { return isPackagedDependency } - - boolean isDependencyIncluded(String depName){ - for(Pattern pattern: this.patternsToIgnore){ - if(pattern.matcher(depName).matches()){ + + boolean isDependencyIncluded(String depName) { + for (Pattern pattern : this.patternsToIgnore) { + if (pattern.matcher(depName).matches()) { return false; } } @@ -244,7 +277,7 @@ class LicenseResolver { * Implementation note: We rely that while resolving configuration with one dependency we get one pom. * Otherwise we have IllegalStateException * - * @param project the project + * @param project the project * @param dependencyDesc dependency description * @param aliases alias mapping for similar license names * @param initialDependency base dependency (not parent) @@ -289,8 +322,8 @@ class LicenseResolver { aliasEntry.value.any { aliasElem -> if (aliasElem instanceof String) { - return aliasElem == license.licenseName - } else if(aliasElem instanceof LicenseMetadata) { + return aliasElem == license.licenseName + } else if (aliasElem instanceof LicenseMetadata) { return aliasElem == license } @@ -315,14 +348,14 @@ class LicenseResolver { } } - void setDependenciesToIgnore(List dependenciesToIgnore){ - if(dependenciesToIgnore == null){ + void setDependenciesToIgnore(List dependenciesToIgnore) { + if (dependenciesToIgnore == null) { this.patternsToIgnore = Collections.emptyList(); return; } this.patternsToIgnore = new ArrayList<>(dependenciesToIgnore.size()); - for(String toIgnore: dependenciesToIgnore){ + for (String toIgnore : dependenciesToIgnore) { this.patternsToIgnore.add(Pattern.compile(toIgnore)) } } From 1618e5bad6b72da84f702c1ff5c829bf0bfe27a9 Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Fri, 17 Apr 2020 10:46:58 +0100 Subject: [PATCH 03/20] Try this. --- .../plugins/license/LicenseResolver.groovy | 77 ++++++++++++++----- 1 file changed, 56 insertions(+), 21 deletions(-) diff --git a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy index 897b450..06de694 100644 --- a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy +++ b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy @@ -20,6 +20,7 @@ import org.gradle.api.Project import org.gradle.api.artifacts.Configuration import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.FileCollectionDependency +import org.gradle.api.artifacts.ResolveException import org.gradle.api.artifacts.ResolvedArtifact import org.gradle.api.artifacts.ResolvedDependency import org.gradle.api.logging.Logger @@ -34,7 +35,7 @@ import static DependencyMetadata.noLicenseMetaData */ class LicenseResolver { - private static final Logger logger = Logging.getLogger(LicenseResolver); + private static final Logger logger = Logging.getLogger(LicenseResolver) /** * Reference to gradle project. @@ -47,6 +48,10 @@ class LicenseResolver { private boolean ignoreFatalParseErrors private List patternsToIgnore + protected static final String LOCAL_LIBRARY_VERSION = "unspecified" + private static final String TEST_PREFIX = "test" + private static final String ANDROID_TEST_PREFIX = "androidTest" + private static final Set TEST_COMPILE = ["testCompile", "androidTestCompile"] private static final Set PACKAGED_DEPENDENCIES_PREFIXES = ["compile", "implementation", "api"] /** @@ -142,8 +147,29 @@ class LicenseResolver { * @return Set with resolved artifacts */ Set resolveProjectDependencies(Project project) { - Set dependenciesToHandle = new HashSet() + + project.configurations.each { + if (!canBeResolved(configuration) || isTest(configuration) || !isPackagedDependency(configuration)) { + return null + } else { + try { + Set deps = getResolvedArtifactsFromResolvedDependencies( + configuration.getResolvedConfiguration() + .getLenientConfiguration() + .getFirstLevelModuleDependencies()) + + dependenciesToHandle.addAll(deps) + + } catch (ResolveException exception) { + logger.warn("Failed to resolve OSS licenses for $configuration.name.", exception) + return null + } + + } + } + + /* def subprojects = project.rootProject.subprojects.groupBy { Project p -> "$p.group:$p.name:$p.version".toString() } if (project.configurations.any { @@ -151,25 +177,22 @@ class LicenseResolver { }) { def configuration = project.configurations.getByName(dependencyConfiguration) - dependenciesToHandle.addAll(getResolvedArtifactsFromResolvedDependencies(configuration.getResolvedConfiguration() - .getLenientConfiguration() - .getFirstLevelModuleDependencies())) - -// configuration.resolvedConfiguration.resolvedArtifacts.each { ResolvedArtifact d -> -// String dependencyDesc = "$d.moduleVersion.id.group:$d.moduleVersion.id.name:$d.moduleVersion.id.version".toString() -// if (isDependencyIncluded(dependencyDesc)) { -// Project subproject = subprojects[dependencyDesc]?.first() -// if (subproject) { -// if (includeProjectDependencies) { -// dependenciesToHandle.add(d) -// } -// dependenciesToHandle.addAll(resolveProjectDependencies(subproject)) -// } else if (!subproject) { -// dependenciesToHandle.add(d) -// } -// } -// } + configuration.resolvedConfiguration.resolvedArtifacts.each { ResolvedArtifact d -> + String dependencyDesc = "$d.moduleVersion.id.group:$d.moduleVersion.id.name:$d.moduleVersion.id.version".toString() + if (isDependencyIncluded(dependencyDesc)) { + Project subproject = subprojects[dependencyDesc]?.first() + if (subproject) { + if (includeProjectDependencies) { + dependenciesToHandle.add(d) + } + dependenciesToHandle.addAll(resolveProjectDependencies(subproject)) + } else if (!subproject) { + dependenciesToHandle.add(d) ` + } + } + } } + */ logger.debug("Project $project.name found ${dependenciesToHandle.size()} dependencies to handle.") dependenciesToHandle @@ -230,12 +253,24 @@ class LicenseResolver { * @param conf Configuration * @return whether conf is resolvable * - * @see Gradle 3.4 release notes + * @see Gradle 3.4 release notes */ boolean isResolvable(Configuration conf) { return conf.metaClass.respondsTo(conf, "isCanBeResolved") ? conf.isCanBeResolved() : true } + /** + * Checks if the configuration is from test. + * @param configuration + * @return true if configuration is a test configuration or its parent + * configurations are either testCompile or androidTestCompile, otherwise + * false. + */ + protected boolean isTest(Configuration configuration) { + boolean isTestConfiguration = (configuration.name.startsWith(TEST_PREFIX) || configuration.name.startsWith(ANDROID_TEST_PREFIX)) + configuration.hierarchy.each { isTestConfiguration |= TEST_COMPILE.contains(it.name) } + return isTestConfiguration + } /** * Checks if the configuration is for a packaged dependency (rather than e.g. a build or test time dependency) From a9434ea165395c0152e0ada20a59f2e66df827ac Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Fri, 17 Apr 2020 10:51:09 +0100 Subject: [PATCH 04/20] Config missing --- .../nl/javadude/gradle/plugins/license/LicenseResolver.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy index 06de694..964bf37 100644 --- a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy +++ b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy @@ -148,8 +148,8 @@ class LicenseResolver { */ Set resolveProjectDependencies(Project project) { Set dependenciesToHandle = new HashSet() - - project.configurations.each { + + project.configurations.each { Configuration configuration -> if (!canBeResolved(configuration) || isTest(configuration) || !isPackagedDependency(configuration)) { return null } else { From 8d20b7c7f8d4ef12b6d8d8177241a26267cee019 Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Fri, 17 Apr 2020 10:53:45 +0100 Subject: [PATCH 05/20] oops --- .../nl/javadude/gradle/plugins/license/LicenseResolver.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy index 964bf37..08105c3 100644 --- a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy +++ b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy @@ -150,7 +150,7 @@ class LicenseResolver { Set dependenciesToHandle = new HashSet() project.configurations.each { Configuration configuration -> - if (!canBeResolved(configuration) || isTest(configuration) || !isPackagedDependency(configuration)) { + if (!isResolvable(configuration) || isTest(configuration) || !isPackagedDependency(configuration)) { return null } else { try { From fcf69d484662339507fe13801c894bb895f4ff2c Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Fri, 17 Apr 2020 11:12:07 +0100 Subject: [PATCH 06/20] Log dep count --- .../nl/javadude/gradle/plugins/license/LicenseResolver.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy index 08105c3..09ecac2 100644 --- a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy +++ b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy @@ -159,6 +159,8 @@ class LicenseResolver { .getLenientConfiguration() .getFirstLevelModuleDependencies()) + logger.info(configuration.name + " -> " + deps.count()) + dependenciesToHandle.addAll(deps) } catch (ResolveException exception) { From a2be408d2a9c4e370fd524c9d7da3e163a7e12ab Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Fri, 17 Apr 2020 11:19:37 +0100 Subject: [PATCH 07/20] Fixed bad count --- .../nl/javadude/gradle/plugins/license/LicenseResolver.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy index 09ecac2..7f80ccc 100644 --- a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy +++ b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy @@ -159,7 +159,7 @@ class LicenseResolver { .getLenientConfiguration() .getFirstLevelModuleDependencies()) - logger.info(configuration.name + " -> " + deps.count()) + logger.info(configuration.name + " -> " + deps.size()) dependenciesToHandle.addAll(deps) From e1bbcca652015dea4a8932575cd05e67ec393756 Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Fri, 17 Apr 2020 11:33:45 +0100 Subject: [PATCH 08/20] print output --- .../nl/javadude/gradle/plugins/license/LicenseResolver.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy index 7f80ccc..2877fc4 100644 --- a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy +++ b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy @@ -159,7 +159,7 @@ class LicenseResolver { .getLenientConfiguration() .getFirstLevelModuleDependencies()) - logger.info(configuration.name + " -> " + deps.size()) + println(configuration.name + " -> " + deps.size()) dependenciesToHandle.addAll(deps) From b3596772b503069b7c50b229e4368b44cb98a239 Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Fri, 17 Apr 2020 11:53:41 +0100 Subject: [PATCH 09/20] clean up. --- .../plugins/license/LicenseResolver.groovy | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy index 2877fc4..166e833 100644 --- a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy +++ b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy @@ -149,9 +149,11 @@ class LicenseResolver { Set resolveProjectDependencies(Project project) { Set dependenciesToHandle = new HashSet() - project.configurations.each { Configuration configuration -> + if (project.configurations.any { it.name == dependencyConfiguration }) { + def configuration = project.configurations.getByName(dependencyConfiguration) + if (!isResolvable(configuration) || isTest(configuration) || !isPackagedDependency(configuration)) { - return null + println(configuration.name + " -> no no no") } else { try { Set deps = getResolvedArtifactsFromResolvedDependencies( @@ -159,18 +161,36 @@ class LicenseResolver { .getLenientConfiguration() .getFirstLevelModuleDependencies()) - println(configuration.name + " -> " + deps.size()) - dependenciesToHandle.addAll(deps) + println(configuration.name + " -> " + deps.size()) + } catch (ResolveException exception) { logger.warn("Failed to resolve OSS licenses for $configuration.name.", exception) - return null } - } } +// project.configurations.each { Configuration configuration -> +// if (!isResolvable(configuration) || isTest(configuration) || !isPackagedDependency(configuration)) { +// println(configuration.name + " -> no no no") +// } else { +// try { +// Set deps = getResolvedArtifactsFromResolvedDependencies( +// configuration.getResolvedConfiguration() +// .getLenientConfiguration() +// .getFirstLevelModuleDependencies()) +// +// println(configuration.name + " -> " + deps.size()) +// +// dependenciesToHandle.addAll(deps) +// +// } catch (ResolveException exception) { +// logger.warn("Failed to resolve OSS licenses for $configuration.name.", exception) +// } +// } +// } + /* def subprojects = project.rootProject.subprojects.groupBy { Project p -> "$p.group:$p.name:$p.version".toString() } @@ -255,7 +275,7 @@ class LicenseResolver { * @param conf Configuration * @return whether conf is resolvable * - * @see Gradle 3.4 release notes + * @see Gradle 3.4 release notes */ boolean isResolvable(Configuration conf) { return conf.metaClass.respondsTo(conf, "isCanBeResolved") ? conf.isCanBeResolved() : true From 9ac212462eba20417139dc1e6a45161df14a41da Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Fri, 17 Apr 2020 12:10:45 +0100 Subject: [PATCH 10/20] Better logging. --- .../nl/javadude/gradle/plugins/license/LicenseResolver.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy index 166e833..b5e3b39 100644 --- a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy +++ b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy @@ -153,7 +153,7 @@ class LicenseResolver { def configuration = project.configurations.getByName(dependencyConfiguration) if (!isResolvable(configuration) || isTest(configuration) || !isPackagedDependency(configuration)) { - println(configuration.name + " -> no no no") + println(project.name + " -> " + configuration.name + " -> no no no") } else { try { Set deps = getResolvedArtifactsFromResolvedDependencies( @@ -163,7 +163,7 @@ class LicenseResolver { dependenciesToHandle.addAll(deps) - println(configuration.name + " -> " + deps.size()) + println(project.name + " -> " + configuration.name + " -> " + deps.size()) } catch (ResolveException exception) { logger.warn("Failed to resolve OSS licenses for $configuration.name.", exception) From 213e1dadcd60573c10d18a1d429cb1f6200c475c Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Fri, 17 Apr 2020 12:56:20 +0100 Subject: [PATCH 11/20] Hack to show all --- .../plugins/license/LicenseResolver.groovy | 82 ++++++------------- 1 file changed, 25 insertions(+), 57 deletions(-) diff --git a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy index b5e3b39..6b18789 100644 --- a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy +++ b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy @@ -152,72 +152,40 @@ class LicenseResolver { if (project.configurations.any { it.name == dependencyConfiguration }) { def configuration = project.configurations.getByName(dependencyConfiguration) - if (!isResolvable(configuration) || isTest(configuration) || !isPackagedDependency(configuration)) { - println(project.name + " -> " + configuration.name + " -> no no no") - } else { - try { - Set deps = getResolvedArtifactsFromResolvedDependencies( - configuration.getResolvedConfiguration() - .getLenientConfiguration() - .getFirstLevelModuleDependencies()) - - dependenciesToHandle.addAll(deps) + Set dependencies = getResolvedArtifacts(configuration) + dependenciesToHandle.addAll(dependencies) - println(project.name + " -> " + configuration.name + " -> " + deps.size()) + println(project.name + " -> " + configuration.name + " -> " + dependencies.size()) + } else if (dependencyConfiguration == 'all') { + // Hack to look at configurations + project.configurations.each { Configuration configuration -> + Set dependencies = getResolvedArtifacts(configuration) + dependenciesToHandle.addAll(dependencies) - } catch (ResolveException exception) { - logger.warn("Failed to resolve OSS licenses for $configuration.name.", exception) - } + println(project.name + " -> " + configuration.name + " -> " + dependencies.size()) } } -// project.configurations.each { Configuration configuration -> -// if (!isResolvable(configuration) || isTest(configuration) || !isPackagedDependency(configuration)) { -// println(configuration.name + " -> no no no") -// } else { -// try { -// Set deps = getResolvedArtifactsFromResolvedDependencies( -// configuration.getResolvedConfiguration() -// .getLenientConfiguration() -// .getFirstLevelModuleDependencies()) -// -// println(configuration.name + " -> " + deps.size()) -// -// dependenciesToHandle.addAll(deps) -// -// } catch (ResolveException exception) { -// logger.warn("Failed to resolve OSS licenses for $configuration.name.", exception) -// } -// } -// } - - /* - def subprojects = project.rootProject.subprojects.groupBy { Project p -> "$p.group:$p.name:$p.version".toString() } + logger.debug("Project $project.name found ${dependenciesToHandle.size()} dependencies to handle.") + dependenciesToHandle + } - if (project.configurations.any { - it.name == dependencyConfiguration && (isResolvable(it) || isPackagedDependency(it)) - }) { - def configuration = project.configurations.getByName(dependencyConfiguration) + Set getResolvedArtifacts(Configuration configuration) { + if (!isResolvable(configuration) || isTest(configuration) || !isPackagedDependency(configuration)) { + logger.warn("Failed to resolve OSS licenses for $configuration.name.", exception) + } else { + try { + return getResolvedArtifactsFromResolvedDependencies( + configuration.getResolvedConfiguration() + .getLenientConfiguration() + .getFirstLevelModuleDependencies()) - configuration.resolvedConfiguration.resolvedArtifacts.each { ResolvedArtifact d -> - String dependencyDesc = "$d.moduleVersion.id.group:$d.moduleVersion.id.name:$d.moduleVersion.id.version".toString() - if (isDependencyIncluded(dependencyDesc)) { - Project subproject = subprojects[dependencyDesc]?.first() - if (subproject) { - if (includeProjectDependencies) { - dependenciesToHandle.add(d) - } - dependenciesToHandle.addAll(resolveProjectDependencies(subproject)) - } else if (!subproject) { - dependenciesToHandle.add(d) ` - } - } + } catch (ResolveException exception) { + logger.warn("Failed to resolve OSS licenses for $configuration.name.", exception) } } - */ - logger.debug("Project $project.name found ${dependenciesToHandle.size()} dependencies to handle.") - dependenciesToHandle + return new HashSet() } protected Set getResolvedArtifactsFromResolvedDependencies(Set resolvedDependencies) { @@ -275,7 +243,7 @@ class LicenseResolver { * @param conf Configuration * @return whether conf is resolvable * - * @see Gradle 3.4 release notes + * @see Gradle 3.4 release notes */ boolean isResolvable(Configuration conf) { return conf.metaClass.respondsTo(conf, "isCanBeResolved") ? conf.isCanBeResolved() : true From da8feec2feba528203984f50add821d7a3557a82 Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Fri, 17 Apr 2020 13:00:38 +0100 Subject: [PATCH 12/20] Another bug. --- .../nl/javadude/gradle/plugins/license/LicenseResolver.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy index 6b18789..d76b6a2 100644 --- a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy +++ b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy @@ -172,7 +172,7 @@ class LicenseResolver { Set getResolvedArtifacts(Configuration configuration) { if (!isResolvable(configuration) || isTest(configuration) || !isPackagedDependency(configuration)) { - logger.warn("Failed to resolve OSS licenses for $configuration.name.", exception) + logger.warn("Failed to resolve OSS licenses for $configuration.name.") } else { try { return getResolvedArtifactsFromResolvedDependencies( @@ -243,7 +243,7 @@ class LicenseResolver { * @param conf Configuration * @return whether conf is resolvable * - * @see Gradle 3.4 release notes + * @see Gradle 3.4 release notes */ boolean isResolvable(Configuration conf) { return conf.metaClass.respondsTo(conf, "isCanBeResolved") ? conf.isCanBeResolved() : true From d58229937b20f569e12f30840e51a31f89eef878 Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Fri, 17 Apr 2020 18:34:03 +0100 Subject: [PATCH 13/20] Catch this too. --- .../nl/javadude/gradle/plugins/license/LicenseResolver.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy index d76b6a2..5963c8f 100644 --- a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy +++ b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy @@ -182,6 +182,8 @@ class LicenseResolver { } catch (ResolveException exception) { logger.warn("Failed to resolve OSS licenses for $configuration.name.", exception) + } catch (Exception exception) { + logger.warn("Failed to resolve OSS licenses for $configuration.name.", exception) } } @@ -243,7 +245,7 @@ class LicenseResolver { * @param conf Configuration * @return whether conf is resolvable * - * @see Gradle 3.4 release notes + * @see Gradle 3.4 release notes */ boolean isResolvable(Configuration conf) { return conf.metaClass.respondsTo(conf, "isCanBeResolved") ? conf.isCanBeResolved() : true From 14c349724c74b0a631acf31d33ce26f24f70583d Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Mon, 20 Apr 2020 16:10:27 +0100 Subject: [PATCH 14/20] Update gradle --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 922c4db..8138051 100644 --- a/build.gradle +++ b/build.gradle @@ -63,7 +63,7 @@ dependencies { } compile gradleApi() - def androidGradlePlugin = 'com.android.tools.build:gradle:2.0.+' + def androidGradlePlugin = ':com.android.tools.build:gradle3.6.3' compileOnly androidGradlePlugin testCompile androidGradlePlugin diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index db3eeb2..ea21908 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Dec 08 16:48:23 EST 2014 +#Mon Apr 20 15:51:30 BST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip From 0b400d090c382d90c78d251930791d1334c669e0 Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Mon, 20 Apr 2020 16:21:27 +0100 Subject: [PATCH 15/20] update scan plugin. --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8138051..565e374 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ buildscript { } plugins { - id 'com.gradle.build-scan' version '1.16' + id 'com.gradle.build-scan' version '2.0.2' id 'groovy' id 'idea' id "org.ajoberstar.release-opinion" version "1.4.2" From d977b43948934d90f0ec69c1a69d801464ad21e2 Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Mon, 20 Apr 2020 16:31:00 +0100 Subject: [PATCH 16/20] try this. --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 565e374..c3b37d4 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ plugins { id "org.ajoberstar.release-opinion" version "1.4.2" id 'com.gradle.plugin-publish' version '0.10.0' id 'java-gradle-plugin' - id 'ru.vyarus.animalsniffer' version '1.4.2' + id 'ru.vyarus.animalsniffer' version '1.5.0' } buildScan { From cac7e1c79a359fd985de4cf3149bec8dc68955cb Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Mon, 20 Apr 2020 17:05:59 +0100 Subject: [PATCH 17/20] More deps. --- build.gradle | 64 +++++++++++++++++++++++-------------------- buildSrc/build.gradle | 6 ++-- 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/build.gradle b/build.gradle index c3b37d4..4c6d3c2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,30 +1,29 @@ // First, apply the publishing plugin buildscript { - repositories { - maven { - url "https://plugins.gradle.org/m2/" - jcenter() + repositories { + maven { url "https://plugins.gradle.org/m2/" } + maven { url "https://dl.google.com/dl/android/maven2/" } + jcenter() + } + dependencies { + classpath "com.gradle.publish:plugin-publish-plugin:0.9.1" + classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:2.2.+' } - } - dependencies { - classpath "com.gradle.publish:plugin-publish-plugin:0.9.1" - classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:2.2.+' - } } plugins { - id 'com.gradle.build-scan' version '2.0.2' - id 'groovy' - id 'idea' - id "org.ajoberstar.release-opinion" version "1.4.2" - id 'com.gradle.plugin-publish' version '0.10.0' - id 'java-gradle-plugin' - id 'ru.vyarus.animalsniffer' version '1.5.0' + id 'com.gradle.build-scan' version '2.0.2' + id 'groovy' + id 'idea' + id "org.ajoberstar.release-opinion" version "1.4.2" + id 'com.gradle.plugin-publish' version '0.10.0' + id 'java-gradle-plugin' + id 'ru.vyarus.animalsniffer' version '1.5.0' } buildScan { - termsOfServiceUrl = 'https://gradle.com/terms-of-service' - termsOfServiceAgree = 'yes' + termsOfServiceUrl = 'https://gradle.com/terms-of-service' + termsOfServiceAgree = 'yes' } apply plugin: 'com.github.hierynomus.license' @@ -36,7 +35,12 @@ group = 'com.hierynomus.gradle.plugins' sourceCompatibility = 1.7 targetCompatibility = 1.7 -repositories { jcenter() } + +repositories { + maven { url "https://plugins.gradle.org/m2/" } + maven { url "https://dl.google.com/dl/android/maven2/" } + jcenter() +} idea { module { @@ -46,24 +50,24 @@ idea { } release { - grgit = org.ajoberstar.grgit.Grgit.open(project.projectDir) + grgit = org.ajoberstar.grgit.Grgit.open(project.projectDir) } configurations.compile.transitive = false dependencies { - signature 'org.codehaus.mojo.signature:java17:1.0@signature' + signature 'org.codehaus.mojo.signature:java17:1.0@signature' compile "org.codehaus.plexus:plexus-utils:2.0.5" compile "com.mycila.xmltool:xmltool:3.3" // Using compile instead of groovy, so that it goes into the pom - compile ('com.mycila:license-maven-plugin:3.0') { + compile('com.mycila:license-maven-plugin:3.0') { exclude group: 'org.apache.maven', module: 'maven-plugin-api' exclude group: 'org.apache.maven', module: 'maven-project' } compile gradleApi() - def androidGradlePlugin = ':com.android.tools.build:gradle3.6.3' + def androidGradlePlugin = 'com.android.tools.build:gradle:3.6.3' compileOnly androidGradlePlugin testCompile androidGradlePlugin @@ -98,13 +102,13 @@ license { } test { - afterSuite { descriptor, result -> - def indicator = "\u001B[32m✓\u001b[0m" - if (result.failedTestCount > 0) { - indicator = "\u001B[31m✘\u001b[0m" + afterSuite { descriptor, result -> + def indicator = "\u001B[32m✓\u001b[0m" + if (result.failedTestCount > 0) { + indicator = "\u001B[31m✘\u001b[0m" + } + logger.lifecycle("$indicator Test ${descriptor.name}; Executed: ${result.testCount}/\u001B[32m${result.successfulTestCount}\u001B[0m/\u001B[31m${result.failedTestCount}\u001B[0m") } - logger.lifecycle("$indicator Test ${descriptor.name}; Executed: ${result.testCount}/\u001B[32m${result.successfulTestCount}\u001B[0m/\u001B[31m${result.failedTestCount}\u001B[0m") - } } def pomConfig = { @@ -181,7 +185,7 @@ pluginBundle { licenseReportPlugin { displayName = "License Report plugin for Gradle" description = "Reports over licenses" - tags = [ "gradle", "plugin", "license", "report" ] + tags = ["gradle", "plugin", "license", "report"] } } } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 1c1ff09..6fd11e8 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -1,6 +1,8 @@ apply plugin: 'groovy' repositories { + maven { url "https://plugins.gradle.org/m2/" } + maven { url "https://dl.google.com/dl/android/maven2/" } jcenter() } @@ -9,13 +11,13 @@ configurations.compile.transitive = false dependencies { compile "org.codehaus.plexus:plexus-utils:2.0.5" compile "com.mycila.xmltool:xmltool:3.3" - compile ('com.mycila:license-maven-plugin:3.0') { + compile('com.mycila:license-maven-plugin:3.0') { exclude group: 'org.apache.maven', module: 'maven-plugin-api' exclude group: 'org.apache.maven', module: 'maven-project' } compile gradleApi() - compileOnly 'com.android.tools.build:gradle:2.0.+' + compileOnly 'com.android.tools.build:gradle:3.6.3' } sourceSets { From 5cbdf53fd9d7e42b7d5eb6bf31faceda1e3ff43e Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Tue, 2 Jun 2020 14:02:10 +0100 Subject: [PATCH 18/20] PR feedback. --- build.gradle | 8 ++++---- .../gradle/plugins/license/LicenseResolver.groovy | 12 +++--------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index 4c6d3c2..f3f6fff 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ // First, apply the publishing plugin buildscript { repositories { - maven { url "https://plugins.gradle.org/m2/" } - maven { url "https://dl.google.com/dl/android/maven2/" } + gradlePluginPortal() + google() jcenter() } dependencies { @@ -37,8 +37,8 @@ targetCompatibility = 1.7 repositories { - maven { url "https://plugins.gradle.org/m2/" } - maven { url "https://dl.google.com/dl/android/maven2/" } + gradlePluginPortal() + google() jcenter() } diff --git a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy index 5963c8f..8e6beb8 100644 --- a/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy +++ b/src/main/groovy/nl/javadude/gradle/plugins/license/LicenseResolver.groovy @@ -245,7 +245,7 @@ class LicenseResolver { * @param conf Configuration * @return whether conf is resolvable * - * @see Gradle 3.4 release notes + * @see Gradle 3.4 release notes */ boolean isResolvable(Configuration conf) { return conf.metaClass.respondsTo(conf, "isCanBeResolved") ? conf.isCanBeResolved() : true @@ -260,8 +260,7 @@ class LicenseResolver { */ protected boolean isTest(Configuration configuration) { boolean isTestConfiguration = (configuration.name.startsWith(TEST_PREFIX) || configuration.name.startsWith(ANDROID_TEST_PREFIX)) - configuration.hierarchy.each { isTestConfiguration |= TEST_COMPILE.contains(it.name) } - return isTestConfiguration + return isTestConfiguration || configuration.hierarchy.any { TEST_COMPILE.contains(it.name) } } /** @@ -285,12 +284,7 @@ class LicenseResolver { boolean isDependencyIncluded(String depName) { - for (Pattern pattern : this.patternsToIgnore) { - if (pattern.matcher(depName).matches()) { - return false; - } - } - return true; + return !patternsToIgnore.any { it.matcher(depName).matches() } } From a1215e995dc8b954ebeb230ba06d6ee3dae72250 Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Tue, 2 Jun 2020 15:34:07 +0100 Subject: [PATCH 19/20] Stop sniffing animals. --- build.gradle | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index f3f6fff..eefd608 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { } dependencies { classpath "com.gradle.publish:plugin-publish-plugin:0.9.1" - classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:2.2.+' + classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:2.2.2' } } @@ -101,6 +101,11 @@ license { ignoreFailures true } +animalsniffer { + excludeJars 'gradle-api-*' + ignoreFailures true +} + test { afterSuite { descriptor, result -> def indicator = "\u001B[32m✓\u001b[0m" From 0d1bcac6284cbe0a23c1a85343edfd0b5136ed85 Mon Sep 17 00:00:00 2001 From: Nic Bell Date: Tue, 30 Jun 2020 21:25:35 +0100 Subject: [PATCH 20/20] Update animal sniffer version. --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index eefd608..4fd2bca 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ plugins { id "org.ajoberstar.release-opinion" version "1.4.2" id 'com.gradle.plugin-publish' version '0.10.0' id 'java-gradle-plugin' - id 'ru.vyarus.animalsniffer' version '1.5.0' + id 'ru.vyarus.animalsniffer' version '1.5.1' } buildScan {