add test which shows the problem of missing dependencies
in dependency-info.md while using java-library plugin
@@ -121,4 +121,36 @@ class ComparePublicationsPluginTest extends PluginSpecification {
task.projectGroup == "projectGroup"
task.projectVersion == "1.2.3"
}
+
+ def "verify content of dependency-info.md file (using '#plugin' plugin and #libraries)"() {
+ given:
+ project.group = "projectGroup"
+ project.version = "1.2.3"
+ project.plugins.apply(plugin)
+ project.repositories.add(project.repositories.jcenter())
+ libraries.each { config, lib ->
+ project.dependencies.add(config, lib)
+ }
+
+ when:
+ project.plugins.apply(ComparePublicationsPlugin)
+ project.evaluate()
+ project.tasks["createDependencyInfoFile"].execute()
+
+ then:
+ CreateDependencyInfoFileTask task = project.tasks.createDependencyInfoFile
+ def dependencyInfoFile = task.outputFile
+
+ dependencyInfoFile.exists()
+ dependencyInfoFile.text
+ libraries.each { config, lib ->
+ assert dependencyInfoFile.text.contains(lib)
+ }
+
+ where:
+ plugin | libraries
+ 'java' | ['compile': 'org.mockito:mockito-core:2.15.0']
+ 'java-library' | ['api': 'org.mockito:mockito-core:2.13.0']
+ 'java-library' | ['api': 'org.mockito:mockito-core:2.13.0', 'implementation': 'com.google.guava:guava:21.0' ]
+ }
}
