Skip to content

Instantly share code, notes, and snippets.

@marchermans
Created August 9, 2026 17:25
Show Gist options
  • Select an option

  • Save marchermans/a818ae6e0c89c0007b6a5697b86ccf19 to your computer and use it in GitHub Desktop.

Select an option

Save marchermans/a818ae6e0c89c0007b6a5697b86ccf19 to your computer and use it in GitHub Desktop.
def "multiple projects with neoforge dependencies should be able to run the game using closure notation"() {
given:
def rootProject = create("isolated_multi_neoforge_root_closure", {
it.withRoot()
// Enable isolated projects via gradle.properties
it.property('org.gradle.isolated-projects', 'true')
})
def apiProject = create(rootProject, "api", {
it.withSimpleLibrary()
it.plugin(this.pluginUnderTest)
})
def modProject = create(rootProject, "mod", {
// Use closure-based project dependency notation to test the reflection path in extractConfigurationName().
// This exercises DependencyHandlerImpl.project() when handling Closure-based notations.
it.withRun("""
runs {
server {
dependencies {
// Closure notation — tests that configuration extraction works via Gradle's internal APIs.
modSource project(':api') {
configuration = 'modSourceMain'
}
}
}
}
""")
it.plugin(this.pluginUnderTest)
})
when:
def run = rootProject.run {
it.run(":mod")
it.gradleVersion("9.7.0") // Use Gradle 9.7.0 for isolated projects support
it.stacktrace()
}
then:
run.checkModLoading(":mod")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment