175 lines
4.8 KiB
Groovy
175 lines
4.8 KiB
Groovy
plugins {
|
|
id 'java-library'
|
|
id 'eclipse'
|
|
id 'idea'
|
|
id 'maven-publish'
|
|
id 'net.neoforged.gradle.userdev' version "${neogradle_version}"
|
|
id 'com.matthewprenger.cursegradle' version "${cursegradle_version}"
|
|
}
|
|
|
|
jarJar.enable()
|
|
|
|
boolean flywheelInWorkspace = findProject(':Flywheel') != null
|
|
|
|
ext.buildNumber = System.getenv('BUILD_NUMBER')
|
|
|
|
version = mod_version
|
|
group = 'nl.requios.effortlessbuilding'
|
|
base {
|
|
archivesName = "effortlessbuilding-${artifact_minecraft_version}"
|
|
}
|
|
|
|
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
|
|
|
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + ' (' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
|
|
|
|
minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg')
|
|
|
|
runs {
|
|
// applies to all the run configs below
|
|
configureEach { net.neoforged.gradle.dsl.common.runs.run.Run run ->
|
|
// Recommended logging data for a userdev environment
|
|
systemProperty 'forge.logging.markers', 'REGISTRIES'
|
|
|
|
// Recommended logging level for the console
|
|
systemProperty 'forge.logging.console.level', 'debug'
|
|
|
|
//Limit ram usage for the dev environment to 4GB
|
|
jvmArgument '-Xmx4G'
|
|
if (run.project.javaToolchains.launcherFor(java.toolchain).map { it.metadata.vendor }.getOrElse("").contains("JetBrains")) {
|
|
jvmArgument '-XX:+AllowEnhancedClassRedefinition'
|
|
}
|
|
|
|
modSource project.sourceSets.main
|
|
}
|
|
|
|
client {
|
|
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
|
|
systemProperty 'neoforge.enabledGameTestNamespaces', "effortlessbuilding"
|
|
|
|
if (flywheelInWorkspace) {
|
|
dependencies {
|
|
runtime project(':Flywheel')
|
|
}
|
|
}
|
|
}
|
|
|
|
server {
|
|
systemProperty 'neoforge.enabledGameTestNamespaces', "effortlessbuilding"
|
|
programArgument '--nogui'
|
|
}
|
|
|
|
data {
|
|
// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
|
|
// workingDirectory project.file('run-data')
|
|
|
|
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
|
|
programArguments.addAll '--mod', "effortlessbuilding", '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
maven {
|
|
// location of the maven for Registrate and Flywheel
|
|
name = 'tterrag maven'
|
|
url = 'https://maven.tterrag.com'
|
|
}
|
|
exclusiveContent {
|
|
forRepository {
|
|
maven {
|
|
url "https://cursemaven.com"
|
|
}
|
|
}
|
|
filter {
|
|
includeGroup "curse.maven"
|
|
}
|
|
}
|
|
maven {
|
|
name = "Modrinth"
|
|
url = "https://api.modrinth.com/maven"
|
|
content {
|
|
includeGroup "maven.modrinth"
|
|
}
|
|
}
|
|
|
|
mavenLocal()
|
|
flatDir {
|
|
dirs 'libs'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation "net.neoforged:neoforge:${neo_version}"
|
|
|
|
jarJar("com.jozufozu.flywheel:flywheel-forge-${flywheel_minecraft_version}:${flywheel_version}") {
|
|
version { prefer "0.6.10" }
|
|
}
|
|
|
|
if (flywheelInWorkspace) {
|
|
implementation project(':Flywheel')
|
|
} else {
|
|
implementation "com.jozufozu.flywheel:flywheel-forge-${flywheel_minecraft_version}:${flywheel_version}"
|
|
}
|
|
}
|
|
|
|
sourceSets.main.resources {
|
|
srcDir 'src/generated/resources'
|
|
exclude '.cache/'
|
|
}
|
|
tasks.withType(JavaCompile).configureEach {
|
|
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
|
|
}
|
|
|
|
compileJava {
|
|
options.compilerArgs = ['-Xdiags:verbose']
|
|
}
|
|
|
|
jar {
|
|
manifest {
|
|
attributes([
|
|
"Specification-Title": "effortlessbuilding",
|
|
"Specification-Vendor": "requios",
|
|
"Specification-Version": "1",
|
|
"Implementation-Title": project.name,
|
|
"Implementation-Version": project.jar.archiveVersion,
|
|
"Implementation-Vendor" :"requios",
|
|
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
|
|
])
|
|
}
|
|
}
|
|
|
|
task jarJarRelease {
|
|
group = 'jarjar'
|
|
doLast {
|
|
tasks.jarJar {
|
|
classifier = ''
|
|
}
|
|
}
|
|
finalizedBy tasks.jarJar
|
|
}
|
|
|
|
java {
|
|
withSourcesJar()
|
|
withJavadocJar()
|
|
}
|
|
|
|
tasks.build.dependsOn tasks.jarJar
|
|
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
artifactId = base.archivesName.get()
|
|
|
|
from components.java
|
|
// fg.component(it)
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
if (project.hasProperty('mavendir')) {
|
|
maven { url mavendir }
|
|
}
|
|
}
|
|
}
|
|
|