Update go4it to reflect recent Gradle changes

I really wanted to use includeBuild instead of include here, but it
doesn't work very well with genIntellijRuns right now - I think we might
need to do some more magic to fix that.
This commit is contained in:
Jonathan Coates 2022-06-20 08:26:35 +01:00
parent ab4e1dee63
commit 6cb3657080
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
2 changed files with 19 additions and 9 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@
/logs
/gradle*
/*.gradle
/*.gradle.kts
/build
# Misc

27
go4it
View File

@ -77,24 +77,29 @@ def setup() -> None:
else:
shutil.copy2(src, file)
with open("settings.gradle", "w") as h:
with open("settings.gradle.kts", "w") as h:
h.write(dedent("""\
pluginManagement {
repositories {
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
gradlePluginPortal()
maven("https://maven.minecraftforge.net")
maven("https://maven.parchmentmc.org")
}
resolutionStrategy {
eachPlugin {
if (requested.id.id == "org.spongepowered.mixin") {
useModule("org.spongepowered:mixingradle:${requested.version}")
}
}
}
}
rootProject.name = 'cc-tweaked'
rootProject.name = "cc-tweaked"
"""))
for branch in BRANCHES:
h.write(f"include '{branch.name}'\n")
h.write(f"include(\"{branch.name}\")\n")
with open("build.gradle", "w") as h:
with open("build.gradle.kts", "w") as h:
pass
log("Installing npm packages")
@ -108,7 +113,11 @@ def gen_runs() -> None:
Generate .idea run files
"""
setup()
subprocess.check_call(["./gradlew", "--no-daemon", "genIntellijRuns"])
gen_command = ["./gradlew", "--no-daemon"]
for branch in BRANCHES:
gen_command.append(f"{branch.name}:genIntellijRuns")
subprocess.check_call(gen_command)
re = regex.compile(r"(mc-.*)_run(.*)\.xml")
for path in pathlib.Path(".idea/runConfigurations").glob("*.xml"):