-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from rspieldenner/multiproject_bug
Fix bug in multiprojects where a subproject depends on another which …
- Loading branch information
Showing
4 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...flix/nebula/dependency/recommender/DependencyRecommendationsMultiprojectPluginSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package netflix.nebula.dependency.recommender | ||
|
||
import nebula.test.IntegrationSpec | ||
import nebula.test.dependencies.DependencyGraphBuilder | ||
import nebula.test.dependencies.GradleDependencyGenerator | ||
|
||
class DependencyRecommendationsMultiprojectPluginSpec extends IntegrationSpec { | ||
def 'can use recommender across a multiproject'() { | ||
def depGraph = new DependencyGraphBuilder() | ||
.addModule('example:foo:1.0.0') | ||
.addModule('example:bar:1.0.0') | ||
.build() | ||
def generator = new GradleDependencyGenerator(depGraph) | ||
generator.generateTestMavenRepo() | ||
|
||
def a = addSubproject('a', '''\ | ||
dependencies { | ||
compile 'example:foo' | ||
} | ||
'''.stripIndent()) | ||
writeHelloWorld('a', a) | ||
def b = addSubproject('b', '''\ | ||
dependencies { | ||
compile project(':a') | ||
} | ||
'''.stripIndent()) | ||
writeHelloWorld('b', b) | ||
buildFile << """\ | ||
allprojects { | ||
apply plugin: 'nebula.dependency-recommender' | ||
dependencyRecommendations { | ||
map recommendations: ['example:foo': '1.0.0'] | ||
} | ||
} | ||
subprojects { | ||
apply plugin: 'java' | ||
repositories { | ||
${generator.mavenRepositoryBlock} | ||
} | ||
} | ||
""".stripIndent() | ||
when: | ||
def results = runTasksSuccessfully(':a:dependencies', ':b:dependencies', 'build') | ||
|
||
then: | ||
noExceptionThrown() | ||
results.standardOutput.contains 'Recommending version 1.0.0 for dependency example:foo\n' + | ||
'\\--- project :a\n' + | ||
' \\--- example:foo: -> 1.0.0' | ||
} | ||
} |