Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 7 additions & 38 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,9 @@ dependencies {
implementation(compose.desktop.currentOs)
// The entry-point module — provides nucleusApplication and DecoratedWindow
implementation(libs.nucleus.application)
// Enable the Tao backend (Rust-native windowing)
implementation(libs.nucleus.decorated.window.tao)
// The Tao windowing runtime (Rust-native). Transitive via nucleus-application, but TitleBar is
// called directly, so it is declared directly.
implementation(libs.nucleus.window.runtime)
// The desktop's light/dark preference (XDG portal on Linux, native on macOS/Windows), pushed
// as it changes. Already on the classpath via nucleus-application — which installs it over
// Compose's LocalSystemTheme — but Theme.kt calls it directly, so it is declared directly.
Expand Down Expand Up @@ -316,6 +317,10 @@ nucleus.application {
// shortcut, macOS dock/Finder) gets a real icon. Each format must be built on its own
// OS (jpackage limitation), but the icon is wired up for when it is.
linux {
// The full version, pre-release included: electron-builder turns the '-' into '~' for
// .rpm and .deb, which sorts 1.6.2~alpha.7 after 1.6.1 and before 1.6.2. The .msi and
// .dmg keep the plain x.y.z above, the only form they take.
packageVersion = buildVersion.display
iconFile.set(File(projectDir, "packaging/icons/icon.png")) // .deb + .rpm
packageName = "gitvantage" // lowercase: Debian policy
debMaintainer = "raman@inner.tech"
Expand Down Expand Up @@ -634,42 +639,6 @@ tasks.matching { it.name.startsWith("packageGraalvm") && it.name != "packageGraa
dependsOn(verifyGraalvmNativeImage, smokeTestNativeImage, smokeTestNativeImageSubsystems)
}

// The .rpm/.deb version, written where electron-builder reads it.
//
// Nucleus (2.5.18) hands electron-builder its version through a package.json in the output folder,
// and writes that file only if it doesn't exist yet: once written it was never refreshed, so every
// later build kept the first build's version. And the version a pre-release needs can't reach it
// through the DSL: electron-builder accepts only semver ("1.6.2-alpha.7"), which Nucleus's
// configuration-time check rejects for Rpm because the version has a '-'.
//
// So for the Linux packagers the file is written here, before each run, with the full version —
// electron-builder itself turns the '-' into '~' for .rpm and .deb, which sorts 1.6.2~alpha.7 after
// 1.6.1 and before 1.6.2. The other packagers get the file deleted instead, so Nucleus writes it
// afresh from the plain x.y.z that .msi and .dmg require.
tasks.withType<dev.nucleusframework.desktop.application.tasks.AbstractElectronBuilderPackageTask>().configureEach {
val packageJson = destinationDir.file("package.json")
val linux = name.contains("Rpm") || name.contains("Deb")
val version = buildVersion.display
inputs.property("fullVersion", version) // the DSL only sees x.y.z; alpha.7 → alpha.8 must still repackage
doFirst {
val file = packageJson.get().asFile
if (!linux) { file.delete(); return@doFirst }
file.parentFile.mkdirs()
file.writeText(
"""
|{
| "name": "gitvantage",
| "version": "$version",
| "description": "A git status dashboard for people who juggle a lot of repositories.",
| "author": "Raman Gupta",
| "private": true
|}
|
""".trimMargin(),
)
}
}


// --- Subsystem checks on the development classpath ----------------------------------------------
//
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[versions]
compose = "1.12.2"
compose = "1.13.0"
detekt = "2.0.0-alpha.6"
dbusJava = "5.2.2"
fileKit = "0.17.0"
humanReadable = "2.0.0"
konture = "1.0.2"
kotlin = "2.4.21"
kotlinxSerialization = "1.12.0"
nucleus = "2.5.18"
nucleus = "3.0.0"
slf4j = "2.0.20"
testBalloon = "1.2.0"

Expand All @@ -31,7 +31,7 @@ konture = { module = "io.github.baole:konture", version.ref = "konture" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerialization" }
nucleus-application = { module = "dev.nucleusframework:nucleus.nucleus-application", version.ref = "nucleus" }
nucleus-darkmode-detector = { module = "dev.nucleusframework:nucleus.darkmode-detector", version.ref = "nucleus" }
nucleus-decorated-window-tao = { module = "dev.nucleusframework:nucleus.decorated-window-tao", version.ref = "nucleus" }
nucleus-window-runtime = { module = "dev.nucleusframework:nucleus.window-runtime", version.ref = "nucleus" }
nucleus-fsWatcher = { module = "dev.nucleusframework:nucleus.fs-watcher", version.ref = "nucleus" }
nucleus-notification-common = { module = "dev.nucleusframework:nucleus.notification-common", version.ref = "nucleus" }
slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" }
Expand Down
3 changes: 1 addition & 2 deletions src/main/kotlin/com/gitvantage/ui/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import com.gitvantage.app.Tokens
import com.gitvantage.app.UiScale
import com.gitvantage.smoke.runSmokeChecks
import dev.nucleusframework.application.DecoratedWindow
import dev.nucleusframework.application.NucleusBackend
import dev.nucleusframework.application.nucleusApplication
import dev.nucleusframework.core.runtime.SingleInstanceManager
import dev.nucleusframework.window.NucleusDecoratedWindowTheme
Expand Down Expand Up @@ -135,7 +134,7 @@ internal val appIcon: Painter by lazy {
}

@OptIn(FlowPreview::class)
private fun runApp() = nucleusApplication(backend = NucleusBackend.Tao) {
private fun runApp() = nucleusApplication {
adoptContextClassLoader()
val saved = Registry.settings()
// Before the first frame, so the window is painted in the right theme rather than flashing
Expand Down
Loading