-
-
Notifications
You must be signed in to change notification settings - Fork 136
Pub flatpak #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Pub flatpak #168
Changes from 13 commits
13cc4b2
00cf6f6
9511fdf
f1be2cf
8451e69
fac7ab2
cbc4826
11f4ce8
8cfefd1
07c3254
d18261c
13d79df
065a84b
1a972b6
6b06857
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,7 +17,6 @@ plugins { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val appVersionName = "1.5.1" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val appVersionCode = 10 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Load local.properties for secrets like GITHUB_CLIENT_ID | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val localProps = Properties().apply { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val file = rootProject.file("local.properties") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (file.exists()) file.inputStream().use { this.load(it) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -129,6 +128,8 @@ kotlin { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Room | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| implementation(libs.androidx.room.runtime) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| implementation(libs.sqlite.bundled) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| implementation(libs.kotlinx.coroutinesSwing) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+131
to
133
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, locate and examine the build.gradle.kts file around the flagged lines
find . -name "build.gradle.kts" -path "*/composeApp/*" | head -5Repository: rainxchzed/Github-Store Length of output: 96 🏁 Script executed: # Read the file to see the context around lines 131-133 and the source sets
cat -n composeApp/build.gradle.kts | sed -n '120,145p'Repository: rainxchzed/Github-Store Length of output: 1071 🏁 Script executed: # Get the full picture of source sets and all dependencies sections
cat -n composeApp/build.gradle.kts | grep -A 5 -B 2 "commonMain\|jvmMain\|dependencies"Repository: rainxchzed/Github-Store Length of output: 2883 🏁 Script executed: # Check the full commonMain.dependencies block to see all dependencies
cat -n composeApp/build.gradle.kts | sed -n '77,133p'Repository: rainxchzed/Github-Store Length of output: 2670 🏁 Script executed: # Check what targets are configured in the kotlin block
cat -n composeApp/build.gradle.kts | grep -A 20 "kotlin {" | head -30Repository: rainxchzed/Github-Store Length of output: 890 🏁 Script executed: # Look for the libs.kotlinx.coroutinesSwing definition in gradle catalog
find . -name "*.toml" -o -name "libs.gradle" | xargs grep -l "coroutinesSwing" 2>/dev/null || echo "Checking for version catalog..."
find . -name "libs.versions.toml" | head -1 | xargs cat 2>/dev/null | grep -A 2 -B 2 "coroutinesSwing"Repository: rainxchzed/Github-Store Length of output: 638 🌐 Web query:
💡 Result: Short answer: kotlinx-coroutines-swing is a JVM-only module that provides a Swing (EDT) MainCoroutineDispatcher (Dispatchers.Swing / Main on JVM). If you need Dispatchers.Main for Swing on the JVM (including desktop Kotlin/JVM or the JVM target of a multiplatform project) you must add the org.jetbrains.kotlinx:kotlinx-coroutines-swing artifact to your runtime dependencies. [1][2] Sources:
Move
Fix commonMain.dependencies {
// ... other dependencies
- implementation(libs.kotlinx.coroutinesSwing)
}
jvmMain {
kotlin.srcDir(layout.buildDirectory.dir("generated/buildconfig/jvm"))
dependencies {
implementation(compose.desktop.currentOs)
+ implementation(libs.kotlinx.coroutinesSwing)
// Koin core🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| commonTest.dependencies { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| implementation(libs.kotlin.test) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -143,7 +144,6 @@ kotlin { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dependencies { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| implementation(compose.desktop.currentOs) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| implementation(libs.kotlinx.coroutinesSwing) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Koin core | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| implementation(libs.koin.core) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Ktor client for JVM Desktop | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -260,3 +260,152 @@ compose.desktop { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val appId = "zed.rainxch.githubstore" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val appName = "GitHub-Store" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val flatpakDir = layout.buildDirectory.dir("flatpak") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val flatpakSourceDir = layout.buildDirectory.dir("flatpak-source") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Define copy tasks separately to avoid configuration cache issues | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val copyFlatpakBinary = tasks.register<Copy>("copyFlatpakBinary") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dependsOn("packageAppImage") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val appImageOutput = layout.buildDirectory.dir("compose/binaries/main/app/$appName") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from(appImageOutput) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| into(flatpakDir.map { it.asFile.resolve("build") }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| doFirst { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val targetDir = outputs.files.singleFile | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (targetDir.exists()) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| targetDir.deleteRecursively() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| targetDir.mkdirs() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+270
to
+285
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: fd "build.gradle.kts" | head -5Repository: rainxchzed/Github-Store Length of output: 111 🏁 Script executed: git ls-files | grep -E "composeApp.*build\.gradle\.kts"Repository: rainxchzed/Github-Store Length of output: 94 🏁 Script executed: head -300 composeApp/build.gradle.kts | tail -50Repository: rainxchzed/Github-Store Length of output: 1594 🏁 Script executed: rg "packageAppImage|register.*AppImage" composeApp/build.gradle.kts -B 2 -A 5Repository: rainxchzed/Github-Store Length of output: 407 🏁 Script executed: rg "OperatingSystem|isLinux|isWindows|isMac" composeApp/build.gradle.ktsRepository: rainxchzed/Github-Store Length of output: 49 🏁 Script executed: rg "outputs\.files\.singleFile" composeApp/build.gradle.ktsRepository: rainxchzed/Github-Store Length of output: 164 🏁 Script executed: head -50 composeApp/build.gradle.ktsRepository: rainxchzed/Github-Store Length of output: 1652 🏁 Script executed: rg "import|onlyIf" composeApp/build.gradle.kts | head -20Repository: rainxchzed/Github-Store Length of output: 222 🏁 Script executed: rg "packageAppImage" . -A 3 -B 1 --type kotlinRepository: rainxchzed/Github-Store Length of output: 408 🏁 Script executed: rg "onlyIf.*Linux|onlyIf.*Windows|onlyIf.*platform" composeApp/build.gradle.kts -B 2 -A 2Repository: rainxchzed/Github-Store Length of output: 49 🏁 Script executed: grep -n "onlyIf" composeApp/build.gradle.ktsRepository: rainxchzed/Github-Store Length of output: 83 🏁 Script executed: rg "System.getProperty|os\.name" composeApp/build.gradle.ktsRepository: rainxchzed/Github-Store Length of output: 49 🏁 Script executed: cat -n composeApp/build.gradle.kts | sed -n '200,350p'Repository: rainxchzed/Github-Store Length of output: 5541 🏁 Script executed: cat -n composeApp/build.gradle.kts | sed -n '360,380p'Repository: rainxchzed/Github-Store Length of output: 878 🏁 Script executed: rg "System\.getenv|System\.getProperty" composeApp/build.gradle.ktsRepository: rainxchzed/Github-Store Length of output: 49 🌐 Web query:
💡 Result: Short answer: don’t rely on outputs.files.singleFile for a Copy task. declare a concrete output (OutputFile or outputs.file with a Provider) or make the Copy produce a known filename and register that exact file as the task’s output. Why: Copy’s outputs.files is an approximation (and can be a directory or multiple files), so singleFile is brittle. Gradle docs recommend explicitly declaring outputs or using doNotTrackState for weird dirs. [1][2] Two concise patterns:
Kotlin DSL:
References:
If you want, tell me which Gradle version and show your current Copy task and I’ll give the exact code to make it robust. 🌐 Web query:
💡 Result: Use Gradle's public OperatingSystem types (not the internal org.gradle.internal.*). Options:
Do not depend on org.gradle.internal.* — the Gradle public-API docs mark internal packages unsupported. [4] Sources:
This task depends on The proposed fix is on the right track for the cleanup logic, but uses Revised fix val copyFlatpakBinary = tasks.register<Copy>("copyFlatpakBinary") {
+ onlyIf { System.getProperty("os.name").lowercase().contains("linux") }
dependsOn("packageAppImage")
+ val targetDir = flatpakDir.map { it.asFile.resolve("build") }
- val appImageOutput = layout.buildDirectory.dir("compose/binaries/main/app/$appName")
+ val appImageOutput = layout.buildDirectory.dir("compose/binaries/main/app/$appName")
from(appImageOutput)
- into(flatpakDir.map { it.asFile.resolve("build") })
+ into(targetDir)
doFirst {
- val targetDir = outputs.files.singleFile
- if (targetDir.exists()) {
- targetDir.deleteRecursively()
+ val dir = targetDir.get()
+ if (dir.exists()) {
+ dir.deleteRecursively()
}
- targetDir.mkdirs()
+ dir.mkdirs()
}
} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val copyFlatpakResources = tasks.register<Copy>("copyFlatpakResources") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val resourcesDir = layout.projectDirectory.dir("src/jvmMain/resources/flatpak") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from(resourcesDir) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| include("manifest.yml", "*.desktop", "*.xml") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| into(flatpakDir.map { it.asFile.resolve("build") }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rename("manifest.yml", "$appId.yml") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tasks.register<Exec>("packageFlatpak") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dependsOn(copyFlatpakResources) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group = "build" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description = "Build Flatpak for Linux desktop (binary-based)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val buildDir = flatpakDir.map { it.asFile.resolve("build") } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val repoDir = flatpakDir.map { it.asFile.resolve("repo") } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workingDir(buildDir) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| commandLine( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "flatpak-builder", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "--install-deps-from=flathub", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "--repo=${repoDir.get().absolutePath}", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "--force-clean", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "--disable-rofiles-fuse", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "build/${appId}", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "$appId.yml" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tasks.register<Exec>("exportFlatpak") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dependsOn("packageFlatpak") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group = "build" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description = "Export Flatpak bundle (binary-based)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val versionName = appVersionName | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workingDir(flatpakDir) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| commandLine("flatpak", "build-bundle", "repo", "github-store-${versionName}.flatpak", appId, "master") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tasks.register<Exec>("runFlatpak") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dependsOn("packageFlatpak") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group = "run" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description = "Run the Flatpak locally (binary-based)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val buildDir = flatpakDir.map { it.asFile.resolve("build") } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workingDir(buildDir) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| commandLine("flatpak-builder", "--run", "build/${appId}", "${appId}.yml", "GitHub-Store") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Source-based tasks for Flathub submission | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val copyFlatpakSourceResources = tasks.register<Copy>("copyFlatpakSourceResources") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val resourcesDir = layout.projectDirectory.dir("src/jvmMain/resources/flatpak") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from(resourcesDir) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| include("zed.rainxch.githubstore.yml", "*.desktop", "*.xml", "app_icon.png") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| into(flatpakSourceDir.map { it.asFile.resolve("build") }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| doFirst { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val targetDir = outputs.files.singleFile | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (targetDir.exists()) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| targetDir.deleteRecursively() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| targetDir.mkdirs() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+343
to
+358
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix directory cleanup to target the correct path. The same issue as in 🔧 Proposed fix val copyFlatpakSourceResources = tasks.register<Copy>("copyFlatpakSourceResources") {
val resourcesDir = layout.projectDirectory.dir("src/jvmMain/resources/flatpak")
from(resourcesDir) {
include("zed.rainxch.githubstore.yml", "*.desktop", "*.xml", "app_icon.png")
}
into(flatpakSourceDir.map { it.asFile.resolve("build") })
doFirst {
- val targetDir = outputs.files.singleFile
+ val targetDir = flatpakSourceDir.get().asFile.resolve("build")
if (targetDir.exists()) {
targetDir.deleteRecursively()
}
targetDir.mkdirs()
}
}📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val copyGeneratedSources = tasks.register<Copy>("copyGeneratedSources") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dependsOn(copyFlatpakSourceResources) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val sourcesFile = layout.projectDirectory.file("generated-sources.json") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from(sourcesFile) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| into(flatpakSourceDir.map { it.asFile.resolve("build") }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| onlyIf { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sourcesFile.asFile.exists() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tasks.register<Exec>("packageFlatpakSource") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dependsOn(copyGeneratedSources) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group = "build" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description = "Build Flatpak for Linux desktop (source-based for submission)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val buildDir = flatpakSourceDir.map { it.asFile.resolve("build") } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val repoDir = flatpakSourceDir.map { it.asFile.resolve("repo") } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workingDir(buildDir) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| commandLine( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "flatpak-builder", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "--install-deps-from=flathub", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "--repo=${repoDir.get().absolutePath}", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "--force-clean", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "build/${appId}", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "$appId.yml" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tasks.register<Exec>("exportFlatpakSource") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dependsOn("packageFlatpakSource") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group = "build" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description = "Export Flatpak bundle (source-based)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val versionName = appVersionName | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workingDir(flatpakSourceDir) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| commandLine("flatpak", "build-bundle", "repo", "github-store-${versionName}-source.flatpak", appId, "master") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tasks.register<Exec>("runFlatpakSource") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dependsOn("packageFlatpakSource") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group = "run" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description = "Run the Flatpak locally (source-based)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| val buildDir = flatpakSourceDir.map { it.asFile.resolve("build") } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workingDir(buildDir) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| commandLine("flatpak-builder", "--run", "build/${appId}", "${appId}.yml", "GitHub-Store") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
342
to
412
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Source-based tasks reference the wrong manifest filename (
Proposed fix (rename on copy to reuse $appId.yml) val copyFlatpakSourceResources = tasks.register<Copy>("copyFlatpakSourceResources") {
val resourcesDir = layout.projectDirectory.dir("src/jvmMain/resources/flatpak")
from(resourcesDir) {
include("zed.rainxch.githubstore.yml", "*.desktop", "*.xml", "app_icon.png")
}
into(flatpakSourceDir.map { it.asFile.resolve("build") })
+
+ rename("zed.rainxch.githubstore.yml", "$appId.yml")
doFirst {
val targetDir = outputs.files.singleFile
if (targetDir.exists()) {
targetDir.deleteRecursively()
}
targetDir.mkdirs()
}
}🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| app-id: zed.rainxch.githubstore | ||
| runtime: org.freedesktop.Platform | ||
| runtime-version: '25.08' | ||
| sdk: org.freedesktop.Sdk//25.08 | ||
| command: GitHub-Store | ||
| finish-args: | ||
| - --share=network | ||
| - --share=ipc | ||
| - --socket=x11 | ||
| - --socket=wayland | ||
| - --device=dri | ||
| - --filesystem=xdg-download | ||
| - --env=GDK_BACKEND=x11,wayland | ||
| modules: | ||
| - name: githubstore | ||
| buildsystem: simple | ||
| build-commands: | ||
| - mkdir -p /app/bin /app/lib | ||
| - install -Dm755 bin/GitHub-Store /app/bin/GitHub-Store | ||
| - cp -r lib/* /app/lib/ | ||
| - mkdir -p /app/share/applications | ||
| - install -D zed.rainxch.githubstore.desktop /app/share/applications/ | ||
| - mkdir -p /app/share/icons/hicolor/512x512/apps/ | ||
| - install -D app_icon.png /app/share/icons/hicolor/512x512/apps/zed.rainxch.githubstore.png | ||
| - mkdir -p /app/share/metainfo/ | ||
| - install -D zed.rainxch.githubstore.appdata.xml /app/share/metainfo/zed.rainxch.githubstore.appdata.xml | ||
| sources: | ||
| - type: dir | ||
| path: . | ||
| skip: | ||
| - zed.rainxch.githubstore.yml | ||
| - manifest.yml | ||
|
Comment on lines
+1
to
+32
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❓ Verification inconclusiveFlatpak manifest format sdk field syntax runtime-version Short answer — in a Flatpak manifest (JSON or YAML) you set:
Example (JSON): These fields are top-level manifest keys used by flatpak-builder to choose the platform and SDK for build and packaging. [1][2] Sources: AppStream metainfo.xml vs appdata.xml naming convention Short answer
Details / rationale (brief)
Sources Script executed: # Check if there are any other Flatpak manifests in the repo for reference
find . -name "*.yml" -o -name "*.yaml" | grep -i flatpak | head -20Repository: rainxchzed/Github-Store Repository: rainxchzed/Github-Store stdout: Script executed: # Look at the Gradle build config to understand the manifest renaming behavior
find . -name "build.gradle*" -o -name "*.gradle" | head -20Repository: rainxchzed/Github-Store Repository: rainxchzed/Github-Store stdout: Script executed: # Check the build.gradle.kts to understand manifest naming/handling
cat -n composeApp/build.gradle.kts | head -100Repository: rainxchzed/Github-Store Repository: rainxchzed/Github-Store stdout: Script executed: # Also check the root build.gradle.kts
cat -n build.gradle.kts | head -100Repository: rainxchzed/Github-Store Repository: rainxchzed/Github-Store stdout: Script executed: # Let's look at the flatpak directory structure
find composeApp/src/jvmMain/resources/flatpak -type fRepository: rainxchzed/Github-Store Repository: rainxchzed/Github-Store stdout: Script executed: # Check if there's any documentation or comments about the manifest renaming
grep -r "manifest\|appId" composeApp/src/jvmMain/resources/flatpak/ 2>/dev/nullRepository: rainxchzed/Github-Store Repository: rainxchzed/Github-Store stdout: Script executed: # Check the appdata.xml file to see what component type is declared
cat composeApp/src/jvmMain/resources/flatpak/zed.rainxch.githubstore.appdata.xmlRepository: rainxchzed/Github-Store Repository: rainxchzed/Github-Store stdout: Script executed: # Check the desktop file as well for context
cat composeApp/src/jvmMain/resources/flatpak/zed.rainxch.githubstore.desktopRepository: rainxchzed/Github-Store Repository: rainxchzed/Github-Store stdout: Script executed: # Check the source-based manifest to understand the two-manifest approach
cat composeApp/src/jvmMain/resources/flatpak/zed.rainxch.githubstore.ymlRepository: rainxchzed/Github-Store Repository: rainxchzed/Github-Store stdout: Script executed: # Check if there's any Gradle task or configuration that renames manifest files
grep -r "manifest" composeApp/build.gradle.kts | head -20Repository: rainxchzed/Github-Store Repository: rainxchzed/Github-Store stdout: Script executed: # Search the entire codebase for any manifest renaming logic
rg "manifest\.(yml|yaml)" --type gradle --type kotlin -A 3 -B 3Repository: rainxchzed/Github-Store Repository: rainxchzed/Github-Store stdout: Remove the double-slash from the Flatpak manifests use separate fields for 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <component type="desktop-application"> | ||
| <id>zed.rainxch.githubstore</id> | ||
| <metadata_license>CC0-1.0</metadata_license> | ||
| <project_license>Apache-2.0</project_license> | ||
| <name>GitHub Store</name> | ||
| <summary>A cross-platform app store for GitHub releases</summary> | ||
| <description> | ||
| <p>GitHub Store is a cross-platform "play store" for GitHub releases. It discovers repositories that ship real installable binaries and lets you install, track, and update them across platforms from one place.</p> | ||
| <p>Key Features:</p> | ||
| <ul> | ||
| <li>Smart discovery with Trending, Recently Updated, and New sections</li> | ||
| <li>Only shows repositories with installable assets (APK, EXE, DMG, AppImage, DEB, RPM, etc.)</li> | ||
| <li>Platform-aware filtering - automatically detects and shows installers for your OS</li> | ||
| <li>Always installs from the latest published release with changelog preview</li> | ||
| <li>Rich app details with README rendering, statistics, and developer info</li> | ||
| <li>GitHub OAuth login for higher API rate limits</li> | ||
| <li>Material 3 design with dynamic color support and dark mode</li> | ||
| <li>Cross-platform support for Android and Desktop (Windows, macOS, Linux)</li> | ||
| </ul> | ||
| <p>Built with Kotlin Multiplatform and Compose Multiplatform for a consistent experience across all platforms.</p> | ||
| </description> | ||
| <developer id="zed.rainxch"> | ||
| <name>rainxchzed</name> | ||
| </developer> | ||
| <url type="homepage">https://github.com/rainxchzed/Github-Store</url> | ||
| <url type="bugtracker">https://github.com/rainxchzed/Github-Store/issues</url> | ||
| <url type="vcs-browser">https://github.com/rainxchzed/Github-Store</url> | ||
| <url type="contribute">https://github.com/rainxchzed/Github-Store/blob/main/CONTRIBUTING.md</url> | ||
| <url type="donation">https://github.com/sponsors/rainxchzed</url> | ||
| <launchable type="desktop-id">zed.rainxch.githubstore.desktop</launchable> | ||
| <provides> | ||
| <binary>GitHub-Store</binary> | ||
| </provides> | ||
| <categories> | ||
| <category>Development</category> | ||
| <category>Utility</category> | ||
| </categories> | ||
| <keywords> | ||
| <keyword>github</keyword> | ||
| <keyword>releases</keyword> | ||
| <keyword>app store</keyword> | ||
| <keyword>package manager</keyword> | ||
| <keyword>installer</keyword> | ||
| </keywords> | ||
| <content_rating type="oars-1.1"> | ||
| <content_attribute id="social-info">moderate</content_attribute> | ||
| </content_rating> | ||
| <releases> | ||
| <release version="1.5.1" date="2026-01-10"> | ||
| <description> | ||
| <p>A quality-of-life update focused on smoother navigation, smarter syncing, and richer localization.</p> | ||
| <p>Highlights:</p> | ||
| <ul> | ||
| <li>New liquid bottom navigation bar for a more fluid and modern experience</li> | ||
| <li>Favorites and feedback features on the details screen</li> | ||
| <li>Smarter data migration and improved system sync for better state alignment</li> | ||
| <li>New language support: Korean, Bengali, and Italian</li> | ||
| <li>Improved translations and localized theme options</li> | ||
| <li>Home screen refactored for better maintainability</li> | ||
| <li>Enhanced search experience with polished input behavior</li> | ||
| <li>Authentication improvements for more reliable sign-in</li> | ||
| <li>Fixed Android update issues</li> | ||
| </ul> | ||
| </description> | ||
| <url>https://github.com/rainxchzed/Github-Store/releases/tag/1.5.1</url> | ||
| </release> | ||
| </releases> | ||
| </component> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| [Desktop Entry] | ||
| Version=1.0 | ||
| Type=Application | ||
| Categories=Development; | ||
| Terminal=false | ||
| Exec=GitHub-Store %U | ||
| Name=GitHub Store | ||
| Comment=Discover and install apps from GitHub releases | ||
| Icon=zed.rainxch.githubstore | ||
| StartupWMClass=GitHub-Store |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| app-id: zed.rainxch.githubstore | ||
| runtime: org.freedesktop.Platform | ||
| runtime-version: '25.08' | ||
| sdk: org.freedesktop.Sdk | ||
| sdk-extensions: | ||
| - org.freedesktop.Sdk.Extension.openjdk21 | ||
| command: GitHub-Store | ||
| finish-args: | ||
| # Network access for GitHub API | ||
| - --share=network | ||
| # Required for X11/Wayland GUI applications | ||
| - --share=ipc | ||
| # Display server access - supports both X11 and Wayland | ||
| - --socket=x11 | ||
| - --socket=wayland | ||
| # GPU acceleration | ||
| - --device=dri | ||
| # File system access for downloads | ||
| - --filesystem=xdg-download | ||
| # Ensures compatibility across different display configurations | ||
| - --env=GDK_BACKEND=x11,wayland | ||
| modules: | ||
| - name: githubstore | ||
| buildsystem: simple | ||
| build-options: | ||
| append-path: /usr/lib/sdk/openjdk21/bin | ||
| env: | ||
| JAVA_HOME: /usr/lib/sdk/openjdk21 | ||
| sources: | ||
| - type: git | ||
| url: https://github.com/rainxchzed/Github-Store.git | ||
| tag: 1.5.1 | ||
| # TODO: Paste the contents of generated-sources.json here as a YAML list | ||
| # Generate it using: flatpak-builder-tools/gradle/flatpak-gradle-generator.py | ||
| # Example format: | ||
| # - type: file | ||
| # url: https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/2.1.0/kotlin-stdlib-2.1.0.jar | ||
| # sha256: abc123... | ||
| # dest: gradle-cache/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/2.1.0/ | ||
| # dest-filename: kotlin-stdlib-2.1.0.jar | ||
| - type: file | ||
| path: zed.rainxch.githubstore.desktop | ||
| - type: file | ||
| path: app_icon.png | ||
| - type: file | ||
| path: zed.rainxch.githubstore.appdata.xml | ||
| build-commands: | ||
| - chmod +x gradlew | ||
| - export GRADLE_USER_HOME=$PWD/.gradle | ||
| - ./gradlew --offline --no-daemon packageAppImage | ||
| - mkdir -p /app/bin /app/lib | ||
| - cp -r composeApp/build/compose/binaries/main/app/GitHub-Store/bin/* /app/bin/ | ||
| - cp -r composeApp/build/compose/binaries/main/app/GitHub-Store/lib/* /app/lib/ | ||
| - install -D zed.rainxch.githubstore.desktop /app/share/applications/zed.rainxch.githubstore.desktop | ||
| - install -D app_icon.png /app/share/icons/hicolor/512x512/apps/zed.rainxch.githubstore.png | ||
| - install -Dm644 zed.rainxch.githubstore.appdata.xml /app/share/metainfo/zed.rainxch.githubstore.metainfo.xml | ||
|
Comment on lines
+1
to
+56
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: org.freedesktop.Platform 25.08 is the Freedesktop (Flatpak) runtime from the Freedesktop SDK 25.08 release (major release for 2025). It was published as part of Freedesktop SDK 25.08 (release announced Sept 3, 2025) and introduces several breaking/behavior changes (e.g., openh264/ffmpeg-full replaced by codecs-extra, removal/replacements of some drivers and packages). [1][2][3] Quick actions:
Sources: 🌐 Web query:
💡 Result: Short answer: Yes — the Freedesktop org.freedesktop.Platform 25.08 runtime is available on Flathub and is a supported/current Freedesktop runtime. Install with flatpak (example):
Sources: Flathub runtime pages and release notes, and Flatpak runtime documentation. [1][2][3] References
🌐 Web query:
💡 Result: Short answer: you must vendor all Maven/Gradle artifacts into your Flatpak manifest (or into a local repo included as a source) and make Gradle use only that local repo / its cache during the build. Flatpak builds disallow network access, so fetching from Maven Central at build time is not permitted — either generate Flatpak "sources" for each dependency or include a pre-built local Maven/Gradle cache and point your build to it. [1][2][3][4] Recommended approaches (concise):
Practical notes / gotchas:
Useful references:
If you want, tell me which build setup you have (single-module Kotlin/Java, Android, or multimodule) and I’ll give an exact manifest + Gradle repo snippet and a short workflow to produce the vendored sources. Build will fail on Flathub: The manifest runs Complete the TODO using 🤖 Prompt for AI Agents |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical: JVM-specific dependency in commonMain will break Android builds.
kotlinx.coroutinesSwingrequires the Swing library, which is JVM-specific and not available on Android or other platforms. Adding this tocommonMain.dependencieswill cause compilation failures for non-JVM targets.🐛 Proposed fix
Move this dependency back to
jvmMain.dependencies:// Room implementation(libs.androidx.room.runtime) implementation(libs.sqlite.bundled) - - implementation(libs.kotlinx.coroutinesSwing) }And add it to
jvmMain.dependencies:jvmMain { kotlin.srcDir(layout.buildDirectory.dir("generated/buildconfig/jvm")) dependencies { implementation(compose.desktop.currentOs) // Koin core implementation(libs.koin.core) // Ktor client for JVM Desktop implementation(libs.ktor.client.core) implementation(libs.ktor.client.java) implementation(libs.ktor.client.content.negotiation) implementation(libs.ktor.serialization.kotlinx.json) implementation(libs.kotlinx.serialization.json) implementation(libs.kotlinx.coroutinesSwing) } }🤖 Prompt for AI Agents