mirror of
https://github.com/chylex/Hardcore-Ender-Expansion-2.git
synced 2025-03-16 20:15:43 +01:00
203 lines
4.4 KiB
Groovy
203 lines
4.4 KiB
Groovy
ext {
|
|
mc_version = "1.15.2"
|
|
forge_version = "31.2.27"
|
|
mapping_version = "20200626-1.15.1"
|
|
kotlin_mod_version = "1.6.1"
|
|
}
|
|
|
|
buildscript {
|
|
ext {
|
|
kotlin_version = "1.4.10"
|
|
}
|
|
|
|
repositories {
|
|
jcenter()
|
|
mavenCentral()
|
|
|
|
maven {
|
|
url = "https://files.minecraftforge.net/maven"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
classpath(group: "net.minecraftforge.gradle", name: "ForgeGradle", version: "3.+", changing: true) {
|
|
exclude group: "trove", module: "trove"
|
|
}
|
|
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:" + kotlin_version
|
|
}
|
|
}
|
|
|
|
apply plugin: "net.minecraftforge.gradle"
|
|
apply plugin: "eclipse"
|
|
apply plugin: "idea"
|
|
|
|
if (file("run/mods_deobf.gradle").exists()){
|
|
apply from: "run/mods_deobf.gradle"
|
|
}
|
|
|
|
def prefixName = "displayName = "
|
|
def prefixVersion = "version = "
|
|
|
|
def metaLines = file("src/main/resources/META-INF/mods.toml").readLines()
|
|
def metaName = metaLines.find { line -> line.startsWith(prefixName) }.substring(prefixName.length())[1..-2]
|
|
def metaVersion = metaLines.find { line -> line.startsWith(prefixVersion) }.substring(prefixVersion.length())[1..-2]
|
|
|
|
group = "chylex.hee"
|
|
version = metaVersion
|
|
archivesBaseName = metaName.replaceAll("\\s", "")
|
|
|
|
idea {
|
|
module {
|
|
[".idea", ".settings", ".classpath", ".project", "gradle", "out", "run"].each {
|
|
excludeDirs << file(it)
|
|
}
|
|
}
|
|
}
|
|
|
|
allprojects {
|
|
apply plugin: "kotlin"
|
|
|
|
sourceCompatibility = targetCompatibility = "1.8"
|
|
|
|
tasks.withType(JavaCompile) {
|
|
sourceCompatibility = targetCompatibility = "1.8"
|
|
}
|
|
|
|
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
|
|
kotlinOptions {
|
|
jvmTarget = "1.8"
|
|
apiVersion = "1.4"
|
|
languageVersion = "1.4"
|
|
freeCompilerArgs = [
|
|
"-Xno-call-assertions",
|
|
"-Xno-param-assertions",
|
|
"-Xno-receiver-assertions",
|
|
"-Xjvm-default=all",
|
|
"-Xuse-experimental=kotlin.ExperimentalUnsignedTypes",
|
|
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts",
|
|
"-XXLanguage:+InlineClasses"
|
|
]
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
maven {
|
|
name = "kotlinforforge"
|
|
url = "https://thedarkcolour.github.io/KotlinForForge/"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib"
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
|
implementation "org.jetbrains.kotlin:kotlin-reflect"
|
|
}
|
|
|
|
if (file("$buildDir/classes").exists()){
|
|
file("$buildDir/classes/java/main").mkdirs() // Forge complains when the java folder is missing
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
resources {
|
|
srcDirs += file("data/gen")
|
|
exclude ".cache"
|
|
}
|
|
}
|
|
}
|
|
|
|
minecraft {
|
|
mappings channel: "snapshot", version: rootProject.mapping_version
|
|
|
|
accessTransformer = file("src/main/resources/META-INF/accesstransformer.cfg")
|
|
|
|
runs {
|
|
client {
|
|
properties "hee.debug": ""
|
|
workingDirectory file("run")
|
|
|
|
mods {
|
|
hee {
|
|
source sourceSets.main
|
|
source project(":system").sourceSets.main
|
|
}
|
|
}
|
|
}
|
|
|
|
server {
|
|
properties "hee.debug": ""
|
|
workingDirectory file("run")
|
|
|
|
mods {
|
|
hee {
|
|
source sourceSets.main
|
|
source project(":system").sourceSets.main
|
|
}
|
|
}
|
|
}
|
|
|
|
data {
|
|
args "--mod", "hee"
|
|
args "--all"
|
|
args "--output", file("data/gen")
|
|
args "--existing", sourceSets.main.resources.srcDirs.first().toString()
|
|
|
|
workingDirectory file("run")
|
|
ideaModule project.name + "." + project(":datagen").name + ".main"
|
|
|
|
mods {
|
|
hee {
|
|
source sourceSets.main
|
|
source project(":system").sourceSets.main
|
|
source project(":datagen").sourceSets.main
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
minecraft "net.minecraftforge:forge:" + mc_version + "-" + forge_version
|
|
implementation "thedarkcolour:kotlinforforge:" + kotlin_mod_version
|
|
implementation project(":system")
|
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter-api:5.3.0-RC1"
|
|
testImplementation project(":system")
|
|
}
|
|
|
|
test {
|
|
systemProperty "junit.jupiter.testinstance.lifecycle.default", "per_class"
|
|
}
|
|
|
|
jar {
|
|
archiveName = archivesBaseName + "-" + mc_version + "-v" + version + ".jar"
|
|
|
|
from(project(":system").sourceSets.main.output) {
|
|
exclude "META-INF"
|
|
}
|
|
|
|
from("./data/gen") {
|
|
exclude ".cache"
|
|
}
|
|
|
|
from("./") {
|
|
include "LICENSE"
|
|
}
|
|
|
|
manifest {
|
|
attributes([
|
|
"Specification-Title" : "hee",
|
|
"Specification-Version" : "1",
|
|
"Specification-Vendor" : "chylex",
|
|
|
|
"Implementation-Title" : metaName,
|
|
"Implementation-Version" : metaVersion,
|
|
"Implementation-Vendor" : "chylex",
|
|
|
|
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
|
|
])
|
|
}
|
|
}
|