2020-04-13 08:58:57 +02:00
|
|
|
plugins {
|
2021-11-20 18:54:22 +01:00
|
|
|
id 'fabric-loom' version "${loom_version}"
|
2021-10-15 01:20:56 +02:00
|
|
|
id 'maven-publish'
|
2021-11-08 22:19:48 +01:00
|
|
|
id 'com.matthewprenger.cursegradle' version "${cursegradle_version}"
|
2020-04-13 08:58:57 +02:00
|
|
|
}
|
2020-06-08 02:18:34 +02:00
|
|
|
|
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-17 06:00:15 +02:00
|
|
|
archivesBaseName = "flywheel-fabric-${artifact_minecraft_version}"
|
2022-07-15 09:00:54 +02:00
|
|
|
version = mod_version + (dev && buildNumber != null ? "-${buildNumber}" : '')
|
2019-07-11 09:03:08 +02:00
|
|
|
|
2021-12-13 02:24:43 +01:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
2021-10-15 01:20:56 +02:00
|
|
|
|
2021-12-07 06:29:21 +01:00
|
|
|
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
2019-07-11 09:03:08 +02:00
|
|
|
|
2023-06-27 03:55:00 +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 20:19:33 +02:00
|
|
|
|
2021-10-15 01:20:56 +02:00
|
|
|
repositories {
|
2021-12-27 00:41:20 +01:00
|
|
|
maven {
|
|
|
|
url 'https://www.cursemaven.com'
|
|
|
|
content {
|
|
|
|
includeGroup "curse.maven"
|
|
|
|
}
|
|
|
|
}
|
2021-10-15 01:20:56 +02:00
|
|
|
maven {
|
2021-11-20 18:54:22 +01:00
|
|
|
name 'tterrag maven'
|
|
|
|
url 'https://maven.tterrag.com/'
|
|
|
|
}
|
|
|
|
maven {
|
|
|
|
url 'https://maven.parchmentmc.org/'
|
2021-10-15 01:20:56 +02:00
|
|
|
}
|
2021-12-22 08:37:52 +01:00
|
|
|
maven {
|
|
|
|
name 'Modrinth'
|
|
|
|
url 'https://api.modrinth.com/maven'
|
|
|
|
}
|
|
|
|
maven {
|
|
|
|
url 'https://maven.vram.io'
|
|
|
|
}
|
2022-07-11 00:08:59 +02:00
|
|
|
maven {
|
|
|
|
name = "Modrinth"
|
|
|
|
url = "https://api.modrinth.com/maven"
|
|
|
|
content {
|
|
|
|
includeGroup "maven.modrinth"
|
|
|
|
}
|
|
|
|
}
|
2021-10-15 01:20:56 +02:00
|
|
|
}
|
2021-06-16 20:19:33 +02:00
|
|
|
|
2021-10-15 01:20:56 +02:00
|
|
|
dependencies {
|
|
|
|
// To change the versions see the gradle.properties file
|
2021-11-20 18:54:22 +01:00
|
|
|
minecraft "com.mojang:minecraft:${minecraft_version}"
|
2023-07-07 19:46:29 +02:00
|
|
|
if (Boolean.parseBoolean(project.use_parchment)) {
|
|
|
|
mappings loom.layered() {
|
|
|
|
officialMojangMappings()
|
|
|
|
parchment("org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}@zip")
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
mappings loom.officialMojangMappings()
|
2021-12-25 07:55:44 +01:00
|
|
|
}
|
2021-11-20 18:54:22 +01:00
|
|
|
modImplementation "net.fabricmc:fabric-loader:${loader_version}"
|
2019-07-11 09:03:08 +02:00
|
|
|
|
2021-10-15 01:20:56 +02:00
|
|
|
// Fabric API
|
2021-11-20 18:54:22 +01:00
|
|
|
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
|
2021-06-16 20:19:33 +02:00
|
|
|
|
2022-07-11 00:08:59 +02:00
|
|
|
// switch to implementation for debugging
|
2023-07-07 19:46:29 +02:00
|
|
|
modCompileOnly 'maven.modrinth:starlight:1.0.2+1.18.2'
|
2021-12-29 01:19:53 +01:00
|
|
|
|
2022-03-14 19:22:58 +01:00
|
|
|
modCompileOnly 'maven.modrinth:sodium:mc1.18.2-0.4.1'
|
2023-07-07 19:46:29 +02:00
|
|
|
modCompileOnly 'maven.modrinth:iris:1.6.4+1.18.2'
|
2022-01-07 00:25:52 +01:00
|
|
|
|
2021-10-15 01:20:56 +02:00
|
|
|
implementation 'com.google.code.findbugs:jsr305:3.0.2'
|
2022-07-17 06:00:15 +02:00
|
|
|
modCompileOnly 'maven.modrinth:indium:1.0.6+mc1.18.2'
|
|
|
|
modCompileOnly 'io.vram:frex-fabric-mc118:6.0.263'
|
2021-10-15 01:20:56 +02:00
|
|
|
}
|
2021-06-16 20:19:33 +02:00
|
|
|
|
2022-11-11 03:05:46 +01:00
|
|
|
loom {
|
|
|
|
runs {
|
|
|
|
client {
|
|
|
|
property('flw.loadRenderDoc', 'true')
|
|
|
|
}
|
|
|
|
}
|
2022-07-15 09:00:54 +02:00
|
|
|
}
|
|
|
|
|
2021-10-15 01:20:56 +02:00
|
|
|
processResources {
|
|
|
|
inputs.property 'version', project.version
|
2021-06-16 20:19:33 +02:00
|
|
|
|
2021-10-15 01:20:56 +02:00
|
|
|
filesMatching('fabric.mod.json') {
|
|
|
|
expand 'version': project.version
|
2019-07-11 09:03:08 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-15 01:20:56 +02:00
|
|
|
tasks.withType(JavaCompile).configureEach {
|
2021-12-13 02:24:43 +01:00
|
|
|
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
|
|
|
|
it.options.release = 17
|
2022-07-15 09:00:54 +02:00
|
|
|
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
|
2020-04-13 08:58:57 +02:00
|
|
|
}
|
|
|
|
|
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')
|
2019-07-11 09:03:08 +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"),
|
|
|
|
'MixinConfigs' : 'flywheel.mixins.json'
|
2019-07-11 09:03:08 +02:00
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-15 09:00:54 +02:00
|
|
|
java {
|
|
|
|
withSourcesJar()
|
|
|
|
withJavadocJar()
|
2021-07-28 02:31:58 +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
|
|
|
addLicense(jar)
|
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
|
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
|
|
|
}
|
|
|
|
}
|