plugins.apply 'fabric-loom' plugins.apply 'io.shcm.shsupercm.fabric.fletchingtable' version = "${property('mod.version')}+${stonecutter.current().version()}" group = 'shcm.shsupercm.fabric.citresewn' repositories { maven { url 'https://maven.terraformersmc.com/releases/' } maven { url 'https://maven.shedaniel.me/' } } dependencies { minecraft "com.mojang:minecraft:${stonecutter.current().version()}" mappings "net.fabricmc:yarn:${property('deps.yarn')}:v2" modCompileOnly "net.fabricmc:fabric-loader:${property('deps.fabric-loader')}" modCompileOnly "net.fabricmc.fabric-api:fabric-api:${property('deps.fabric-api')}" modCompileOnly "com.terraformersmc:modmenu:${property('deps.modmenu')}" modCompileOnly "me.shedaniel.cloth:cloth-config-fabric:${property('deps.cloth-config')}" include project(":defaults:${stonecutter.current().version()}") } fletchingTable { defaultMixinEnvironment = "auto" } loom { accessWidenerPath = file("../../src/main/resources/citresewn.accesswidener") runConfigs.client.ideConfigGenerated = false runConfigs.server.ideConfigGenerated = false } java { withSourcesJar() sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 archivesBaseName = property('mod.jarname') } processResources { filesMatching('fabric.mod.json') { expand 'mod_version': version, 'mod_target_mc': project.property('mod.target-mc') } } jar { archiveClassifier.set 'dev' from rootProject.file('LICENSE') } 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' 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('publish.target-mc').split(",")) } 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('publish.target-mc').split(",")) addGameVersion version } options { forgeGradleIntegration = false } } 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' dependsOn remapJarTask, curseforgeTask, modrinthTask curseforgeTask.mustRunAfter remapJarTask modrinthTask.mustRunAfter remapJarTask } }