Skip to content

Commit

Permalink
Merge 1d1d3a4 into c922ea4
Browse files Browse the repository at this point in the history
  • Loading branch information
OdysseusLives committed Jan 10, 2020
2 parents c922ea4 + 1d1d3a4 commit 5087253
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class DependencyResolutionVerifier {
if (failedDepsByConf.size() != 0 || lockedDepsOutOfDate.size() != 0) {
List<String> message = new ArrayList<>()
List<String> debugMessage = new ArrayList<>()
List<String> depsMissingVersions = new ArrayList<>()
try {
if (failedDepsByConf.size() > 0) {
message.add("Failed to resolve the following dependencies:")
Expand All @@ -149,6 +150,9 @@ class DependencyResolutionVerifier {
.each { failedConf ->
debugMessage.add(" - $failedConf")
}
if (dep.split(':').size() < 3) {
depsMissingVersions.add(dep)
}
}

if (lockedDepsOutOfDate.size() > 0) {
Expand All @@ -160,6 +164,11 @@ class DependencyResolutionVerifier {
message.add(" ${index + 1}. $outOfDateMessage for project '${project.name}'")
}

if (depsMissingVersions.size() > 0) {
message.add("The following dependencies are missing a version: ${depsMissingVersions.join(', ')}\n" +
"Please add a version to fix this. If you have been using a BOM, perhaps these dependencies are no longer managed.")
}

} catch (Exception e) {
throw new BuildCancelledException("Error creating message regarding failed dependencies", e)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class DependencyResolutionVerifierTest extends IntegrationTestKitSpec {
buildFile << """
dependencies {
implementation 'test.nebula:c' // version is missing
implementation 'test.nebula:d' // version is missing
}
""".stripIndent()

Expand All @@ -136,6 +137,9 @@ class DependencyResolutionVerifierTest extends IntegrationTestKitSpec {
results.output.contains('Execution failed for task')
results.output.contains('> Failed to resolve the following dependencies:')
results.output.contains("1. Failed to resolve 'test.nebula:c' for project")
results.output.contains("2. Failed to resolve 'test.nebula:d' for project")
results.output.contains("The following dependencies are missing a version: test.nebula:c, test.nebula:d")
results.output.contains("If you have been using a BOM")

where:
tasks | description
Expand Down

0 comments on commit 5087253

Please sign in to comment.