diff options
author | SHsuperCM <shsupercm@gmail.com> | 2023-06-20 17:05:34 +0300 |
---|---|---|
committer | SHsuperCM <shsupercm@gmail.com> | 2023-06-20 17:05:34 +0300 |
commit | ab4fcee98d605fb0792d8ee37b3c9e72e1b4b9e4 (patch) | |
tree | 23cafc13d2d1c5bac30c22e5cc24958a4f3c91fa /build.gradle | |
parent | 2b6d3a661e7064576b9fc1109631d32b737cab06 (diff) | |
download | CITResewn-ab4fcee98d605fb0792d8ee37b3c9e72e1b4b9e4.tar.gz CITResewn-ab4fcee98d605fb0792d8ee37b3c9e72e1b4b9e4.tar.bz2 CITResewn-ab4fcee98d605fb0792d8ee37b3c9e72e1b4b9e4.zip |
Restructured to use stonecutter
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 169 |
1 files changed, 75 insertions, 94 deletions
diff --git a/build.gradle b/build.gradle index c02be24..1db46e5 100644 --- a/build.gradle +++ b/build.gradle @@ -1,123 +1,104 @@ -import java.nio.file.Files - plugins { - id 'fabric-loom' version '1.1-SNAPSHOT' apply false - id 'io.shcm.shsupercm.fabric.fletchingtable' version '1.6' apply false - id 'com.modrinth.minotaur' version '2.+' apply false - id 'com.matthewprenger.cursegradle' version '1.4.0' apply false + id 'fabric-loom' version '1.2-SNAPSHOT' + id 'io.shcm.shsupercm.fabric.fletchingtable' version '1.6' } -allprojects { - apply plugin: "fabric-loom" - apply plugin: "io.shcm.shsupercm.fabric.fletchingtable" - - version = project.mod_version + "+" + project.minecraft_version - group = project.maven_group +version = "${property('mod.version')}+${stonecutter.current().version()}" +group = 'shcm.shsupercm.fabric.citresewn' - repositories { - maven { url "https://maven.shedaniel.me/" } - maven { url "https://maven.terraformersmc.com/releases" } - maven { url "https://cursemaven.com" } - } +repositories { + maven { url 'https://maven.terraformersmc.com/releases/' } + maven { url 'https://maven.shedaniel.me/' } +} - dependencies { - minecraft "com.mojang:minecraft:${project.minecraft_version}" - mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" - modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api}" - //fletchingTable.fungible project.fungible +dependencies { + minecraft "com.mojang:minecraft:${stonecutter.current().version()}" + mappings "net.fabricmc:yarn:${property('deps.yarn')}:v2" - modCompileOnly fabricApi.module("fabric-api-base", "${project.fabric_api}") - modCompileOnly fabricApi.module("fabric-resource-loader-v0", "${project.fabric_api}") - modCompileOnly fabricApi.module("fabric-command-api-v2", "${project.fabric_api}") + modImplementation "net.fabricmc:fabric-loader:${property('deps.fabric-loader')}" + modImplementation "net.fabricmc.fabric-api:fabric-api:${property('deps.fabric-api')}" - modImplementation("com.terraformersmc:modmenu:${project.modmenu}") { - exclude(group: "net.fabricmc.fabric-api") - } + modImplementation "com.terraformersmc:modmenu:${property('deps.modmenu')}" + modImplementation "me.shedaniel.cloth:cloth-config-fabric:${property('deps.cloth-config')}" - modImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth}") { - exclude(group: "net.fabricmc.fabric-api") - } - } + include project(":defaults:${stonecutter.current().version()}") +} - fletchingTable { - defaultMixinEnvironment = "auto" - } +fletchingTable { + defaultMixinEnvironment = "auto" +} - processResources { - inputs.property "version", rootProject.version - filteringCharset "UTF-8" +loom { + accessWidenerPath = file("../../src/main/resources/citresewn.accesswidener") - filesMatching("fabric.mod.json") { - expand "version": rootProject.version - } + runConfigs.configureEach { + ideConfigGenerated = true } +} +java { + //withSourcesJar() sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 - java { - archivesBaseName = project.archives_base_name - } - - jar { - archiveClassifier.set "dev" + archivesBaseName = property('mod.jarname') +} - from("LICENSE") { - rename { "${it}_${project.archivesBaseName}" } - } +processResources { + filesMatching('fabric.mod.json') { + expand 'mod_version': version, 'mod_target_mc': project.property('mod.target-mc') } } -apply plugin: 'com.modrinth.minotaur' -apply plugin: 'com.matthewprenger.cursegradle' +jar { + archiveClassifier.set 'dev' -loom { - accessWidenerPath = file("src/main/resources/citresewn.accesswidener") + from rootProject.file('LICENSE') } -dependencies { - afterEvaluate { - include project("defaults:") +if (stonecutter.current().isActiveVersion()) { + plugins.apply 'com.modrinth.minotaur' + plugins.apply 'com.matthewprenger.cursegradle' + + modrinth { + token = TOKEN_MODRINTH + projectId = property('publish.modrinth.id') + uploadFile = remapJar + changelog = java.nio.file.Files.readString(rootProject.file("Changelog.md").toPath()) + versionNumber = version + versionName = "v" + version + //additionalFiles = [sourcesJar.outputs.getFiles().singleFile] + gameVersions = Arrays.asList(property('mod.target-mc-publish').split(",")) } -} - -java { - withSourcesJar() -} - -modrinth { - token = TOKEN_MODRINTH - projectId = "otVJckYQ" - uploadFile = remapJar - changelog = Files.readString(projectDir.toPath().resolve("Changelog.md")) - versionNumber = version - versionName = "v" + version - additionalFiles = [ sourcesJar.outputs.getFiles().singleFile ] - gameVersions = Arrays.asList(project.publish_minecraft_versions.split(",")) -} -curseforge { - apiKey = TOKEN_CURSEFORGE - project { - id = '521427' - changelogType = 'markdown' - changelog = file('Changelog.md') - releaseType = 'release' - mainArtifact(remapJar) { - displayName = "v" + version + curseforge { + apiKey = TOKEN_CURSEFORGE + project { + id = property('publish.curseforge.id') + changelogType = 'markdown' + changelog = rootProject.file('Changelog.md') + releaseType = 'release' + mainArtifact(remapJar) { + displayName = "v" + version + } + addGameVersion 'Fabric' + for (String version : property('mod.target-mc-publish').split(",")) + addGameVersion version + } + options { + forgeGradleIntegration = false } - addGameVersion 'Fabric' - for (String version : project.publish_minecraft_versions.split(",")) - addGameVersion version } - options { - forgeGradleIntegration = false + + rootProject.tasks.register('publish') { + setGroup 'project' + + Task remapJarTask = tasks.getByName 'remapJar' + Task curseforgeTask = tasks.getByName 'curseforge' + Task modrinthTask = tasks.getByName 'modrinth' + + dependsOn remapJarTask, curseforgeTask, modrinthTask + curseforgeTask.mustRunAfter remapJarTask + modrinthTask.mustRunAfter remapJarTask } } - -task publishVersion { - dependsOn 'remapJar', 'curseforge', 'modrinth', ':defaults:modrinth' - tasks.getByName("curseforge").mustRunAfter("remapJar") - tasks.getByName("modrinth").mustRunAfter("remapJar") -}
\ No newline at end of file |