hammer-editor/settings.gradle.kts
Adam Brown a2998adcba
Re-enable public-storage projects on F-Droid builds (#568)
Restores the "store projects in public storage" feature, gated to F-Droid builds (the required MANAGE_EXTERNAL_STORAGE permission is disallowed on Google Play).

- Expose the build channel at runtime via BuildConfig.FDROID in the common module.
- Declare the storage permissions only in src/fdroid/AndroidManifest.xml, swapped in for F-Droid builds.
- Restore the storage-location toggle + file-access UI, gated on BuildConfig.FDROID; reconcile the toggle with the real location on open.
- Build the GitHub release APK as the F-Droid flavor.
- Extract the directory move into a tested FileSystem.moveDirectory() helper (fixes the same-path data-loss crash; runs off the UI thread).
- Read the fdroid flag consistently across settings.gradle.kts and module scripts.
- Document the F-Droid build flag in DEVELOPMENT.md.
2026-06-07 19:16:42 -07:00

31 lines
1.1 KiB
Kotlin

// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
pluginManagement {
repositories {
google()
gradlePluginPortal()
mavenCentral()
}
}
// F-Droid can't provide JBR or reach foojay, so skip both for F-Droid builds.
// The flag is honoured from -Pfdroid=true, an `fdroid` entry in gradle.properties,
// or the FDROID_BUILD environment variable - the same sources the module build
// scripts read, so a single gradle.properties line drives the whole build.
plugins {
val isFDroid = providers.gradleProperty("fdroid").orNull?.isNotEmpty() == true ||
System.getenv("FDROID_BUILD") != null
if (!isFDroid) {
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
}
}
rootProject.name = "hammer"
val isFDroidBuild = providers.gradleProperty("fdroid").orNull?.isNotEmpty() == true ||
System.getenv("FDROID_BUILD") != null
val modules = mutableListOf(":base", ":android", ":composeUi", ":common", ":server", ":integrationTests")
if (!isFDroidBuild) {
modules += ":desktop"
}
include(*modules.toTypedArray())