From 9ae4065c1c99a1e3d73cea401fc9e6bcec68bb68 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Fri, 26 Apr 2024 17:04:00 -0700 Subject: [PATCH] Pretty groovy man - Upgrade platform script plugin to pre-compiled groovy plugin - It was getting really difficult to manage all the logic/plugins/types from the basic script, and implementing a real plugin gives us much better type safety and IDE access to upstream plugins - Separate api/lib/backend/impl in platform projects - Add platform module output to main runtime classpath so the fabric loader recognizes our additional modules --- buildSrc/build.gradle | 28 +++ .../groovy/GeneratePackageInfosTask.groovy | 2 - .../com/jozufozu/gradle/PlatformPlugin.groovy | 173 ++++++++++++++++++ buildSrc/src/main/groovy/flywheel.java.gradle | 11 +- .../src/main/groovy/flywheel.platform.gradle | 89 --------- .../main/groovy/flywheel.subproject.gradle | 10 +- common/build.gradle | 6 + fabric/build.gradle | 46 ++++- .../api/event/BeginFrameCallback.java | 0 .../EndClientResourceReloadCallback.java | 0 .../event/ReloadLevelRendererCallback.java | 0 .../api/event/RenderStageCallback.java | 0 .../flywheel/backend/FlwBackendXplatImpl.java | 0 .../backend/compile/FlwProgramsReloader.java | 0 .../model/baked/PartialModelEventHandler.java | 0 forge/build.gradle | 42 ++++- .../flywheel/api/event/BeginFrameEvent.java | 0 .../event/EndClientResourceReloadEvent.java | 0 .../api/event/ReloadLevelRendererEvent.java | 0 .../flywheel/api/event/RenderStageEvent.java | 0 .../flywheel/backend/FlwBackendXplatImpl.java | 0 .../backend/compile/FlwProgramsReloader.java | 0 .../lib/model/baked/BakedModelBufferer.java | 0 .../model/baked/ForgeBakedModelBuilder.java | 0 .../model/baked/ForgeBlockModelBuilder.java | 0 .../lib/model/baked/ForgeMeshEmitter.java | 0 .../baked/ForgeMultiBlockModelBuilder.java | 0 .../model/baked/PartialModelEventHandler.java | 0 28 files changed, 281 insertions(+), 126 deletions(-) create mode 100644 buildSrc/src/main/groovy/com/jozufozu/gradle/PlatformPlugin.groovy delete mode 100644 buildSrc/src/main/groovy/flywheel.platform.gradle rename fabric/src/{main => api}/java/com/jozufozu/flywheel/api/event/BeginFrameCallback.java (100%) rename fabric/src/{main => api}/java/com/jozufozu/flywheel/api/event/EndClientResourceReloadCallback.java (100%) rename fabric/src/{main => api}/java/com/jozufozu/flywheel/api/event/ReloadLevelRendererCallback.java (100%) rename fabric/src/{main => api}/java/com/jozufozu/flywheel/api/event/RenderStageCallback.java (100%) rename fabric/src/{main => backend}/java/com/jozufozu/flywheel/backend/FlwBackendXplatImpl.java (100%) rename fabric/src/{main => backend}/java/com/jozufozu/flywheel/backend/compile/FlwProgramsReloader.java (100%) rename fabric/src/{main => lib}/java/com/jozufozu/flywheel/lib/model/baked/PartialModelEventHandler.java (100%) rename forge/src/{main => api}/java/com/jozufozu/flywheel/api/event/BeginFrameEvent.java (100%) rename forge/src/{main => api}/java/com/jozufozu/flywheel/api/event/EndClientResourceReloadEvent.java (100%) rename forge/src/{main => api}/java/com/jozufozu/flywheel/api/event/ReloadLevelRendererEvent.java (100%) rename forge/src/{main => api}/java/com/jozufozu/flywheel/api/event/RenderStageEvent.java (100%) rename forge/src/{main => backend}/java/com/jozufozu/flywheel/backend/FlwBackendXplatImpl.java (100%) rename forge/src/{main => backend}/java/com/jozufozu/flywheel/backend/compile/FlwProgramsReloader.java (100%) rename forge/src/{main => lib}/java/com/jozufozu/flywheel/lib/model/baked/BakedModelBufferer.java (100%) rename forge/src/{main => lib}/java/com/jozufozu/flywheel/lib/model/baked/ForgeBakedModelBuilder.java (100%) rename forge/src/{main => lib}/java/com/jozufozu/flywheel/lib/model/baked/ForgeBlockModelBuilder.java (100%) rename forge/src/{main => lib}/java/com/jozufozu/flywheel/lib/model/baked/ForgeMeshEmitter.java (100%) rename forge/src/{main => lib}/java/com/jozufozu/flywheel/lib/model/baked/ForgeMultiBlockModelBuilder.java (100%) rename forge/src/{main => lib}/java/com/jozufozu/flywheel/lib/model/baked/PartialModelEventHandler.java (100%) diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 678405245..40d8a06a0 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -1,3 +1,31 @@ plugins { id 'groovy-gradle-plugin' } + +repositories { + gradlePluginPortal() + mavenCentral() + maven { + name = 'MinecraftForge' + url = 'https://maven.minecraftforge.net/' + } + maven { + name = 'Architectury' + url = 'https://maven.architectury.dev/' + } + maven { url = 'https://repo.spongepowered.org/repository/maven-public' } + maven { url = 'https://maven.parchmentmc.org' } +} + +gradlePlugin { + plugins { + simplePlugin { + id = 'flywheel.platform' + implementationClass = 'com.jozufozu.gradle.PlatformPlugin' + } + } +} + +dependencies { + implementation 'dev.architectury.loom:dev.architectury.loom.gradle.plugin:1.6-SNAPSHOT' +} diff --git a/buildSrc/src/main/groovy/GeneratePackageInfosTask.groovy b/buildSrc/src/main/groovy/GeneratePackageInfosTask.groovy index 36533a10a..dbb693f74 100644 --- a/buildSrc/src/main/groovy/GeneratePackageInfosTask.groovy +++ b/buildSrc/src/main/groovy/GeneratePackageInfosTask.groovy @@ -1,5 +1,3 @@ - - import org.gradle.api.DefaultTask import org.gradle.api.file.DirectoryProperty import org.gradle.api.tasks.InputDirectory diff --git a/buildSrc/src/main/groovy/com/jozufozu/gradle/PlatformPlugin.groovy b/buildSrc/src/main/groovy/com/jozufozu/gradle/PlatformPlugin.groovy new file mode 100644 index 000000000..b8ed05ead --- /dev/null +++ b/buildSrc/src/main/groovy/com/jozufozu/gradle/PlatformPlugin.groovy @@ -0,0 +1,173 @@ +package com.jozufozu.gradle + +import groovy.transform.CompileStatic +import net.fabricmc.loom.api.LoomGradleExtensionAPI +import net.fabricmc.loom.task.RemapJarTask +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.api.Task +import org.gradle.api.artifacts.Configuration +import org.gradle.api.file.DuplicatesStrategy +import org.gradle.api.file.FileCollection +import org.gradle.api.file.FileCopyDetails +import org.gradle.api.publish.PublishingExtension +import org.gradle.api.tasks.AbstractCopyTask +import org.gradle.api.tasks.SourceSet +import org.gradle.api.tasks.SourceSetContainer +import org.gradle.api.tasks.SourceTask +import org.gradle.api.tasks.bundling.Jar +import org.gradle.api.tasks.compile.JavaCompile +import org.gradle.api.tasks.javadoc.Javadoc +import org.gradle.language.jvm.tasks.ProcessResources + +// Couldn't get imports for loom to work in the simple .gradle file, so upgraded this to a real plugin. +@CompileStatic +class PlatformPlugin implements Plugin { + @Override + void apply(Project project) { + def commonProject = project.project(':common') + def commonSourceSets = commonProject.getExtensions().getByType(SourceSetContainer) + + def sourceSets = project.getExtensions().getByType(SourceSetContainer) + def loom = project.getExtensions().getByType(LoomGradleExtensionAPI) + def publishing = project.getExtensions().getByType(PublishingExtension) + + // Loom only populates mc stuff to the main source set, + // so grab that here and use it for the others. + // Note that the `+` operator does NOT perform a deep copy + // of a FileCollection, so this object is shared between + // the source sets and we should avoid mutating it. + SourceSet platformImpl = sourceSets.named('main').get() + FileCollection mcCompileClassPath = platformImpl.compileClasspath + + SourceSet platformApi = sourceSets.create('api') + platformApi.compileClasspath = mcCompileClassPath + + SourceSet platformLib = sourceSets.create('lib') + platformLib.compileClasspath = mcCompileClassPath + platformApi.output + + SourceSet platformBackend = sourceSets.create('backend') + platformBackend.compileClasspath = mcCompileClassPath + platformApi.output + platformLib.output + + // Assign here rather than concatenate to avoid modifying the mcCompileClassPath FileCollection + platformImpl.compileClasspath = mcCompileClassPath + platformApi.output + platformLib.output + platformBackend.output + // This isn't necessary for forge but fabric needs to recognize each classpath entry from ModSettings. + platformImpl.runtimeClasspath += platformApi.output + platformLib.output + platformBackend.output + + // This is needed for both platforms. + def mainMod = loom.mods.maybeCreate('main') + mainMod.sourceSet(platformApi) + mainMod.sourceSet(platformLib) + mainMod.sourceSet(platformBackend) + mainMod.sourceSet(platformImpl) + + def forApi = newConfiguration(project, 'forApi') + def forLib = newConfiguration(project, 'forLib') + def forBackend = newConfiguration(project, 'forBackend') + def forImpl = newConfiguration(project, 'forImpl') + + extendsFrom(project, platformApi.compileOnlyConfigurationName, forApi) + extendsFrom(project, platformLib.compileOnlyConfigurationName, forApi, forLib) + extendsFrom(project, platformBackend.compileOnlyConfigurationName, forApi, forLib, forBackend) + extendsFrom(project, platformImpl.compileOnlyConfigurationName, forApi, forLib, forBackend, forImpl) + + SourceSet commonApi = commonSourceSets.named('api').get() + SourceSet commonLib = commonSourceSets.named('lib').get() + SourceSet commonBackend = commonSourceSets.named('backend').get() + SourceSet commonImpl = commonSourceSets.named('main').get() + + def commonSources = [commonApi, commonLib, commonBackend, commonImpl] + + // Directly compile the platform sources with the common sources + includeFromCommon(project, platformApi, commonApi) + includeFromCommon(project, platformLib, commonLib) + includeFromCommon(project, platformBackend, commonBackend) + includeFromCommon(project, platformImpl, commonImpl) + + def tasks = project.tasks + + tasks.withType(JavaCompile).configureEach { JavaCompile compileJava -> + excludeDuplicatePackageInfos(compileJava) + } + + def apiJar = tasks.register('apiJar', Jar) { Jar jar -> + jar.archiveClassifier.set('api-dev') + jar.from platformApi.output, platformLib.output + + jar.destinationDirectory.set(project.layout.buildDirectory.dir('devlibs')) + + excludeDuplicatePackageInfos(jar) + } + + tasks.named('jar', Jar).configure { Jar jar -> + jar.archiveClassifier.set('dev') + jar.from platformApi.output, platformLib.output, platformBackend.output + + excludeDuplicatePackageInfos(jar) + } + + tasks.named('javadoc', Javadoc).configure { Javadoc javadoc -> + commonSources.forEach { javadoc.source it.allJava } + + javadoc.source platformApi.allJava, platformLib.allJava, platformBackend.allJava + + excludeDuplicatePackageInfos(javadoc) + } + + tasks.named('sourcesJar', Jar).configure { Jar jar -> + commonSources.forEach { jar.from it.allJava } + + jar.from platformApi.allJava, platformLib.allJava, platformBackend.allJava + + excludeDuplicatePackageInfos(jar) + } + + def remapApiJar = tasks.register('remapApiJar', RemapJarTask) { RemapJarTask remapJar -> + remapJar.dependsOn(apiJar) + remapJar.inputFile.set(apiJar.flatMap { it.archiveFile }) + remapJar.archiveClassifier.set('api') + } + + def remapJar = tasks.named('remapJar', RemapJarTask) + + tasks.named('build').configure { Task build -> + build.dependsOn(remapApiJar) + } + } + + // We have duplicate packages between the common and platform dependent subprojects. + // In theory the package-info.java files should be identical, so just take the first one we find. + static void excludeDuplicatePackageInfos(AbstractCopyTask copyTask) { + copyTask.filesMatching('**/package-info.java') { FileCopyDetails details -> + details.duplicatesStrategy = DuplicatesStrategy.EXCLUDE + } + } + + // The compile/javadoc tasks have a different base type that isn't so smart about exclusion handling. + static void excludeDuplicatePackageInfos(SourceTask sourceTask) { + sourceTask.exclude('**/package-info.java') + } + + static Configuration newConfiguration(Project project, String name) { + return project.configurations.create(name) { Configuration it -> + it.canBeConsumed = true + it.canBeResolved = false + } + } + + static void extendsFrom(Project project, String name, Configuration... configurations) { + project.configurations.named(name).configure { + it.extendsFrom(configurations) + } + } + + static void includeFromCommon(Project project, SourceSet sourceSet, SourceSet commonSourceSet) { + project.tasks.named(sourceSet.compileJavaTaskName, JavaCompile).configure { JavaCompile compileJava -> + compileJava.source commonSourceSet.allJava + } + + project.tasks.named(sourceSet.processResourcesTaskName, ProcessResources).configure { ProcessResources processResources -> + processResources.from commonSourceSet.resources + } + } +} diff --git a/buildSrc/src/main/groovy/flywheel.java.gradle b/buildSrc/src/main/groovy/flywheel.java.gradle index 0aa594e6e..9124d5377 100644 --- a/buildSrc/src/main/groovy/flywheel.java.gradle +++ b/buildSrc/src/main/groovy/flywheel.java.gradle @@ -1,7 +1,3 @@ -plugins { - id 'java' -} - boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equalsIgnoreCase('false') String buildNumber = System.getenv('BUILD_NUMBER') @@ -40,12 +36,7 @@ tasks.withType(JavaCompile).configureEach { JavaCompile javaCompile -> javaCompile.options.compilerArgs = ['-Xdiags:verbose'] } -tasks.named('jar', Jar).configure { Jar jar -> - archiveClassifier = '' - addLicense(jar) -} - -tasks.named('sourcesJar', Jar).configure { Jar jar -> +tasks.withType(Jar).configureEach { Jar jar -> addLicense(jar) } diff --git a/buildSrc/src/main/groovy/flywheel.platform.gradle b/buildSrc/src/main/groovy/flywheel.platform.gradle deleted file mode 100644 index 84a73a2a1..000000000 --- a/buildSrc/src/main/groovy/flywheel.platform.gradle +++ /dev/null @@ -1,89 +0,0 @@ -plugins { - id 'flywheel.subproject' -} - -evaluationDependsOn(':common') - -loom { - runs { - client { - ideConfigGenerated true - - // Turn on our own debug flags - property 'flw.dumpShaderSource', 'true' - property 'flw.debugMemorySafety', 'true' - - // Turn on mixin debug flags - property 'mixin.debug.export', 'true' - property 'mixin.debug.verbose', 'true' - - // 720p baby! - programArgs '--width', '1280', '--height', '720' - } - - // We're a client mod, but we need to make sure we correctly render when playing on a server. - server { - ideConfigGenerated true - programArgs '--nogui' - } - } -} - -dependencies { - compileOnly project(path: ':common', configuration: 'commonApi') - compileOnly project(path: ':common', configuration: 'commonLib') - compileOnly project(path: ':common', configuration: 'commonBackend') - compileOnly project(path: ':common', configuration: 'commonImpl') -} - -SourceSet commonApiSource = project(':common').sourceSets.api -SourceSet commonLibSource = project(':common').sourceSets.lib -SourceSet commonBackendSource = project(':common').sourceSets.backend -SourceSet commonMainSource = project(':common').sourceSets.main - -def commonSources = [commonApiSource, commonLibSource, commonBackendSource, commonMainSource] - -tasks.named('processResources', ProcessResources).configure { ProcessResources processResources -> - // No resources in API - processResources.from commonLibSource.resources - processResources.from commonBackendSource.resources - processResources.from commonMainSource.resources -} - -tasks.named('compileJava', JavaCompile).configure { JavaCompile compileJava -> - // TODO: Can we avoid this duplication? Would be nice to repackage the 4 common jars without having to re compile - commonSources.forEach { compileJava.source it.allJava } - - excludeDuplicatePackageInfos(compileJava) -} - -tasks.named('javadoc', Javadoc).configure { Javadoc javadoc -> - commonSources.forEach { javadoc.source it.allJava } - - excludeDuplicatePackageInfos(javadoc) -} - -tasks.named('jar', Jar).configure { Jar jar -> - excludeDuplicatePackageInfos(jar) -} - -tasks.named('sourcesJar', Jar).configure { Jar jar -> - commonSources.forEach { jar.from it.allJava } - - excludeDuplicatePackageInfos(jar) -} - -// We have duplicate packages between the common and platform dependent subprojects. -// In theory the package-info.java files should be identical, so just take the first one we find. -static void excludeDuplicatePackageInfos(AbstractCopyTask copyTask) { - copyTask.filesMatching('**/package-info.java') { - duplicatesStrategy = DuplicatesStrategy.EXCLUDE - } -} - -// The compile/javadoc tasks have a different base type that isn't so smart about exclusion handling. -static void excludeDuplicatePackageInfos(SourceTask sourceTask) { - // FIXME: actually scan the files and exclude the duplicates - // may be tough because the files have absolute paths - sourceTask.exclude('**/package-info.java') -} diff --git a/buildSrc/src/main/groovy/flywheel.subproject.gradle b/buildSrc/src/main/groovy/flywheel.subproject.gradle index e7ee6cd41..d206a8758 100644 --- a/buildSrc/src/main/groovy/flywheel.subproject.gradle +++ b/buildSrc/src/main/groovy/flywheel.subproject.gradle @@ -1,11 +1,3 @@ -plugins { - id 'idea' - id 'flywheel.java' - id 'maven-publish' - id 'dev.architectury.loom' - id 'flywheel.package-infos' -} - loom { silentMojangMappingsLicense() @@ -49,7 +41,7 @@ dependencies { api 'com.google.code.findbugs:jsr305:3.0.2' } -processResources { +tasks.withType(ProcessResources).configureEach { var replaceProperties = [ mod_id : mod_id, mod_name : mod_name, diff --git a/common/build.gradle b/common/build.gradle index 51970de5b..20a518168 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -1,4 +1,10 @@ plugins { + id 'idea' + id 'java' + id 'maven-publish' + id 'dev.architectury.loom' + id 'flywheel.java' + id 'flywheel.package-infos' id 'flywheel.subproject' } diff --git a/fabric/build.gradle b/fabric/build.gradle index c9262ed2c..bcb20f5e5 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -1,20 +1,50 @@ plugins { + id 'idea' + id 'java' + id 'maven-publish' + id 'dev.architectury.loom' + id 'flywheel.java' + id 'flywheel.package-infos' + id 'flywheel.subproject' id 'flywheel.platform' } +evaluationDependsOn(':common') + +loom { + runs { + client { + ideConfigGenerated true + + // Turn on our own debug flags + property 'flw.dumpShaderSource', 'true' + property 'flw.debugMemorySafety', 'true' + + // Turn on mixin debug flags + property 'mixin.debug.export', 'true' + property 'mixin.debug.verbose', 'true' + + // 720p baby! + programArgs '--width', '1280', '--height', '720' + } + + // We're a client mod, but we need to make sure we correctly render when playing on a server. + server { + ideConfigGenerated true + programArgs '--nogui' + } + } +} + dependencies { modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}" modApi "net.fabricmc.fabric-api:fabric-api:${fabric_api_version}" modCompileOnly "maven.modrinth:sodium:${sodium_version}" modCompileOnly "maven.modrinth:iris:${iris_version}" -} -publishing { - publications { - register('mavenJava', MavenPublication) { - from(components['java']) - artifactId = "flywheel-${project.name}-${artifact_minecraft_version}" - } - } + forApi project(path: ':common', configuration: 'commonApi') + forLib project(path: ':common', configuration: 'commonLib') + forBackend project(path: ':common', configuration: 'commonBackend') + forImpl project(path: ':common', configuration: 'commonImpl') } diff --git a/fabric/src/main/java/com/jozufozu/flywheel/api/event/BeginFrameCallback.java b/fabric/src/api/java/com/jozufozu/flywheel/api/event/BeginFrameCallback.java similarity index 100% rename from fabric/src/main/java/com/jozufozu/flywheel/api/event/BeginFrameCallback.java rename to fabric/src/api/java/com/jozufozu/flywheel/api/event/BeginFrameCallback.java diff --git a/fabric/src/main/java/com/jozufozu/flywheel/api/event/EndClientResourceReloadCallback.java b/fabric/src/api/java/com/jozufozu/flywheel/api/event/EndClientResourceReloadCallback.java similarity index 100% rename from fabric/src/main/java/com/jozufozu/flywheel/api/event/EndClientResourceReloadCallback.java rename to fabric/src/api/java/com/jozufozu/flywheel/api/event/EndClientResourceReloadCallback.java diff --git a/fabric/src/main/java/com/jozufozu/flywheel/api/event/ReloadLevelRendererCallback.java b/fabric/src/api/java/com/jozufozu/flywheel/api/event/ReloadLevelRendererCallback.java similarity index 100% rename from fabric/src/main/java/com/jozufozu/flywheel/api/event/ReloadLevelRendererCallback.java rename to fabric/src/api/java/com/jozufozu/flywheel/api/event/ReloadLevelRendererCallback.java diff --git a/fabric/src/main/java/com/jozufozu/flywheel/api/event/RenderStageCallback.java b/fabric/src/api/java/com/jozufozu/flywheel/api/event/RenderStageCallback.java similarity index 100% rename from fabric/src/main/java/com/jozufozu/flywheel/api/event/RenderStageCallback.java rename to fabric/src/api/java/com/jozufozu/flywheel/api/event/RenderStageCallback.java diff --git a/fabric/src/main/java/com/jozufozu/flywheel/backend/FlwBackendXplatImpl.java b/fabric/src/backend/java/com/jozufozu/flywheel/backend/FlwBackendXplatImpl.java similarity index 100% rename from fabric/src/main/java/com/jozufozu/flywheel/backend/FlwBackendXplatImpl.java rename to fabric/src/backend/java/com/jozufozu/flywheel/backend/FlwBackendXplatImpl.java diff --git a/fabric/src/main/java/com/jozufozu/flywheel/backend/compile/FlwProgramsReloader.java b/fabric/src/backend/java/com/jozufozu/flywheel/backend/compile/FlwProgramsReloader.java similarity index 100% rename from fabric/src/main/java/com/jozufozu/flywheel/backend/compile/FlwProgramsReloader.java rename to fabric/src/backend/java/com/jozufozu/flywheel/backend/compile/FlwProgramsReloader.java diff --git a/fabric/src/main/java/com/jozufozu/flywheel/lib/model/baked/PartialModelEventHandler.java b/fabric/src/lib/java/com/jozufozu/flywheel/lib/model/baked/PartialModelEventHandler.java similarity index 100% rename from fabric/src/main/java/com/jozufozu/flywheel/lib/model/baked/PartialModelEventHandler.java rename to fabric/src/lib/java/com/jozufozu/flywheel/lib/model/baked/PartialModelEventHandler.java diff --git a/forge/build.gradle b/forge/build.gradle index 79882c90c..2b7c0ce57 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -1,7 +1,16 @@ plugins { + id 'idea' + id 'java' + id 'maven-publish' + id 'dev.architectury.loom' + id 'flywheel.java' + id 'flywheel.package-infos' + id 'flywheel.subproject' id 'flywheel.platform' } +evaluationDependsOn(':common') + loom { forge { mixinConfig 'flywheel.backend.mixins.json' @@ -14,6 +23,27 @@ loom { property 'forge.logging.markers', '' property 'forge.logging.console.level', 'debug' } + + client { + ideConfigGenerated true + + // Turn on our own debug flags + property 'flw.dumpShaderSource', 'true' + property 'flw.debugMemorySafety', 'true' + + // Turn on mixin debug flags + property 'mixin.debug.export', 'true' + property 'mixin.debug.verbose', 'true' + + // 720p baby! + programArgs '--width', '1280', '--height', '720' + } + + // We're a client mod, but we need to make sure we correctly render when playing on a server. + server { + ideConfigGenerated true + programArgs '--nogui' + } } } @@ -22,13 +52,9 @@ dependencies { modCompileOnly "maven.modrinth:embeddium:${embeddium_version}" modCompileOnly "maven.modrinth:oculus:${oculus_version}" -} -publishing { - publications { - register('mavenJava', MavenPublication) { - from(components['java']) - artifactId = "flywheel-${project.name}-${artifact_minecraft_version}" - } - } + forApi project(path: ':common', configuration: 'commonApi') + forLib project(path: ':common', configuration: 'commonLib') + forBackend project(path: ':common', configuration: 'commonBackend') + forImpl project(path: ':common', configuration: 'commonImpl') } diff --git a/forge/src/main/java/com/jozufozu/flywheel/api/event/BeginFrameEvent.java b/forge/src/api/java/com/jozufozu/flywheel/api/event/BeginFrameEvent.java similarity index 100% rename from forge/src/main/java/com/jozufozu/flywheel/api/event/BeginFrameEvent.java rename to forge/src/api/java/com/jozufozu/flywheel/api/event/BeginFrameEvent.java diff --git a/forge/src/main/java/com/jozufozu/flywheel/api/event/EndClientResourceReloadEvent.java b/forge/src/api/java/com/jozufozu/flywheel/api/event/EndClientResourceReloadEvent.java similarity index 100% rename from forge/src/main/java/com/jozufozu/flywheel/api/event/EndClientResourceReloadEvent.java rename to forge/src/api/java/com/jozufozu/flywheel/api/event/EndClientResourceReloadEvent.java diff --git a/forge/src/main/java/com/jozufozu/flywheel/api/event/ReloadLevelRendererEvent.java b/forge/src/api/java/com/jozufozu/flywheel/api/event/ReloadLevelRendererEvent.java similarity index 100% rename from forge/src/main/java/com/jozufozu/flywheel/api/event/ReloadLevelRendererEvent.java rename to forge/src/api/java/com/jozufozu/flywheel/api/event/ReloadLevelRendererEvent.java diff --git a/forge/src/main/java/com/jozufozu/flywheel/api/event/RenderStageEvent.java b/forge/src/api/java/com/jozufozu/flywheel/api/event/RenderStageEvent.java similarity index 100% rename from forge/src/main/java/com/jozufozu/flywheel/api/event/RenderStageEvent.java rename to forge/src/api/java/com/jozufozu/flywheel/api/event/RenderStageEvent.java diff --git a/forge/src/main/java/com/jozufozu/flywheel/backend/FlwBackendXplatImpl.java b/forge/src/backend/java/com/jozufozu/flywheel/backend/FlwBackendXplatImpl.java similarity index 100% rename from forge/src/main/java/com/jozufozu/flywheel/backend/FlwBackendXplatImpl.java rename to forge/src/backend/java/com/jozufozu/flywheel/backend/FlwBackendXplatImpl.java diff --git a/forge/src/main/java/com/jozufozu/flywheel/backend/compile/FlwProgramsReloader.java b/forge/src/backend/java/com/jozufozu/flywheel/backend/compile/FlwProgramsReloader.java similarity index 100% rename from forge/src/main/java/com/jozufozu/flywheel/backend/compile/FlwProgramsReloader.java rename to forge/src/backend/java/com/jozufozu/flywheel/backend/compile/FlwProgramsReloader.java diff --git a/forge/src/main/java/com/jozufozu/flywheel/lib/model/baked/BakedModelBufferer.java b/forge/src/lib/java/com/jozufozu/flywheel/lib/model/baked/BakedModelBufferer.java similarity index 100% rename from forge/src/main/java/com/jozufozu/flywheel/lib/model/baked/BakedModelBufferer.java rename to forge/src/lib/java/com/jozufozu/flywheel/lib/model/baked/BakedModelBufferer.java diff --git a/forge/src/main/java/com/jozufozu/flywheel/lib/model/baked/ForgeBakedModelBuilder.java b/forge/src/lib/java/com/jozufozu/flywheel/lib/model/baked/ForgeBakedModelBuilder.java similarity index 100% rename from forge/src/main/java/com/jozufozu/flywheel/lib/model/baked/ForgeBakedModelBuilder.java rename to forge/src/lib/java/com/jozufozu/flywheel/lib/model/baked/ForgeBakedModelBuilder.java diff --git a/forge/src/main/java/com/jozufozu/flywheel/lib/model/baked/ForgeBlockModelBuilder.java b/forge/src/lib/java/com/jozufozu/flywheel/lib/model/baked/ForgeBlockModelBuilder.java similarity index 100% rename from forge/src/main/java/com/jozufozu/flywheel/lib/model/baked/ForgeBlockModelBuilder.java rename to forge/src/lib/java/com/jozufozu/flywheel/lib/model/baked/ForgeBlockModelBuilder.java diff --git a/forge/src/main/java/com/jozufozu/flywheel/lib/model/baked/ForgeMeshEmitter.java b/forge/src/lib/java/com/jozufozu/flywheel/lib/model/baked/ForgeMeshEmitter.java similarity index 100% rename from forge/src/main/java/com/jozufozu/flywheel/lib/model/baked/ForgeMeshEmitter.java rename to forge/src/lib/java/com/jozufozu/flywheel/lib/model/baked/ForgeMeshEmitter.java diff --git a/forge/src/main/java/com/jozufozu/flywheel/lib/model/baked/ForgeMultiBlockModelBuilder.java b/forge/src/lib/java/com/jozufozu/flywheel/lib/model/baked/ForgeMultiBlockModelBuilder.java similarity index 100% rename from forge/src/main/java/com/jozufozu/flywheel/lib/model/baked/ForgeMultiBlockModelBuilder.java rename to forge/src/lib/java/com/jozufozu/flywheel/lib/model/baked/ForgeMultiBlockModelBuilder.java diff --git a/forge/src/main/java/com/jozufozu/flywheel/lib/model/baked/PartialModelEventHandler.java b/forge/src/lib/java/com/jozufozu/flywheel/lib/model/baked/PartialModelEventHandler.java similarity index 100% rename from forge/src/main/java/com/jozufozu/flywheel/lib/model/baked/PartialModelEventHandler.java rename to forge/src/lib/java/com/jozufozu/flywheel/lib/model/baked/PartialModelEventHandler.java