2021-06-16 21:57:52 +02:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
2021-07-24 01:45:38 +02:00
|
|
|
maven { url = 'https://maven.minecraftforge.net' }
|
2021-06-16 21:57:52 +02:00
|
|
|
mavenCentral()
|
2021-11-08 22:19:48 +01:00
|
|
|
maven { url = 'https://repo.spongepowered.org/repository/maven-public' }
|
|
|
|
maven { url = 'https://maven.parchmentmc.org' }
|
2021-06-16 21:57:52 +02:00
|
|
|
}
|
|
|
|
dependencies {
|
2022-08-13 22:54:52 +02:00
|
|
|
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: "${forgegradle_version}", changing: false
|
2021-11-08 22:19:48 +01:00
|
|
|
classpath "org.spongepowered:mixingradle:${mixingradle_version}"
|
|
|
|
classpath "org.parchmentmc:librarian:${librarian_version}"
|
2021-06-16 21:57:52 +02:00
|
|
|
}
|
|
|
|
}
|
2022-07-15 09:00:54 +02:00
|
|
|
|
2021-06-16 21:57:52 +02:00
|
|
|
plugins {
|
2021-11-08 22:19:48 +01:00
|
|
|
id 'com.matthewprenger.cursegradle' version "${cursegradle_version}"
|
2021-06-16 21:57:52 +02:00
|
|
|
}
|
|
|
|
apply plugin: 'net.minecraftforge.gradle'
|
2021-12-25 10:01:47 +01:00
|
|
|
apply plugin: 'org.parchmentmc.librarian.forgegradle'
|
2021-07-24 01:45:38 +02:00
|
|
|
apply plugin: 'eclipse'
|
2021-06-21 22:56:27 +02:00
|
|
|
apply plugin: 'maven-publish'
|
2021-06-16 21:57:52 +02:00
|
|
|
apply plugin: 'org.spongepowered.mixin'
|
|
|
|
|
2022-08-05 19:51:07 +02:00
|
|
|
jarJar.enable()
|
|
|
|
|
2021-06-21 01:20:18 +02:00
|
|
|
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equalsIgnoreCase('false');
|
2021-06-19 08:52:13 +02:00
|
|
|
|
2022-02-09 04:26:36 +01:00
|
|
|
ext.buildNumber = System.getenv('BUILD_NUMBER')
|
2021-06-21 01:20:18 +02:00
|
|
|
|
2021-06-21 22:56:27 +02:00
|
|
|
group = 'com.jozufozu.flywheel'
|
2022-07-15 09:00:54 +02:00
|
|
|
archivesBaseName = "flywheel-forge-${artifact_minecraft_version}"
|
|
|
|
version = mod_version + (dev && buildNumber != null ? "-${buildNumber}" : '')
|
2021-06-16 21:57:52 +02:00
|
|
|
|
2021-12-07 06:29:21 +01:00
|
|
|
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
2021-06-16 21:57:52 +02:00
|
|
|
|
2021-09-19 02:01:20 +02:00
|
|
|
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
|
2021-06-16 21:57:52 +02:00
|
|
|
minecraft {
|
2021-12-24 08:09:51 +01:00
|
|
|
mappings channel: 'parchment', version: "${parchment_version}-${minecraft_version}"
|
2021-06-16 21:57:52 +02:00
|
|
|
|
|
|
|
runs {
|
|
|
|
client {
|
|
|
|
workingDirectory project.file('run')
|
|
|
|
|
|
|
|
property 'forge.logging.markers', ''
|
|
|
|
property 'forge.logging.console.level', 'debug'
|
2021-09-17 05:03:45 +02:00
|
|
|
property 'mixin.debug.export', 'true'
|
2022-07-11 00:08:59 +02:00
|
|
|
property 'mixin.env.remapRefMap', 'true'
|
|
|
|
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
|
2022-06-09 21:44:52 +02:00
|
|
|
property 'flw.dumpShaderSource', 'true'
|
2022-08-05 19:51:07 +02:00
|
|
|
property 'flw.loadRenderDoc', 'true'
|
2022-08-18 01:20:31 +02:00
|
|
|
property 'flw.debugMemorySafety', 'true'
|
2021-06-16 21:57:52 +02:00
|
|
|
|
2021-11-18 23:59:39 +01:00
|
|
|
arg '-mixin.config=flywheel.mixins.json'
|
2023-04-13 19:16:33 +02:00
|
|
|
arg '-mixin.config=flywheel.sodium.mixins.json'
|
2021-06-16 21:57:52 +02:00
|
|
|
|
|
|
|
mods {
|
|
|
|
flywheel {
|
|
|
|
source sourceSets.main
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
workingDirectory project.file('run')
|
|
|
|
|
|
|
|
property 'forge.logging.markers', 'REGISTRIES'
|
|
|
|
property 'forge.logging.console.level', 'debug'
|
|
|
|
|
2021-11-18 23:59:39 +01:00
|
|
|
arg '-mixin.config=flywheel.mixins.json'
|
2023-04-13 19:16:33 +02:00
|
|
|
arg '-mixin.config=flywheel.sodium.mixins.json'
|
2021-06-16 21:57:52 +02:00
|
|
|
|
|
|
|
mods {
|
|
|
|
flywheel {
|
|
|
|
source sourceSets.main
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
data {
|
|
|
|
workingDirectory project.file('run')
|
|
|
|
|
|
|
|
property 'forge.logging.markers', 'REGISTRIES'
|
|
|
|
property 'forge.logging.console.level', 'debug'
|
|
|
|
|
|
|
|
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
|
|
|
|
args '--mod', 'flywheel', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
|
|
|
|
|
|
|
|
mods {
|
|
|
|
flywheel {
|
|
|
|
source sourceSets.main
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
2021-12-27 00:41:20 +01:00
|
|
|
maven {
|
|
|
|
url 'https://www.cursemaven.com'
|
|
|
|
content {
|
|
|
|
includeGroup "curse.maven"
|
|
|
|
}
|
|
|
|
}
|
2021-06-16 21:57:52 +02:00
|
|
|
maven {
|
2021-11-18 23:59:39 +01:00
|
|
|
name 'tterrag maven'
|
|
|
|
url 'https://maven.tterrag.com/'
|
2021-06-16 21:57:52 +02:00
|
|
|
}
|
2022-07-11 00:08:59 +02:00
|
|
|
maven {
|
|
|
|
name = "Modrinth"
|
|
|
|
url = "https://api.modrinth.com/maven"
|
|
|
|
content {
|
|
|
|
includeGroup "maven.modrinth"
|
|
|
|
}
|
|
|
|
}
|
2022-08-05 19:51:07 +02:00
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
|
2023-03-30 07:03:28 +02:00
|
|
|
// Fix for loading non-mod libraries in dev-env, used for JOML and Miniball.
|
2022-08-05 19:51:07 +02:00
|
|
|
// https://gist.github.com/SizableShrimp/66b22f1b24c255e1491c8d98d3f11f83
|
|
|
|
// v--------------------------------------------------------------------v
|
|
|
|
configurations {
|
|
|
|
library
|
|
|
|
implementation.extendsFrom library
|
2021-06-16 21:57:52 +02:00
|
|
|
}
|
|
|
|
|
2022-08-05 19:51:07 +02:00
|
|
|
minecraft.runs.all {
|
|
|
|
lazyToken('minecraft_classpath') {
|
|
|
|
configurations.library.copyRecursive().resolve().collect { it.absolutePath }.join(File.pathSeparator)
|
|
|
|
}
|
2021-06-16 21:57:52 +02:00
|
|
|
}
|
2022-08-05 19:51:07 +02:00
|
|
|
// ^--------------------------------------------------------------------^
|
2021-06-16 21:57:52 +02:00
|
|
|
|
|
|
|
dependencies {
|
|
|
|
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
|
|
|
|
2023-03-30 07:03:28 +02:00
|
|
|
jarJar('org.joml:joml:1.10.5') {
|
|
|
|
jarJar.ranged(it, '[1.10.0,1.11.0)')
|
2022-07-30 01:06:25 +02:00
|
|
|
}
|
2023-03-30 07:03:28 +02:00
|
|
|
library 'org.joml:joml:1.10.5'
|
|
|
|
|
|
|
|
jarJar('com.dreizak:miniball:1.0.3') {
|
|
|
|
jarJar.ranged(it, '[1.0,2.0)')
|
|
|
|
}
|
|
|
|
library 'com.dreizak:miniball:1.0.3'
|
2022-07-30 01:06:25 +02:00
|
|
|
|
2022-07-11 00:08:59 +02:00
|
|
|
// switch to implementation for debugging
|
|
|
|
compileOnly fg.deobf("maven.modrinth:starlight-forge:1.0.2+1.18.2")
|
2022-08-18 01:20:31 +02:00
|
|
|
compileOnly fg.deobf("maven.modrinth:rubidium:0.5.3a")
|
|
|
|
compileOnly fg.deobf("maven.modrinth:oculus:1.18.2-1.2.5a")
|
2021-12-27 00:41:20 +01:00
|
|
|
|
2021-12-02 23:03:14 +01:00
|
|
|
// https://discord.com/channels/313125603924639766/725850371834118214/910619168821354497
|
|
|
|
// Prevent Mixin annotation processor from getting into IntelliJ's annotation processor settings
|
|
|
|
// This allows 'Settings > Build, Execution, and Deployment > Build Tools > Gradle > Build and run using' set to IntelliJ to work correctly
|
|
|
|
if (System.getProperty('idea.sync.active') != 'true') {
|
|
|
|
annotationProcessor "org.spongepowered:mixin:${mixin_version}:processor"
|
|
|
|
}
|
2021-06-16 21:57:52 +02:00
|
|
|
}
|
|
|
|
|
2022-07-15 09:00:54 +02:00
|
|
|
mixin {
|
|
|
|
add sourceSets.main, 'flywheel.refmap.json'
|
|
|
|
}
|
|
|
|
|
2022-07-16 04:29:42 +02:00
|
|
|
// Workaround for SpongePowered/MixinGradle#38
|
2022-07-15 18:42:14 +02:00
|
|
|
afterEvaluate {
|
|
|
|
tasks.configureReobfTaskForReobfJar.mustRunAfter(tasks.compileJava)
|
2022-08-05 19:51:07 +02:00
|
|
|
tasks.configureReobfTaskForReobfJarJar.mustRunAfter(tasks.compileJava)
|
2022-07-15 18:42:14 +02:00
|
|
|
}
|
|
|
|
|
2022-07-15 09:00:54 +02:00
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
|
|
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
|
|
|
|
}
|
|
|
|
|
2022-07-15 18:42:14 +02:00
|
|
|
javadoc {
|
|
|
|
source = [sourceSets.main.allJava]
|
|
|
|
// prevent java 8's strict doclint for javadocs from failing builds
|
|
|
|
options.addStringOption('Xdoclint:none', '-quiet')
|
|
|
|
}
|
|
|
|
|
2022-08-05 19:51:07 +02:00
|
|
|
compileJava {
|
|
|
|
options.compilerArgs = ['-Xdiags:verbose']
|
|
|
|
}
|
|
|
|
|
2021-06-16 21:57:52 +02:00
|
|
|
jar {
|
|
|
|
manifest {
|
|
|
|
attributes([
|
2021-11-18 23:59:39 +01:00
|
|
|
'Specification-Title' : 'flywheel',
|
|
|
|
//'Specification-Vendor': 'flywheel authors',
|
|
|
|
'Specification-Version' : '1', // We are version 1 of ourselves
|
2022-07-15 09:00:54 +02:00
|
|
|
'Implementation-Title' : project.jar.baseName,
|
|
|
|
'Implementation-Version' : project.jar.archiveVersion,
|
2021-11-18 23:59:39 +01:00
|
|
|
//'Implementation-Vendor': 'flywheel authors',
|
2022-07-15 09:00:54 +02:00
|
|
|
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
2023-04-13 19:16:33 +02:00
|
|
|
'MixinConfigs' : 'flywheel.mixins.json,flywheel.sodium.mixins.json'
|
2021-06-16 21:57:52 +02:00
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-15 09:00:54 +02:00
|
|
|
java {
|
|
|
|
withSourcesJar()
|
|
|
|
withJavadocJar()
|
2021-06-20 01:52:23 +02:00
|
|
|
}
|
|
|
|
|
2022-07-15 09:00:54 +02:00
|
|
|
void addLicense(jarTask) {
|
2022-07-16 04:29:42 +02:00
|
|
|
jarTask.from('LICENSE.md') {
|
|
|
|
rename '(.*)\\.(.*)', '$1_' + archivesBaseName + '.$2'
|
2022-07-15 09:00:54 +02:00
|
|
|
}
|
2021-07-28 02:31:58 +02:00
|
|
|
}
|
|
|
|
|
2022-07-15 09:00:54 +02:00
|
|
|
jar.finalizedBy('reobfJar')
|
2022-07-30 01:06:25 +02:00
|
|
|
tasks.jarJar.finalizedBy('reobfJarJar')
|
2022-07-15 09:00:54 +02:00
|
|
|
addLicense(jar)
|
2022-07-30 01:06:25 +02:00
|
|
|
addLicense(tasks.jarJar)
|
2021-06-21 01:20:18 +02:00
|
|
|
|
2021-06-21 22:56:27 +02:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
mavenJava(MavenPublication) {
|
2022-07-15 09:00:54 +02:00
|
|
|
artifactId = archivesBaseName
|
|
|
|
|
|
|
|
from components.java
|
|
|
|
fg.component(it)
|
2022-07-30 01:06:25 +02:00
|
|
|
jarJar.component(it)
|
2021-06-21 22:56:27 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
if (project.hasProperty('mavendir')) {
|
|
|
|
maven { url mavendir }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-19 08:52:13 +02:00
|
|
|
tasks.curseforge.enabled = !dev && project.hasProperty('jozu_curseforge_key')
|
|
|
|
|
|
|
|
curseforge {
|
|
|
|
if (project.hasProperty('jozu_curseforge_key')) {
|
|
|
|
apiKey = project.jozu_curseforge_key
|
|
|
|
}
|
|
|
|
|
|
|
|
project {
|
|
|
|
id = project.projectId
|
|
|
|
changelog = file('changelog.txt')
|
|
|
|
releaseType = project.curse_type
|
2021-06-20 01:52:23 +02:00
|
|
|
mainArtifact jar
|
2022-03-14 18:52:28 +01:00
|
|
|
addGameVersion '1.18.2'
|
2021-06-19 08:52:13 +02:00
|
|
|
}
|
|
|
|
}
|