2019-07-11 09:03:08 +02:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
2021-07-24 01:45:38 +02:00
|
|
|
maven { url = 'https://maven.minecraftforge.net' }
|
2019-07-11 09:03:08 +02:00
|
|
|
jcenter()
|
|
|
|
mavenCentral()
|
2021-11-08 22:19:48 +01:00
|
|
|
maven { url = 'https://repo.spongepowered.org/repository/maven-public' }
|
|
|
|
maven { url = 'https://maven.parchmentmc.org' }
|
2019-07-11 09:03:08 +02:00
|
|
|
}
|
|
|
|
dependencies {
|
2021-11-08 22:19:48 +01:00
|
|
|
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: "${forgegradle_version}", changing: true
|
|
|
|
classpath "org.spongepowered:mixingradle:${mixingradle_version}"
|
|
|
|
classpath "org.parchmentmc:librarian:${librarian_version}"
|
2019-07-11 09:03:08 +02:00
|
|
|
}
|
|
|
|
}
|
2020-04-13 08:58:57 +02:00
|
|
|
plugins {
|
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-16 20:19:33 +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 20:19:33 +02:00
|
|
|
apply plugin: 'org.spongepowered.mixin'
|
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
|
2021-11-18 23:59:39 +01:00
|
|
|
project.buildnumber = System.getenv('BUILD_NUMBER') != null ? System.getenv('BUILD_NUMBER') : 'custom'
|
2021-06-21 01:20:18 +02:00
|
|
|
|
|
|
|
version = "${mc_update_version}-${mod_version}" + (dev ? ".${buildnumber}" : '')
|
2021-06-21 22:56:27 +02:00
|
|
|
group = 'com.jozufozu.flywheel'
|
2021-11-25 03:43:05 +01:00
|
|
|
archivesBaseName = 'flywheel-forge'
|
2019-07-11 09:03:08 +02:00
|
|
|
|
2021-12-07 06:29:21 +01:00
|
|
|
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
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'))
|
2019-07-11 09:03:08 +02:00
|
|
|
minecraft {
|
2021-12-24 08:09:51 +01:00
|
|
|
mappings channel: 'parchment', version: "${parchment_version}-${minecraft_version}"
|
2021-06-16 20:19:33 +02:00
|
|
|
|
2021-04-10 01:23:49 +02:00
|
|
|
runs {
|
2021-06-16 20:19:33 +02:00
|
|
|
client {
|
2019-07-11 09:03:08 +02:00
|
|
|
workingDirectory project.file('run')
|
2021-06-16 20:19:33 +02:00
|
|
|
|
|
|
|
property 'forge.logging.markers', ''
|
|
|
|
property 'forge.logging.console.level', 'debug'
|
2021-09-17 05:03:45 +02:00
|
|
|
property 'mixin.debug.export', 'true'
|
2021-06-16 20:19:33 +02:00
|
|
|
|
2021-11-18 23:59:39 +01:00
|
|
|
arg '-mixin.config=flywheel.mixins.json'
|
2021-06-16 20:19:33 +02:00
|
|
|
|
2019-07-11 09:03:08 +02:00
|
|
|
mods {
|
2021-06-16 20:19:33 +02:00
|
|
|
flywheel {
|
2019-07-11 09:03:08 +02:00
|
|
|
source sourceSets.main
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-06 21:51:02 +02:00
|
|
|
server {
|
2021-06-16 20:19:33 +02:00
|
|
|
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'
|
2021-06-16 20:19:33 +02:00
|
|
|
|
2019-08-06 19:00:51 +02:00
|
|
|
mods {
|
2021-06-16 20:19:33 +02:00
|
|
|
flywheel {
|
2019-08-06 19:00:51 +02:00
|
|
|
source sourceSets.main
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-07-11 09:03:08 +02:00
|
|
|
|
2019-08-06 21:51:02 +02:00
|
|
|
data {
|
2019-08-06 19:00:51 +02:00
|
|
|
workingDirectory project.file('run')
|
2021-06-16 20:19:33 +02:00
|
|
|
|
|
|
|
property 'forge.logging.markers', 'REGISTRIES'
|
2019-07-11 09:03:08 +02:00
|
|
|
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/')
|
|
|
|
|
2019-07-11 09:03:08 +02:00
|
|
|
mods {
|
2021-06-16 20:19:33 +02:00
|
|
|
flywheel {
|
2019-07-11 09:03:08 +02:00
|
|
|
source sourceSets.main
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-16 20:19:33 +02:00
|
|
|
mixin {
|
2021-11-18 23:59:39 +01:00
|
|
|
add sourceSets.main, 'flywheel.refmap.json'
|
2020-07-18 20:07:22 +02:00
|
|
|
}
|
|
|
|
|
2019-09-16 12:27:28 +02:00
|
|
|
repositories {
|
2020-03-23 04:09:28 +01:00
|
|
|
maven {
|
2021-11-18 23:59:39 +01:00
|
|
|
name 'tterrag maven'
|
|
|
|
url 'https://maven.tterrag.com/'
|
2020-03-23 04:09:28 +01:00
|
|
|
}
|
2020-04-13 08:58:57 +02:00
|
|
|
}
|
|
|
|
|
2019-07-11 09:03:08 +02:00
|
|
|
dependencies {
|
2020-06-08 02:18:34 +02:00
|
|
|
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
2021-04-10 01:23:49 +02: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"
|
|
|
|
}
|
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-11-18 23:59:39 +01: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-06-16 20:19:33 +02:00
|
|
|
jar.finalizedBy('reobfJar')
|
2021-06-19 08:52:13 +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')
|
|
|
|
}
|
|
|
|
|
2021-06-20 01:52:23 +02:00
|
|
|
task sourcesJar(type: Jar) {
|
|
|
|
from sourceSets.main.allSource
|
|
|
|
archiveBaseName.set(project.archivesBaseName)
|
|
|
|
archiveVersion.set("${project.version}")
|
|
|
|
archiveClassifier.set('sources')
|
|
|
|
}
|
|
|
|
|
2021-07-28 02:31:58 +02:00
|
|
|
task javadocJar(type: Jar, dependsOn: javadoc) {
|
|
|
|
from javadoc.destinationDir
|
|
|
|
archiveClassifier.set('javadoc')
|
|
|
|
}
|
|
|
|
|
2021-06-21 01:20:18 +02:00
|
|
|
artifacts {
|
2021-07-28 02:31:58 +02:00
|
|
|
archives jar, 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) {
|
|
|
|
artifact jar
|
|
|
|
artifact sourcesJar
|
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-12-12 02:32:39 +01:00
|
|
|
addGameVersion '1.18.1'
|
2021-06-19 08:52:13 +02:00
|
|
|
}
|
|
|
|
}
|