mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-13 07:46:07 +01:00
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:
parent
e152df6769
commit
ec685ebdc0
3 changed files with 32 additions and 63 deletions
38
build.gradle
38
build.gradle
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue