Skip to content

Commit

Permalink
Extend test by including another child project
Browse files Browse the repository at this point in the history
  • Loading branch information
alllex committed May 9, 2024
1 parent c44c871 commit 91f8454
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class IsolatedProjectsToolingApiGradleLifecycleIntegrationTest extends AbstractI
withSomeToolingModelBuilderPluginInBuildSrc()
settingsFile << """
include("a")
include("b")
gradle.lifecycle.beforeProject {
println("Callback before \$it")
Expand All @@ -41,6 +42,8 @@ class IsolatedProjectsToolingApiGradleLifecycleIntegrationTest extends AbstractI
file("a/build.gradle") << """
plugins.apply(my.MyPlugin)
"""
// Intentionally do not apply the plugin to 'b'
file("b/build.gradle") << ""

when:
withIsolatedProjects()
Expand All @@ -52,13 +55,14 @@ class IsolatedProjectsToolingApiGradleLifecycleIntegrationTest extends AbstractI
model[1].message == "It works from project :a"

fixture.assertStateStored {
projectConfigured(":buildSrc")
projectsConfigured(":buildSrc", ":b")
buildModelCreated()
modelsCreated(":", ":a")
}

outputContains("Callback before root project 'root'")
outputContains("Callback before project ':a'")
outputContains("Callback before project ':b'")


when:
Expand Down Expand Up @@ -88,11 +92,12 @@ class IsolatedProjectsToolingApiGradleLifecycleIntegrationTest extends AbstractI
fileChanged("build.gradle")
projectConfigured(":buildSrc")
modelsCreated(":")
modelsReused(":a", ":buildSrc")
modelsReused(":a", ":b", ":buildSrc")
}

outputContains("Callback before root project 'root'")
outputDoesNotContain("Callback before project ':a'")
outputDoesNotContain("Callback before project ':b'")


when:
Expand Down Expand Up @@ -124,11 +129,12 @@ class IsolatedProjectsToolingApiGradleLifecycleIntegrationTest extends AbstractI
projectConfigured(":buildSrc")
projectConfigured(":")
modelsCreated(":a")
modelsReused(":", ":buildSrc")
modelsReused(":", "b", ":buildSrc")
}

outputContains("Callback before root project 'root'")
outputContains("Callback before project ':a'")
outputDoesNotContain("Callback before project ':b'")
}

}

0 comments on commit 91f8454

Please sign in to comment.