Skip to content

Commit 6b687c4

Browse files
authored
Fix enabling gradle configure on demand (#2916)
1 parent 8dca278 commit 6b687c4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

buildSrc/src/main/groovy/MuzzlePlugin.groovy

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import org.gradle.api.Plugin
3131
import org.gradle.api.Project
3232
import org.gradle.api.Task
3333
import org.gradle.api.model.ObjectFactory
34+
3435
/**
3536
* muzzle task plugin which runs muzzle validation against a range of dependencies.
3637
*/
@@ -43,14 +44,15 @@ class MuzzlePlugin implements Plugin<Project> {
4344

4445
@Override
4546
void apply(Project project) {
46-
def bootstrapProject = project.rootProject.getChildProjects().get('javaagent-bootstrap')
47-
def toolingProject = project.rootProject.getChildProjects().get('javaagent-tooling')
4847
project.extensions.create("muzzle", MuzzleExtension, project.objects)
4948

5049
// compileMuzzle compiles all projects required to run muzzle validation.
5150
// Not adding group and description to keep this task from showing in `gradle tasks`.
52-
def compileMuzzle = project.task('compileMuzzle')
53-
compileMuzzle.dependsOn(bootstrapProject.tasks.classes, toolingProject.tasks.classes, project.tasks.classes)
51+
def compileMuzzle = project.task('compileMuzzle') {
52+
dependsOn(':javaagent-bootstrap:classes')
53+
dependsOn(':javaagent-tooling:classes')
54+
dependsOn(project.tasks.classes)
55+
}
5456

5557
def muzzle = project.task('muzzle') {
5658
group = 'Muzzle'

0 commit comments

Comments
 (0)