加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle 2.29 KB
一键复制 编辑 原始数据 按行查看 历史
XiLaiTL 提交于 2023-08-01 19:47 . update(*) update the licence
allprojects {
apply plugin: "java"
apply plugin: "maven-publish"
archivesBaseName = rootProject.archives_base_name
version = rootProject.mod_version
group = rootProject.maven_group
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.
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 17
}
java {
withSourcesJar()
}
}
def versions = ['1.16.5','1.18.2','1.19.2','1.19.4','1.20.1'];
def apis = ['forge','fabric']
versions.forEach {ver->
apis.forEach {api->
tasks.register("runClient-${ver}-${api}"){
dependsOn(":${ver}:${api}:runClient")
}
tasks.register("build-jar-${ver}-${api}",Copy){
dependsOn(":${ver}:${api}:build")
with{
from("./${ver}/${api}/build/libs/yuushya-${mod_version}.jar")
rename {"yuushya-${ver}-${api}-${mod_version}.jar"}
into("./build/libs")
duplicatesStrategy(DuplicatesStrategy.INHERIT)
}
}
}
}
tasks.register("build-jar"){
versions.forEach {ver->
apis.forEach { api ->
dependsOn "build-jar-${ver}-${api}"
}
}
}
tasks.register("clean-all"){
dependsOn(":common:clean")
versions.forEach { ver ->
(["common"]+apis).forEach { api ->
dependsOn(":${ver}:${api}:clean")
}
}
}
tasks.register("build-tools",Copy){
from("./buildSrc/build/libs/buildSrc-0.0.0.jar")
rename {"yuushya-tool.jar"}
into("./build/tools")
}
def build_tasks = versions.collectMany {ver-> apis.collect {api-> "build-jar-${ver}-${api}"}}
tasks.register("gen-chain",SequenceTask,["clean-all",":common:generateAssetsAndData",":common:copyResources"])
tasks.register("build-chain1",SequenceTask,["gen-chain"]+build_tasks.subList(0, build_tasks.size()/2 as int))
tasks.register("build-chain2",SequenceTask,build_tasks.subList(build_tasks.size()/2 as int,build_tasks.size()))
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化