Flywheel/build.gradle

179 lines
4.9 KiB
Groovy
Raw Normal View History

buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
jcenter()
mavenCentral()
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
}
dependencies {
2021-09-15 08:33:12 +02:00
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
2021-01-13 06:58:40 +01:00
classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT'
}
}
plugins {
id 'com.matthewprenger.cursegradle' version '1.4.0'
}
2021-06-16 20:19:33 +02:00
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
2021-06-21 22:56:27 +02:00
apply plugin: 'maven-publish'
2021-06-16 20:19:33 +02:00
apply plugin: 'org.spongepowered.mixin'
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equalsIgnoreCase('false');
2021-06-19 08:52:13 +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'
java.toolchain.languageVersion = JavaLanguageVersion.of(16)
minecraft {
2021-07-15 20:36:24 +02:00
mappings channel: 'official', version: "${minecraft_version}"
2021-06-16 20:19:33 +02:00
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
2021-04-10 01:23:49 +02:00
runs {
2021-06-16 20:19:33 +02:00
client {
workingDirectory project.file('run')
2021-06-16 20:19:33 +02:00
property 'forge.logging.markers', ''
property 'forge.logging.console.level', 'debug'
property 'fml.earlyprogresswindow', 'false'
property 'mixin.debug.export', 'true'
2021-06-16 20:19:33 +02:00
arg "-mixin.config=flywheel.mixins.json"
mods {
2021-06-16 20:19:33 +02:00
flywheel {
source sourceSets.main
}
}
}
server {
2021-06-16 20:19:33 +02:00
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
arg "-mixin.config=flywheel.mixins.json"
mods {
2021-06-16 20:19:33 +02:00
flywheel {
source sourceSets.main
}
}
}
data {
workingDirectory project.file('run')
2021-06-16 20:19:33 +02:00
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
2021-06-16 20:19:33 +02:00
// 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 {
2021-06-16 20:19:33 +02:00
flywheel {
source sourceSets.main
}
}
}
}
}
2021-06-16 20:19:33 +02:00
mixin {
add sourceSets.main, "flywheel.refmap.json"
}
repositories {
maven {
name "tterrag maven"
url "https://maven.tterrag.com/"
}
}
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
2021-04-10 01:23:49 +02:00
//implementation "org.joml:joml:1.10.1"
annotationProcessor 'org.spongepowered:mixin:0.8.4:processor'
}
2021-06-16 20:19:33 +02:00
// Example for how to get properties into the manifest for reading by the runtime..
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")
])
}
}
2021-06-16 20:19:33 +02:00
jar.finalizedBy('reobfJar')
2021-06-19 08:52:13 +02:00
javadoc {
source = [sourceSets.main.allJava]
// prevent java 8's strict doclint for javadocs from failing builds
options.addStringOption('Xdoclint:none', '-quiet')
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
archiveBaseName.set(project.archivesBaseName)
archiveVersion.set("${project.version}")
archiveClassifier.set('sources')
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
archiveClassifier.set('javadoc')
}
artifacts {
archives jar, sourcesJar, javadocJar
}
2021-06-21 22:56:27 +02:00
publishing {
tasks.publish.dependsOn 'build'
publications {
mavenJava(MavenPublication) {
artifact jar
artifact sourcesJar
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
mainArtifact jar
addGameVersion '1.17.1'
2021-06-19 08:52:13 +02:00
}
}