2020-04-13 08:58:57 +02:00
|
|
|
plugins {
|
2021-10-15 01:20:56 +02:00
|
|
|
id 'fabric-loom' version '0.10-SNAPSHOT'
|
|
|
|
id 'maven-publish'
|
2020-06-08 02:18:34 +02:00
|
|
|
id 'com.matthewprenger.cursegradle' version '1.4.0'
|
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
|
|
|
|
2021-06-21 01:20:18 +02:00
|
|
|
ext.buildnumber = 0
|
|
|
|
project.buildnumber = System.getenv('BUILD_NUMBER') != null ? System.getenv('BUILD_NUMBER') : "custom"
|
|
|
|
|
|
|
|
version = "${mc_update_version}-${mod_version}" + (dev ? ".${buildnumber}" : '')
|
2021-06-21 22:56:27 +02:00
|
|
|
group = 'com.jozufozu.flywheel'
|
2021-06-16 20:19:33 +02:00
|
|
|
archivesBaseName = 'flywheel'
|
2019-07-11 09:03:08 +02:00
|
|
|
|
2021-10-15 01:20:56 +02:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_16
|
|
|
|
targetCompatibility = JavaVersion.VERSION_16
|
|
|
|
|
2021-09-15 08:45:29 +02:00
|
|
|
java.toolchain.languageVersion = JavaLanguageVersion.of(16)
|
2019-07-11 09:03:08 +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 20:19:33 +02:00
|
|
|
|
2021-10-15 01:20:56 +02:00
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
name "tterrag maven"
|
|
|
|
url "https://maven.tterrag.com/"
|
|
|
|
}
|
|
|
|
}
|
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
|
|
|
|
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
|
|
|
mappings loom.officialMojangMappings()
|
|
|
|
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
2019-07-11 09:03:08 +02:00
|
|
|
|
2021-10-15 01:20:56 +02:00
|
|
|
// Fabric API
|
|
|
|
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
2021-06-16 20:19:33 +02:00
|
|
|
|
2021-10-15 01:20:56 +02:00
|
|
|
implementation 'com.google.code.findbugs:jsr305:3.0.2'
|
|
|
|
}
|
2021-06-16 20:19:33 +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 {
|
|
|
|
// ensure that the encoding is set to UTF-8, no matter what the system default is
|
|
|
|
// this fixes some edge cases with special characters not displaying correctly
|
|
|
|
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
|
|
|
// If Javadoc is generated, this must be specified in that task too.
|
|
|
|
it.options.encoding = 'UTF-8'
|
2020-07-18 20:07:22 +02:00
|
|
|
|
2021-10-15 01:20:56 +02:00
|
|
|
// Minecraft 1.17 (21w19a) upwards uses Java 16.
|
|
|
|
it.options.release = 16
|
2020-04-13 08:58:57 +02:00
|
|
|
}
|
|
|
|
|
2021-10-15 01:20:56 +02:00
|
|
|
java {
|
|
|
|
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
|
|
|
// if it is present.
|
|
|
|
// If you remove this line, sources will not be generated.
|
|
|
|
withSourcesJar()
|
|
|
|
}
|
2021-07-10 20:33:01 +02:00
|
|
|
|
2021-10-15 01:20:56 +02:00
|
|
|
jar {
|
|
|
|
from('LICENSE') {
|
|
|
|
rename { "${it}_${project.archivesBaseName}" }
|
|
|
|
}
|
2019-07-11 09:03:08 +02:00
|
|
|
}
|
|
|
|
|
2021-06-16 20:19:33 +02:00
|
|
|
// Example for how to get properties into the manifest for reading by the runtime..
|
2019-07-11 09:03:08 +02:00
|
|
|
jar {
|
|
|
|
manifest {
|
|
|
|
attributes([
|
2021-06-16 20:19:33 +02:00
|
|
|
"Specification-Title" : "flywheel",
|
|
|
|
//"Specification-Vendor": "flywheel authors",
|
|
|
|
"Specification-Version" : "1", // We are version 1 of ourselves
|
|
|
|
"Implementation-Title" : project.name,
|
|
|
|
"Implementation-Version" : project.version,
|
|
|
|
//"Implementation-Vendor": "flywheel authors",
|
|
|
|
"MixinConfigs" : "flywheel.mixins.json",
|
|
|
|
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
|
2019-07-11 09:03:08 +02:00
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-28 02:31:58 +02:00
|
|
|
javadoc {
|
|
|
|
source = [sourceSets.main.allJava]
|
|
|
|
// prevent java 8's strict doclint for javadocs from failing builds
|
|
|
|
options.addStringOption('Xdoclint:none', '-quiet')
|
|
|
|
}
|
|
|
|
|
|
|
|
task javadocJar(type: Jar, dependsOn: javadoc) {
|
|
|
|
from javadoc.destinationDir
|
|
|
|
archiveClassifier.set('javadoc')
|
|
|
|
}
|
|
|
|
|
2021-06-21 01:20:18 +02:00
|
|
|
artifacts {
|
2021-10-15 01:20:56 +02:00
|
|
|
archives remapJar, sourcesJar, javadocJar
|
2021-06-21 01:20:18 +02:00
|
|
|
}
|
|
|
|
|
2021-06-21 22:56:27 +02:00
|
|
|
publishing {
|
|
|
|
tasks.publish.dependsOn 'build'
|
|
|
|
publications {
|
|
|
|
mavenJava(MavenPublication) {
|
2021-10-15 01:20:56 +02:00
|
|
|
artifact remapJar
|
|
|
|
artifact(sourcesJar) {
|
|
|
|
builtBy remapSourcesJar
|
|
|
|
}
|
2021-07-28 02:31:58 +02:00
|
|
|
artifact javadocJar
|
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
|
2021-09-15 22:46:38 +02:00
|
|
|
addGameVersion '1.17.1'
|
2021-06-19 08:52:13 +02:00
|
|
|
}
|
|
|
|
}
|