2023-03-02 00:11:08 +01:00
|
|
|
plugins {
|
|
|
|
id 'java'
|
|
|
|
id 'eclipse'
|
2023-03-02 16:54:21 +01:00
|
|
|
alias libs.plugins.forgeGradle
|
|
|
|
alias libs.plugins.gitVersion
|
2023-03-02 10:43:58 +01:00
|
|
|
alias libs.plugins.checkerFramework
|
2023-02-07 01:52:48 +01:00
|
|
|
}
|
|
|
|
|
2023-02-01 21:53:08 +01:00
|
|
|
version = gitVersion()
|
2023-02-07 02:36:47 +01:00
|
|
|
group = 'ftbsc'
|
|
|
|
archivesBaseName = 'bscv'
|
|
|
|
|
2023-03-07 13:16:13 +01:00
|
|
|
def shortVersion = version.split('-')[0].replaceAll(".dirty", "") // necessary when there are no extra commits on tags, and thus no dash
|
2023-02-02 11:13:18 +01:00
|
|
|
|
2023-03-02 00:11:08 +01:00
|
|
|
project.ext {
|
2023-02-07 21:46:05 +01:00
|
|
|
deployJarDo = getProjectProperty("deployJar.do", "false")
|
|
|
|
deployJarTargetDir = getProjectProperty("deployJar.targetDir", ".")
|
2023-02-01 20:53:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
def getProjectProperty(String property, String fallback) { //allows for custom gradle.properties while retaining default fallback values
|
2023-02-07 21:46:05 +01:00
|
|
|
return (project.hasProperty(property)) ? project.property(property) : fallback
|
2023-02-01 20:53:23 +01:00
|
|
|
}
|
|
|
|
|
2023-03-02 00:11:08 +01:00
|
|
|
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
|
2023-01-24 01:07:30 +01:00
|
|
|
|
|
|
|
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
|
2023-02-01 20:53:23 +01:00
|
|
|
|
2023-01-24 01:07:30 +01:00
|
|
|
minecraft {
|
2023-03-02 00:11:08 +01:00
|
|
|
mappings channel: 'official', version: libs.versions.minecraft.get()
|
2023-02-13 18:26:00 +01:00
|
|
|
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
|
2023-02-07 21:46:05 +01:00
|
|
|
runs {
|
|
|
|
client {
|
|
|
|
workingDirectory project.file('run')
|
|
|
|
property 'forge.logging.markers', 'REGISTRIES'
|
|
|
|
property 'forge.logging.console.level', 'debug'
|
|
|
|
mods {
|
2023-03-02 00:11:08 +01:00
|
|
|
bscv.source sourceSets.main
|
2023-02-07 21:46:05 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
data {
|
|
|
|
workingDirectory project.file('run')
|
|
|
|
property 'forge.logging.markers', 'REGISTRIES'
|
|
|
|
property 'forge.logging.console.level', 'debug'
|
|
|
|
args '--mod', 'bsvc', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
|
|
|
|
mods {
|
2023-03-02 00:11:08 +01:00
|
|
|
bscv.source sourceSets.main
|
2023-02-07 21:46:05 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-01-24 01:07:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
|
|
|
|
2023-03-02 00:11:08 +01:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven { url = 'https://maven.fantabos.co' }
|
|
|
|
}
|
|
|
|
|
2023-01-24 01:07:30 +01:00
|
|
|
dependencies {
|
2023-03-02 00:11:08 +01:00
|
|
|
minecraft libs.minecraftForge
|
|
|
|
implementation libs.lillero
|
|
|
|
implementation libs.lilleroProcessor
|
|
|
|
implementation libs.autoServiceAnnotations
|
|
|
|
annotationProcessor libs.lilleroProcessor
|
|
|
|
annotationProcessor libs.autoService
|
2023-01-24 01:07:30 +01:00
|
|
|
}
|
|
|
|
|
2023-03-18 22:54:59 +01:00
|
|
|
compileJava { //mappings for lillero-processor
|
|
|
|
options.compilerArgs << '-AmappingsFile=https://data.fantabos.co/output.tsrg'
|
|
|
|
}
|
|
|
|
|
2023-01-24 01:07:30 +01:00
|
|
|
jar {
|
2023-03-02 00:33:14 +01:00
|
|
|
archiveFileName = "${jar.archiveBaseName.get()}-${shortVersion}.${jar.archiveExtension.get()}"
|
2023-02-07 21:46:05 +01:00
|
|
|
manifest {
|
|
|
|
attributes([
|
|
|
|
"Specification-Title": "bscv",
|
|
|
|
"Specification-Vendor": "ftbsc",
|
|
|
|
"Specification-Version": "1", // We are version 1 of ourselves
|
|
|
|
"Implementation-Title": project.name,
|
2023-03-02 00:33:14 +01:00
|
|
|
"Implementation-Version": project.version,
|
2023-02-07 21:46:05 +01:00
|
|
|
"Implementation-Vendor" :"ftbsc",
|
|
|
|
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
|
|
|
|
])
|
|
|
|
}
|
2023-01-24 01:07:30 +01:00
|
|
|
}
|
|
|
|
|
2023-02-01 20:53:23 +01:00
|
|
|
jar.finalizedBy('reobfJar')
|
|
|
|
|
2023-02-02 00:23:02 +01:00
|
|
|
//copy jar from build/libs to the forge mod folder
|
2023-02-02 11:13:18 +01:00
|
|
|
tasks.register('deployJar', Copy) {
|
2023-02-07 21:46:05 +01:00
|
|
|
if (!project.ext.deployJarDo.toBoolean()) return
|
|
|
|
from project.jar
|
|
|
|
into project.ext.deployJarTargetDir
|
2023-02-01 20:53:23 +01:00
|
|
|
}
|
2023-01-24 01:07:30 +01:00
|
|
|
|
2023-02-01 21:09:45 +01:00
|
|
|
build {
|
2023-02-07 21:46:05 +01:00
|
|
|
finalizedBy deployJar
|
2023-02-01 21:53:08 +01:00
|
|
|
}
|