I want to create a separate (groovy) gradle file that contains a single configuration closure (sorry if my terminology isn't right here). I want to apply it into the main build.gradle file, but I want to ensure that only the one configuration gets applied and anything else that may be defined in that new file should be ignored. Is this possible? I'm struggling to find the answer to this on google.
So in the new file, I intend on having
foo {
bar = "baz"
}
and want the main build.gradle to only apply that "foo" configuration, even if the new file contained:
foo {
bar = "baz"
}
blah {
blah = "blah"
}
I'd be okay with gradle throwing an error or simply ignoring the extra content if it exists