diff options
author | SHsuperCM <shsupercm@gmail.com> | 2023-06-21 09:53:19 +0300 |
---|---|---|
committer | SHsuperCM <shsupercm@gmail.com> | 2023-06-21 09:53:19 +0300 |
commit | daa0381b50753f8db9aff2e353872c8d673947b8 (patch) | |
tree | 666fb0af1beb1c89699011a27f544f2cca5550cb /build.gradle | |
parent | 441284a24bd3af732954394b3b6afa73554764de (diff) | |
download | CITResewn-daa0381b50753f8db9aff2e353872c8d673947b8.tar.gz CITResewn-daa0381b50753f8db9aff2e353872c8d673947b8.tar.bz2 CITResewn-daa0381b50753f8db9aff2e353872c8d673947b8.zip |
Buildscript cleanup
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/build.gradle b/build.gradle index 49d84f0..d450656 100644 --- a/build.gradle +++ b/build.gradle @@ -13,11 +13,11 @@ dependencies { minecraft "com.mojang:minecraft:${stonecutter.current().version()}" mappings "net.fabricmc:yarn:${property('deps.yarn')}:v2" - modImplementation "net.fabricmc:fabric-loader:${property('deps.fabric-loader')}" - modImplementation "net.fabricmc.fabric-api:fabric-api:${property('deps.fabric-api')}" + modCompileOnly "net.fabricmc:fabric-loader:${property('deps.fabric-loader')}" + modCompileOnly "net.fabricmc.fabric-api:fabric-api:${property('deps.fabric-api')}" - modImplementation "com.terraformersmc:modmenu:${property('deps.modmenu')}" - modImplementation "me.shedaniel.cloth:cloth-config-fabric:${property('deps.cloth-config')}" + modCompileOnly "com.terraformersmc:modmenu:${property('deps.modmenu')}" + modCompileOnly "me.shedaniel.cloth:cloth-config-fabric:${property('deps.cloth-config')}" include project(":defaults:${stonecutter.current().version()}") } @@ -29,9 +29,8 @@ fletchingTable { loom { accessWidenerPath = file("../../src/main/resources/citresewn.accesswidener") - runConfigs.configureEach { - ideConfigGenerated = true - } + runConfigs.client.ideConfigGenerated = false + runConfigs.server.ideConfigGenerated = false } java { @@ -55,6 +54,21 @@ jar { } if (stonecutter.current().isActiveVersion()) { + dependencies { + modRuntimeOnly "net.fabricmc:fabric-loader:${property('deps.fabric-loader')}" + modRuntimeOnly "net.fabricmc.fabric-api:fabric-api:${property('deps.fabric-api')}" + modRuntimeOnly "com.terraformersmc:modmenu:${property('deps.modmenu')}" + modRuntimeOnly "me.shedaniel.cloth:cloth-config-fabric:${property('deps.cloth-config')}" + runtimeOnly project(path: ":defaults:${stonecutter.current().version()}", configuration: "namedElements") + } + loom.runConfigs.client.ideConfigGenerated = true + + rootProject.tasks.register('buildActive') { + setGroup 'project' + + dependsOn tasks.getByName('build') + } + plugins.apply 'com.modrinth.minotaur' plugins.apply 'com.matthewprenger.cursegradle' @@ -66,7 +80,7 @@ if (stonecutter.current().isActiveVersion()) { versionNumber = version versionName = "v" + version additionalFiles = [sourcesJar.outputs.getFiles().singleFile] - gameVersions = Arrays.asList(property('mod.target-mc-publish').split(",")) + gameVersions = Arrays.asList(property('publish.target-mc').split(",")) } curseforge { @@ -80,7 +94,7 @@ if (stonecutter.current().isActiveVersion()) { displayName = "v" + version } addGameVersion 'Fabric' - for (String version : property('mod.target-mc-publish').split(",")) + for (String version : property('publish.target-mc').split(",")) addGameVersion version } options { @@ -88,9 +102,17 @@ if (stonecutter.current().isActiveVersion()) { } } - rootProject.tasks.register('publish') { + rootProject.tasks.register('publishActive') { setGroup 'project' + if (gradle.startParameter.taskNames.contains(it.name)) { + System.out.println("Type the task name to confirm (${it.name}): ") + try (BufferedReader input = new BufferedReader(new InputStreamReader(System.in))) { + if (input.readLine() != it.name) + throw new GradleException('Task cancelled by user') + } + } + Task remapJarTask = tasks.getByName 'remapJar' Task curseforgeTask = tasks.getByName 'curseforge' Task modrinthTask = tasks.getByName 'modrinth' |