From ea80d8a577d29068441fbbdd00e8642dc7b16a06 Mon Sep 17 00:00:00 2001 From: Griefed Date: Mon, 11 Dec 2023 19:06:38 +0100 Subject: [PATCH 1/4] build: Cleanup static directory --- .../kotlin/serverpackcreator.java-conventions.gradle.kts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/buildSrc/src/main/kotlin/serverpackcreator.java-conventions.gradle.kts b/buildSrc/src/main/kotlin/serverpackcreator.java-conventions.gradle.kts index bda2196c8..2541e8415 100644 --- a/buildSrc/src/main/kotlin/serverpackcreator.java-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/serverpackcreator.java-conventions.gradle.kts @@ -71,6 +71,13 @@ tasks.clean { doFirst { cleanup() } + doLast { + delete { + fileTree(projectDir.resolve("src/main/resources/static")) { + exclude(".gitkeep") + } + } + } } tasks.test { From b9e052a170a3100639021081b9fcaf9c4adced84 Mon Sep 17 00:00:00 2001 From: Griefed Date: Mon, 11 Dec 2023 21:04:46 +0100 Subject: [PATCH 2/4] build: I said include resources! --- build.gradle.kts | 8 ++++---- .../serverpackcreator.quasar-conventions.gradle.kts | 8 -------- serverpackcreator-web-frontend/build.gradle.kts | 11 ++++++++++- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 801aa59a2..0a21156ab 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -42,12 +42,12 @@ allprojects { } evaluationDependsOnChildren() -project("serverpackcreator-web").tasks.getByName("build").mustRunAfter( - project("serverpackcreator-web-frontend").tasks.getByName("build") +project("serverpackcreator-web").tasks.build.get().mustRunAfter( + project("serverpackcreator-web-frontend").tasks.build.get() ) -project("serverpackcreator-app").tasks.getByName("build").mustRunAfter( - project("serverpackcreator-web").tasks.getByName("build") +project("serverpackcreator-app").tasks.build.get().mustRunAfter( + project("serverpackcreator-web").tasks.build.get() ) nexusPublishing { diff --git a/buildSrc/src/main/kotlin/serverpackcreator.quasar-conventions.gradle.kts b/buildSrc/src/main/kotlin/serverpackcreator.quasar-conventions.gradle.kts index c51bec3c9..590b22009 100644 --- a/buildSrc/src/main/kotlin/serverpackcreator.quasar-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/serverpackcreator.quasar-conventions.gradle.kts @@ -38,11 +38,3 @@ tasks.getByName("installNode").finalizedBy( tasks.getByName("installQuasar") ) -tasks.register("copyDist", Copy::class) { - from(projectDir.resolve("dist/spa")) - into(rootDir.resolve("serverpackcreator-web/src/main/resources/static")) -} - -tasks.getByName("build").finalizedBy( - tasks.getByName("copyDist") -) \ No newline at end of file diff --git a/serverpackcreator-web-frontend/build.gradle.kts b/serverpackcreator-web-frontend/build.gradle.kts index 57ab3caf3..36290e471 100644 --- a/serverpackcreator-web-frontend/build.gradle.kts +++ b/serverpackcreator-web-frontend/build.gradle.kts @@ -1,3 +1,12 @@ plugins { id("serverpackcreator.quasar-conventions") -} \ No newline at end of file +} + +tasks.register("copyDist", Copy::class) { + from(projectDir.resolve("dist/spa")) + into(rootDir.resolve("serverpackcreator-web/src/main/resources/static")) +} + +tasks.build.get().finalizedBy( + tasks.getByName("copyDist") +) \ No newline at end of file From fd0c255a2511782a33420b7cdaafabc1fdbc3507 Mon Sep 17 00:00:00 2001 From: Griefed Date: Tue, 12 Dec 2023 18:16:30 +0100 Subject: [PATCH 3/4] build: Target web-resources folder directly --- serverpackcreator-web-frontend/build.gradle.kts | 3 ++- serverpackcreator-web-frontend/quasar.conf.js | 1 + serverpackcreator-web/src/main/resources/static/.gitkeep | 0 3 files changed, 3 insertions(+), 1 deletion(-) delete mode 100644 serverpackcreator-web/src/main/resources/static/.gitkeep diff --git a/serverpackcreator-web-frontend/build.gradle.kts b/serverpackcreator-web-frontend/build.gradle.kts index 36290e471..b9fbc5cd8 100644 --- a/serverpackcreator-web-frontend/build.gradle.kts +++ b/serverpackcreator-web-frontend/build.gradle.kts @@ -2,6 +2,7 @@ plugins { id("serverpackcreator.quasar-conventions") } +/* tasks.register("copyDist", Copy::class) { from(projectDir.resolve("dist/spa")) into(rootDir.resolve("serverpackcreator-web/src/main/resources/static")) @@ -9,4 +10,4 @@ tasks.register("copyDist", Copy::class) { tasks.build.get().finalizedBy( tasks.getByName("copyDist") -) \ No newline at end of file +)*/ diff --git a/serverpackcreator-web-frontend/quasar.conf.js b/serverpackcreator-web-frontend/quasar.conf.js index c6b13484b..991d7cb11 100644 --- a/serverpackcreator-web-frontend/quasar.conf.js +++ b/serverpackcreator-web-frontend/quasar.conf.js @@ -83,6 +83,7 @@ module.exports = function (ctx) { scopeHoisting: true, vueRouterMode: 'hash', // available values: 'hash', 'history' showProgress: true, + distDir: "../serverpackcreator-web/src/main/resources/static", gzip: false, analyze: false, publicPath: '', diff --git a/serverpackcreator-web/src/main/resources/static/.gitkeep b/serverpackcreator-web/src/main/resources/static/.gitkeep deleted file mode 100644 index e69de29bb..000000000 From be7f0df6953b228a818896ed8e6dd5f5cb7ce98b Mon Sep 17 00:00:00 2001 From: Griefed Date: Tue, 12 Dec 2023 19:05:24 +0100 Subject: [PATCH 4/4] fix: Only consider migrations on releases --- .../serverpackcreator/updater/MigrationManager.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/serverpackcreator-updater/src/main/kotlin/de/griefed/serverpackcreator/updater/MigrationManager.kt b/serverpackcreator-updater/src/main/kotlin/de/griefed/serverpackcreator/updater/MigrationManager.kt index 8f742096c..2add7a950 100644 --- a/serverpackcreator-updater/src/main/kotlin/de/griefed/serverpackcreator/updater/MigrationManager.kt +++ b/serverpackcreator-updater/src/main/kotlin/de/griefed/serverpackcreator/updater/MigrationManager.kt @@ -71,6 +71,7 @@ class MigrationManager( private val previous: String = apiProperties.oldVersion() private val current: String = apiProperties.apiVersion private val alphaBetaDev = ".*(alpha|beta|dev).*".toRegex() + private val release = "[0-9]+.[0-9]+.[0-9]+".toRegex() val migrationMessages: MutableList = ArrayList(10) /** @@ -92,19 +93,18 @@ class MigrationManager( log.info("No migrations to execute. Upgrading from alpha, beta or dev version.") return } - if (isOlder( - previous, current - ) - ) { + if (!current.matches(release)) { + log.info("No migrations to execute. Running development branch.") + return + } + if (isOlder(previous, current)) { log.info("No migrations to execute. User went back a version. From $previous to $current.") return } if (previous == current) { log.info("No migrations to execute. User has not updated.") } - val migrationMethods = getMigrationMethods( - previous, current - ) + val migrationMethods = getMigrationMethods(previous, current) if (migrationMethods.isNotEmpty()) { for (method in migrationMethods) { log.info("Resolving migrations for: ${toSemantic(method!!.name)}")