Skip to content

Commit

Permalink
RegisterDependenciesTask now asserts that it is applied to only the r…
Browse files Browse the repository at this point in the history
…oot project.
  • Loading branch information
nedtwigg committed Jan 1, 2020
1 parent 062e9e6 commit 7535906
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.gradle.api.tasks.OutputFile;
import org.gradle.api.tasks.TaskAction;

import com.diffplug.common.base.Preconditions;
import com.diffplug.common.io.Files;
import com.diffplug.spotless.FormatterStep;

Expand Down Expand Up @@ -83,6 +84,7 @@ public GradleProvisioner.RootProvisioner getRootProvisioner() {
}

void setup() {
Preconditions.checkArgument(getProject().getRootProject() == getProject(), "Can only be used on the root project");
unitOutput = new File(getProject().getBuildDir(), "tmp/spotless-register-dependencies");
rootProvisioner = new GradleProvisioner.RootProvisioner(getProject());
}
Expand Down

0 comments on commit 7535906

Please sign in to comment.