mirror of
https://github.com/Suiranoil/SkinRestorer.git
synced 2026-01-16 04:42:12 +00:00
architectury
This commit is contained in:
132
build.gradle
132
build.gradle
@@ -1,42 +1,66 @@
|
||||
plugins {
|
||||
id 'fabric-loom' version '1.7-SNAPSHOT'
|
||||
id "com.modrinth.minotaur" version "2.+"
|
||||
id 'net.darkhax.curseforgegradle' version '1.1.15'
|
||||
id 'dev.architectury.loom' version '1.6-SNAPSHOT' apply false
|
||||
id 'architectury-plugin' version '3.4-SNAPSHOT'
|
||||
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
|
||||
// id "com.modrinth.minotaur" version "2.+"
|
||||
// id 'net.darkhax.curseforgegradle' version '1.1.15'
|
||||
}
|
||||
|
||||
version = "${project.mod_version}+${project.minecraft_version}"
|
||||
group = project.maven_group
|
||||
|
||||
ext.version_name = "${project.capitalized_name} ${project.mod_version}"
|
||||
ext.headTag = "git describe --tags --abbrev=0 HEAD".execute([], rootProject.projectDir).text.trim()
|
||||
ext.previousTag = "git describe --tags --abbrev=0 HEAD^".execute([], rootProject.projectDir).text.trim()
|
||||
|
||||
dependencies {
|
||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||
architectury {
|
||||
minecraft = project.minecraft_version
|
||||
}
|
||||
|
||||
processResources {
|
||||
inputs.property "version", project.version
|
||||
allprojects {
|
||||
version = "${project.mod_version}+${project.minecraft_version}"
|
||||
group = project.maven_group
|
||||
}
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand "version": project.version
|
||||
subprojects {
|
||||
apply plugin: 'dev.architectury.loom'
|
||||
apply plugin: 'architectury-plugin'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
base {
|
||||
// Set up a suffixed format for the mod jar names, e.g. `example-fabric`.
|
||||
archivesName = "$rootProject.archives_name-$project.name"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
it.options.encoding = "UTF-8"
|
||||
repositories {
|
||||
// Add repositories to retrieve artifacts from in here.
|
||||
// You should only use this when depending on other mods because
|
||||
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
|
||||
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
|
||||
// for more information about repositories.
|
||||
}
|
||||
|
||||
it.options.release.set(21)
|
||||
}
|
||||
dependencies {
|
||||
minecraft "net.minecraft:minecraft:$rootProject.minecraft_version"
|
||||
mappings loom.layered {
|
||||
it.mappings("net.fabricmc:yarn:$rootProject.yarn_mappings:v2")
|
||||
it.mappings("dev.architectury:yarn-mappings-patch-neoforge:$rootProject.yarn_mappings_patch_neoforge_version")
|
||||
}
|
||||
}
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
}
|
||||
java {
|
||||
withSourcesJar()
|
||||
|
||||
jar {
|
||||
from "LICENSE"
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
}
|
||||
|
||||
jar {
|
||||
from "$rootProject.projectDir/LICENSE"
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
it.options.encoding = "UTF-8"
|
||||
|
||||
it.options.release.set(21)
|
||||
}
|
||||
}
|
||||
|
||||
// Adapted from https://raw.githubusercontent.com/TerraformersMC/GradleScripts/2.7/ferry.gradle
|
||||
@@ -79,36 +103,36 @@ tasks.register('assertNewVersion') {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('publish') {
|
||||
group = 'publishing'
|
||||
dependsOn 'assertNewVersion'
|
||||
dependsOn 'generateChangelog'
|
||||
dependsOn 'modrinth'
|
||||
// dependsOn 'curseforge'
|
||||
doFirst {
|
||||
println "Last version: $previousTag"
|
||||
println "Current version: $headTag"
|
||||
println "Changelog:"
|
||||
println generateChangelog.changelog
|
||||
}
|
||||
}
|
||||
|
||||
modrinth {
|
||||
token = System.getenv('MODRINTH_TOKEN')
|
||||
projectId = project.modrinth_id
|
||||
versionName = version_name
|
||||
versionType = "release"
|
||||
changelog = generateChangelog.changelog
|
||||
uploadFile = remapJar
|
||||
project.modrinth_game_versions.split(',').each {
|
||||
gameVersions.add(it.trim())
|
||||
}
|
||||
project.modrinth_mod_loaders.split(',').each {
|
||||
loaders.add(it.trim())
|
||||
}
|
||||
}
|
||||
|
||||
tasks.modrinth.dependsOn('assertNewVersion')
|
||||
//tasks.register('publish') {
|
||||
// group = 'publishing'
|
||||
// dependsOn 'assertNewVersion'
|
||||
// dependsOn 'generateChangelog'
|
||||
// dependsOn 'modrinth'
|
||||
//// dependsOn 'curseforge'
|
||||
// doFirst {
|
||||
// println "Last version: $previousTag"
|
||||
// println "Current version: $headTag"
|
||||
// println "Changelog:"
|
||||
// println generateChangelog.changelog
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//modrinth {
|
||||
// token = System.getenv('MODRINTH_TOKEN')
|
||||
// projectId = project.modrinth_id
|
||||
// versionName = version_name
|
||||
// versionType = "release"
|
||||
// changelog = generateChangelog.changelog
|
||||
// uploadFile = remapJar
|
||||
// project.modrinth_game_versions.split(',').each {
|
||||
// gameVersions.add(it.trim())
|
||||
// }
|
||||
// project.modrinth_mod_loaders.split(',').each {
|
||||
// loaders.add(it.trim())
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//tasks.modrinth.dependsOn('assertNewVersion')
|
||||
|
||||
// cannot test it, returns 403 Forbidden. disabled for now
|
||||
//import net.darkhax.curseforgegradle.TaskPublishCurseForge
|
||||
|
||||
Reference in New Issue
Block a user