Out for a run

- Move loom.runs into subprojects closure
- Move common code sharing into subprojects closure
- Apply java plugin
- Fix runs not being generated by moving generatePackageInfos to the
  bottom
This commit is contained in:
Jozufozu 2024-04-18 19:00:19 -07:00
parent e152df6769
commit ec685ebdc0
3 changed files with 32 additions and 63 deletions

View file

@ -7,23 +7,39 @@ plugins {
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equalsIgnoreCase('false');
ext.buildNumber = System.getenv('BUILD_NUMBER')
subprojects {
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equalsIgnoreCase('false');
ext.buildNumber = System.getenv('BUILD_NUMBER')
group = 'com.jozufozu.flywheel'
version = mod_version + (dev && buildNumber != null ? "-${buildNumber}" : '')
apply plugin: "java"
apply plugin: "maven-publish"
apply plugin: "dev.architectury.loom"
apply from: rootProject.file('gradle/package-infos.gradle')
loom {
silentMojangMappingsLicense()
}
ideaSyncTask.finalizedBy(generatePackageInfos)
if (it != project(':common')) {
loom {
runs {
client {
ideConfigGenerated true
property 'flw.dumpShaderSource', 'true'
property 'flw.debugMemorySafety', 'true'
programArgs '--width', '1280', '--height', '720'
}
server {
ideConfigGenerated true
programArgs '--nogui'
}
}
}
}
tasks {
// make builds reproducible
@ -101,6 +117,8 @@ subprojects {
}
tasks.withType(JavaCompile).configureEach {
source(project(':common').sourceSets.main.allSource)
options.encoding = 'UTF-8'
options.release = Integer.parseInt(java_version)
options.compilerArgs = ['-Xdiags:verbose']
@ -113,14 +131,22 @@ subprojects {
}
sourcesJar.configure {
from(project(':common').sourceSets.main.allSource)
addManifest(it)
addLicense(it)
}
javadoc.configure {
source(project(':common').sourceSets.main.allJava)
// prevent java 8's strict doclint for javadocs from failing builds
options.addStringOption('Xdoclint:none', '-quiet')
}
apply from: rootProject.file('gradle/package-infos.gradle')
ideaSyncTask.finalizedBy(generatePackageInfos)
}
void addLicense(jarTask) {

View file

@ -4,27 +4,6 @@ base {
archivesName = "flywheel-${project.name}-${artifact_minecraft_version}"
}
loom {
runs {
configureEach {
property 'forge.logging.markers', ''
property 'forge.logging.console.level', 'debug'
}
client {
ideConfigGenerated true
property 'flw.dumpShaderSource', 'true'
property 'flw.debugMemorySafety', 'true'
programArgs '--width', '1280', '--height', '720'
}
server {
ideConfigGenerated true
programArgs '--nogui'
}
}
}
dependencies {
modCompileOnly "net.fabricmc:fabric-loader:$fabric_loader_version"
modLocalRuntime "net.fabricmc:fabric-loader:$fabric_loader_version"
@ -43,18 +22,6 @@ dependencies {
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
}
tasks.withType(JavaCompile).configureEach {
source(project(':common').sourceSets.main.allSource)
}
sourcesJar.configure {
from(project(':common').sourceSets.main.allSource)
}
javadoc.configure {
source(project(':common').sourceSets.main.allJava)
}
publishing {
publications {
register('mavenJava', MavenPublication) {

View file

@ -16,18 +16,6 @@ loom {
property 'forge.logging.markers', ''
property 'forge.logging.console.level', 'debug'
}
client {
ideConfigGenerated true
property 'flw.dumpShaderSource', 'true'
property 'flw.debugMemorySafety', 'true'
programArgs '--width', '1280', '--height', '720'
}
server {
ideConfigGenerated true
programArgs '--nogui'
}
}
}
@ -42,18 +30,6 @@ dependencies {
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
}
tasks.withType(JavaCompile).configureEach {
source(project(':common').sourceSets.main.allSource)
}
sourcesJar.configure {
from(project(':common').sourceSets.main.allSource)
}
javadoc.configure {
source(project(':common').sourceSets.main.allJava)
}
publishing {
publications {
register('mavenJava', MavenPublication) {