Skip to content

Commit

Permalink
Extend application of gradle platforms to all annotationProcessor con…
Browse files Browse the repository at this point in the history
…figurations
  • Loading branch information
chali committed Aug 28, 2020
1 parent 900b54f commit e041c7c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void execute(Configuration configuration) {

//we want to apply recommendation only into final resolvable configurations like `compileClasspath` or `runtimeClasspath` across all source sets.
private boolean isClasspathConfiguration(Configuration configuration) {
return configuration.getName().endsWith("Classpath") || configuration.getName().equals("annotationProcessor");
return configuration.getName().endsWith("Classpath") || configuration.getName().toLowerCase().endsWith("annotationprocessor");
}

//this action creates clones of bom configuration from root and gradle will also apply the action to them which would
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,10 @@ class DependencyRecommendationsPluginConfigurationCacheSpec extends IntegrationT
}
""".stripIndent()

when:
def result = runTasks('--configuration-cache', 'dependencies')

then:
result.output.contains 'test.nebula:foo -> 1.0.0'
expect:
//TODO we don't support configuration cache yet so we expect the test to fail
//this should help us https://github.com/gradle/gradle/issues/12871
runTasksAndFail('--configuration-cache', 'dependencies')
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class DependencyRecommendationsPluginCoreBomSupportSpec extends IntegrationSpec
pom.addManagementDependency('test.nebula', 'lib', '3.9.9')
pom.addManagementDependency('test.nebula', 'app', '8.0.0')
pom.addManagementDependency('test.nebula', 'moa', '9.0.0')
pom.addManagementDependency('test.nebula', 'koa', '10.0.0')
repo.poms.add(pom)
repo.generate()
def graph = new DependencyGraphBuilder()
Expand All @@ -51,6 +52,7 @@ class DependencyRecommendationsPluginCoreBomSupportSpec extends IntegrationSpec
.addModule('test.nebula:app:8.0.0')
.addModule('test.nebula:app:9.0.0')
.addModule('test.nebula:moa:9.0.0')
.addModule('test.nebula:koa:10.0.0')
.build()
generator = new GradleDependencyGenerator(graph)
generator.generateTestMavenRepo()
Expand All @@ -74,6 +76,7 @@ class DependencyRecommendationsPluginCoreBomSupportSpec extends IntegrationSpec
dependencies {
annotationProcessor 'test.nebula:bar'
testAnnotationProcessor 'test.nebula:koa'
compile 'test.nebula:foo'
implementation 'test.nebula:moa'
providedCompile 'test.nebula:lib'
Expand All @@ -93,6 +96,7 @@ class DependencyRecommendationsPluginCoreBomSupportSpec extends IntegrationSpec
result.standardOutput.contains("+--- test.nebula:moa -> 9.0.0")
result.standardOutput.contains("\\--- test.nebula:baz -> 2.5.0")
result.standardOutput.contains("\\--- test.nebula:lib -> 3.9.9")
result.standardOutput.contains("\\--- test.nebula:koa -> 10.0.0")

compileOnlyResult.standardOutput.contains("compileOnly - Compile only dependencies for source set 'main'")
compileOnlyResult.standardOutput.contains("\\--- test.nebula:app:7.0.0")
Expand Down

0 comments on commit e041c7c

Please sign in to comment.