Skip to content

Commit 4ad0be2

Browse files
committed
No change in behavior, but better names in the GradleProvisioner methods.
1 parent 00f7c78 commit 4ad0be2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/GradleProvisioner.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public Set<File> provisionWithTransitives(boolean withTransitives, Collection<St
6060
if (result != null) {
6161
return result;
6262
} else {
63-
result = GradleProvisioner.fromRootBuildscript(rootProject).provisionWithTransitives(req.withTransitives, req.mavenCoords);
63+
result = GradleProvisioner.forProject(rootProject).provisionWithTransitives(req.withTransitives, req.mavenCoords);
6464
cache.put(req, result);
6565
return result;
6666
}
@@ -69,22 +69,23 @@ public Set<File> provisionWithTransitives(boolean withTransitives, Collection<St
6969
}
7070
}
7171

72-
static Provisioner fromRootBuildscript(Project project) {
72+
static Provisioner forProject(Project project) {
7373
Objects.requireNonNull(project);
7474
return (withTransitives, mavenCoords) -> {
7575
try {
76-
Configuration config = project.getRootProject().getConfigurations().create("spotless"
76+
Configuration config = project.getConfigurations().create("spotless"
7777
+ new Request(withTransitives, mavenCoords).hashCode());
7878
mavenCoords.stream()
79-
.map(project.getBuildscript().getDependencies()::create)
79+
.map(project.getDependencies()::create)
8080
.forEach(config.getDependencies()::add);
8181
config.setDescription(mavenCoords.toString());
8282
config.setTransitive(withTransitives);
8383
return config.resolve();
8484
} catch (Exception e) {
85+
String projName = project.getPath();
8586
logger.log(
8687
Level.SEVERE,
87-
"You probably need to add a repository containing the '" + mavenCoords + "' artifact in the 'build.gradle' of your root project.\n" +
88+
"You probably need to add a repository containing the '" + mavenCoords + "' artifact in the 'build.gradle' of the " + projName + " project.\n" +
8889
"E.g.: 'repositories { mavenCentral() }'",
8990
e);
9091
throw e;

0 commit comments

Comments
 (0)