Skip to content

Commit 975e91b

Browse files
committed
build: integrate and configure flatpak-gradle-generator
- Add `flatpak-gradle-generator` plugin to the Version Catalog. - Update the root `flatpakGradleGenerator` task to output to `packaging/flatpak/flatpak-sources.json` and exclude test configurations. - Apply and configure the generator plugin within `build-logic/convention` to generate `flatpak-sources-convention.json`. - Update the Flatpak manifest to include the newly generated convention sources. - Set the generator's download directory to `./offline-repository` for dependency caching.
1 parent b17d5b6 commit 975e91b

4 files changed

Lines changed: 15 additions & 3 deletions

File tree

build-logic/convention/build.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
33

44
plugins {
55
`kotlin-dsl`
6+
alias(libs.plugins.flatpak.gradle.generator)
67
}
78

89
group = "zed.rainxch.convention.buildlogic"
@@ -38,6 +39,12 @@ tasks {
3839
}
3940
}
4041

42+
tasks.flatpakGradleGenerator {
43+
outputFile = file("../../packaging/flatpak/flatpak-sources-convention.json")
44+
downloadDirectory.set("./offline-repository")
45+
excludeConfigurations.set(listOf("testCompileClasspath", "testRuntimeClasspath"))
46+
}
47+
4148
gradlePlugin {
4249
plugins {
4350
register("androidApplication") {

build.gradle.kts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id("io.github.jwharm.flatpak-gradle-generator") version "1.7.0"
2+
alias(libs.plugins.flatpak.gradle.generator)
33
alias(libs.plugins.android.application) apply false
44
alias(libs.plugins.android.library) apply false
55
alias(libs.plugins.compose.hot.reload) apply false
@@ -12,8 +12,10 @@ plugins {
1212
alias(libs.plugins.room) apply false
1313
}
1414

15-
tasks.named<io.github.jwharm.flatpakgradlegenerator.FlatpakGradleGeneratorTask>("flatpakGradleGenerator") {
16-
outputFile.set(layout.buildDirectory.file("flatpak-sources.json"))
15+
tasks.flatpakGradleGenerator {
16+
outputFile = file("packaging/flatpak/flatpak-sources.json")
17+
downloadDirectory.set("./offline-repository")
18+
excludeConfigurations.set(listOf("testCompileClasspath", "testRuntimeClasspath"))
1719
}
1820

1921
subprojects {

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ work = "2.11.1"
4848
resources="1.10.1"
4949

5050
ktlint-gradle = "12.1.1"
51+
flatpak-gradle-generator = "1.7.0"
5152

5253
projectApplicationId = "zed.rainxch.githubstore"
5354
projectVersionName = "1.6.2"
@@ -190,6 +191,7 @@ ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
190191
room = { id = "androidx.room", version.ref = "room" }
191192
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
192193
buildkonfig = { id = "com.codingfeline.buildkonfig", version.ref = "buildkonfig" }
194+
flatpak-gradle-generator = { id = "io.github.jwharm.flatpak-gradle-generator", version.ref = "flatpak-gradle-generator" }
193195

194196
[bundles]
195197
koin-common = [

packaging/flatpak/zed.rainxch.githubstore.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,4 @@ modules:
141141
dest-filename: gradle-bin.zip
142142
# Pre-downloaded Gradle/Maven dependencies for offline build
143143
- flatpak-sources.json
144+
- flatpak-sources-convention.json

0 commit comments

Comments
 (0)