1 Star 0 Fork 0

The Cat Town Craft/Carpet-TCTC-Addition

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle 2.56 KB
一键复制 编辑 原始数据 按行查看 历史
Hendrix-Shen 提交于 2023-12-17 16:07 . Support Minecraft 1.20.4
plugins {
id("maven-publish")
id("fabric-loom").version("1.4-SNAPSHOT").apply(false)
id("org.ajoberstar.grgit").version("5.2.0")
id("com.replaymod.preprocess").version("SNAPSHOT")
}
preprocess {
def mc1144 = createNode("1.14.4", 1_14_04, "mojang")
def mc1152 = createNode("1.15.2", 1_15_02, "mojang")
def mc1165 = createNode("1.16.5", 1_16_05, "mojang")
def mc1171 = createNode("1.17.1", 1_17_01, "mojang")
def mc1182 = createNode("1.18.2", 1_18_02, "mojang")
def mc1192 = createNode("1.19.2", 1_19_02, "mojang")
def mc1193 = createNode("1.19.3", 1_19_03, "mojang")
def mc1194 = createNode("1.19.4", 1_19_04, "mojang")
def mc1201 = createNode("1.20.1", 1_20_01, "mojang")
def mc1202 = createNode("1.20.2", 1_20_02, "mojang")
def mc1204 = createNode("1.20.4", 1_20_04, "mojang")
mc1144.link(mc1152, null)
mc1152.link(mc1165, null)
mc1165.link(mc1171, null)
mc1171.link(mc1182, null)
mc1182.link(mc1192, null)
mc1192.link(mc1193, null)
mc1193.link(mc1194, null)
mc1194.link(mc1201, null)
mc1201.link(mc1202, null)
mc1202.link(mc1204, null)
}
ext {
def env = System.getenv()
getVersionGit = { List paths ->
if (grgit == null) {
return "nogit"
}
List latestCommits = paths.isEmpty() ? grgit.log(maxCommits: 1) : grgit.log(paths: paths, maxCommits: 1)
return latestCommits.isEmpty() ? "uncommited" : "${latestCommits.get(0).id.substring(0, 7)}"
}
getBuildNumber = {
return env.GITHUB_RUN_NUMBER ? env.GITHUB_RUN_NUMBER : Integer.MAX_VALUE
}
getVersionType = {
switch (env.BUILD_TYPE) {
case "RELEASE":
return "stable"
case "BETA":
return "beta"
default:
return "dev"
}
}
getVersionPatch = { List paths ->
if (grgit == null) {
return 0
}
List latestCommits = paths.isEmpty() ? grgit.log() : grgit.log(paths: paths)
return latestCommits.size()
}
getMavenArtifactVersion = {
return ext.getVersionType() == "stable" ? "${project.mod_version}.${ext.getVersionPatch([])}" : project.version
}
}
setVersion("${project.mod_version}.${project.getVersionPatch([])}+${project.getVersionGit([])}-${project.getVersionType()}")
tasks.register("cleanPreprocessSources") {
it.group("${project.mod_id}")
doFirst {
subprojects {
def path = project.projectDir.toPath().resolve("build/preprocessed")
path.toFile().deleteDir()
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/the-cat-town-craft/Carpet-TCTC-Addition.git
[email protected]:the-cat-town-craft/Carpet-TCTC-Addition.git
the-cat-town-craft
Carpet-TCTC-Addition
Carpet-TCTC-Addition
dev

搜索帮助