Skip to content

Commit

Permalink
Use implementation configuration for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rpalcolea committed Nov 6, 2019
1 parent 1f118e7 commit 75c6ea6
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 62 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ dependencyRecommendations {
dependencies {
nebulaRecommenderBom 'netflix:platform:latest.release@pom'
compile 'com.google.guava:guava' // no version, version is recommended
compile 'commons-lang:commons-lang:2.6' // I know what I want, don't recommend
compile project.recommend('commmons-logging:commons-logging', 'myprops') // source the recommendation from the provider named myprops'
implementation 'com.google.guava:guava' // no version, version is recommended
implementation 'commons-lang:commons-lang:2.6' // I know what I want, don't recommend
implementation project.recommend('commmons-logging:commons-logging', 'myprops') // source the recommendation from the provider named myprops'
}
```

Expand Down Expand Up @@ -107,18 +107,18 @@ apply plugin: 'nebula.dependency-recommender'
group = 'netflix'
configurations { compile }
configurations { implementation }
repositories { jcenter() }
dependencies {
compile 'commons-configuration:commons-configuration:1.6'
implementation 'commons-configuration:commons-configuration:1.6'
}
publishing {
publications {
parent(MavenPublication) {
// the transitive closure of this configuration will be flattened and added to the dependency management section
nebulaDependencyManagement.fromConfigurations { configurations.compile }
nebulaDependencyManagement.fromConfigurations { configurations.implementation }
// alternative syntax when you want to explicitly add a dependency with no transitives
nebulaDependencyManagement.withDependencies { 'manual:dep:1' }
Expand Down Expand Up @@ -215,7 +215,7 @@ dependencyRecommendations {
}
dependencies {
compile 'commons-logging:commons-logging' // version 1.2 is selected
implementation 'commons-logging:commons-logging' // version 1.2 is selected
}
```

Expand All @@ -229,7 +229,7 @@ dependencyRecommendations {
}
dependencies {
compile 'commons-logging:commons-logging:1.0' // version 1.0 is selected
implementation 'commons-logging:commons-logging:1.0' // version 1.0 is selected
}
```

Expand All @@ -243,7 +243,7 @@ dependencyRecommendations {
}
dependencies {
compile 'commons-logging:commons-logging' // version 1.0 is selected
implementation 'commons-logging:commons-logging' // version 1.0 is selected
}
```

Expand All @@ -262,8 +262,8 @@ dependencyRecommendations {
}
dependencies {
compile 'commons-logging:commons-logging'
compile 'commons-configuration:commons-configuration:1.6'
implementation 'commons-logging:commons-logging'
implementation 'commons-configuration:commons-configuration:1.6'
}
```

Expand All @@ -278,7 +278,7 @@ dependencyRecommendations {
}
dependencies {
compile 'commons-configuration:commons-configuration:1.6'
implementation 'commons-configuration:commons-configuration:1.6'
}
```

Expand All @@ -292,8 +292,8 @@ dependencyRecommendations {
}
dependencies {
compile 'commons-configuration:commons-configuration:1.6'
compile 'commons-logging:commons-logging' // version 1.1.1 is selected
implementation 'commons-configuration:commons-configuration:1.6'
implementation 'commons-logging:commons-logging' // version 1.1.1 is selected
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ class DependencyRecommendationsPluginMultiprojectCoreBomSupportSpec extends Inte
def 'can use recommender across a multiproject'() {
def a = addSubproject('a', '''\
dependencies {
compile 'test.nebula:foo'
implementation 'test.nebula:foo'
}
'''.stripIndent())
writeHelloWorld('a', a)
def b = addSubproject('b', '''\
dependencies {
compile project(':a')
implementation project(':a')
}
'''.stripIndent())
writeHelloWorld('b', b)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ class DependencyRecommendationsPluginSpec extends IntegrationSpec {
}

project.dependencies {
compile 'com.google.guava:guava'
implementation 'com.google.guava:guava'
}

def resolved = project.configurations.compile.incoming.resolutionResult
def resolved = project.configurations.compileClasspath.incoming.resolutionResult
.allComponents.collect { it.moduleVersion }

then:
Expand Down Expand Up @@ -81,7 +81,7 @@ class DependencyRecommendationsPluginSpec extends IntegrationSpec {
dependencies {
nebulaRecommenderBom 'test.nebula.bom:testbom:1.0.0@pom'
compile 'test.nebula:foo'
implementation 'test.nebula:foo'
}
""".stripIndent()

Expand Down Expand Up @@ -122,7 +122,7 @@ class DependencyRecommendationsPluginSpec extends IntegrationSpec {
dependencies {
nebulaRecommenderBom 'test.nebula.bom:testbom:2.0.0@pom'
zinc 'test.nebula:foo:1.0.0'
compile 'test.nebula:foo'
implementation 'test.nebula:foo'
}
""".stripIndent()

Expand Down Expand Up @@ -163,12 +163,12 @@ class DependencyRecommendationsPluginSpec extends IntegrationSpec {
dependencies {
nebulaRecommenderBom 'test.nebula.bom:testbom:1.0.0@pom'
compile 'test.nebula:foo'
implementation 'test.nebula:foo'
}
""".stripIndent()

when:
def result = runTasksSuccessfully('dependencyInsight', '--configuration', 'compile', '--dependency', 'foo')
def result = runTasksSuccessfully('dependencyInsight', '--configuration', 'compileClasspath', '--dependency', 'foo')

then:
result.standardOutput.contains 'Recommending version 1.0.0 for dependency test.nebula:foo'
Expand Down Expand Up @@ -201,8 +201,8 @@ class DependencyRecommendationsPluginSpec extends IntegrationSpec {
dependencies {
nebulaRecommenderBom 'test.nebula.bom:testbom:1.0.0@pom'
compile 'test.nebula:foo'
compile 'test.nebula:bar:1.0.0'
implementation 'test.nebula:foo'
implementation 'test.nebula:bar:1.0.0'
}
""".stripIndent()

Expand Down Expand Up @@ -239,8 +239,8 @@ class DependencyRecommendationsPluginSpec extends IntegrationSpec {
dependencies {
nebulaRecommenderBom 'test.nebula.bom:testbom:1.0.0@pom'
compile 'test.nebula:foo'
compile 'test.nebula:bar:1.0.0'
implementation 'test.nebula:foo'
implementation 'test.nebula:bar:1.0.0'
}
""".stripIndent()

Expand Down Expand Up @@ -283,7 +283,7 @@ class DependencyRecommendationsPluginSpec extends IntegrationSpec {
dependencies {
nebulaRecommenderBom 'test.nebula.bom:testbom:latest.release@pom'
compile 'test.nebula:foo'
implementation 'test.nebula:foo'
}
""".stripIndent()

Expand Down Expand Up @@ -314,18 +314,18 @@ class DependencyRecommendationsPluginSpec extends IntegrationSpec {
group = 'netflix'
version = '1'
configurations { compile }
configurations { implementation }
repositories { jcenter() }
dependencies {
compile 'commons-configuration:commons-configuration:1.6'
implementation 'commons-configuration:commons-configuration:1.6'
}
publishing {
publications {
parent(MavenPublication) {
nebulaDependencyManagement.fromConfigurations { configurations.compile }
nebulaDependencyManagement.fromConfigurations { configurations.implementation }
nebulaDependencyManagement.withDependencies { 'manual:dep:1' }
artifactId = 'module-parent'
Expand Down Expand Up @@ -454,10 +454,10 @@ class DependencyRecommendationsPluginSpec extends IntegrationSpec {
}

project.dependencies {
compile 'com.google.collections:google-collections'
implementation 'com.google.collections:google-collections'
}

def resolutionResult = project.configurations.compile.incoming.resolutionResult
def resolutionResult = project.configurations.compileClasspath.incoming.resolutionResult
def guava = resolutionResult.allDependencies.first()

then:
Expand Down
Loading

0 comments on commit 75c6ea6

Please sign in to comment.