2024-04-21 04:07:32 +00:00
|
|
|
plugins {
|
2026-04-16 22:26:46 +05:30
|
|
|
alias(libs.plugins.android.application)
|
|
|
|
|
alias(libs.plugins.kotlin.android)
|
2025-05-29 21:12:00 +05:30
|
|
|
id "dev.flutter.flutter-gradle-plugin"
|
2026-04-16 22:26:46 +05:30
|
|
|
alias(libs.plugins.ksp)
|
|
|
|
|
alias(libs.plugins.kotlin.serialization)
|
|
|
|
|
alias(libs.plugins.kotlin.compose)
|
2022-02-03 10:06:44 -06:00
|
|
|
}
|
|
|
|
|
|
2022-03-13 22:10:07 -05:00
|
|
|
def keystoreProperties = new Properties()
|
|
|
|
|
def keystorePropertiesFile = rootProject.file('key.properties')
|
|
|
|
|
if (keystorePropertiesFile.exists()) {
|
2025-05-29 21:12:00 +05:30
|
|
|
keystorePropertiesFile.withInputStream { keystoreProperties.load(it) }
|
2022-03-13 22:10:07 -05:00
|
|
|
}
|
|
|
|
|
|
2022-02-03 10:06:44 -06:00
|
|
|
android {
|
2026-04-16 22:26:46 +05:30
|
|
|
compileSdk = flutter.compileSdkVersion
|
|
|
|
|
ndkVersion = flutter.ndkVersion
|
2025-05-29 21:12:00 +05:30
|
|
|
|
|
|
|
|
compileOptions {
|
|
|
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
|
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
|
|
|
coreLibraryDesugaringEnabled true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
kotlinOptions {
|
|
|
|
|
jvmTarget = '17'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
|
main.java.srcDirs += 'src/main/kotlin'
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-18 09:37:07 -05:00
|
|
|
buildFeatures {
|
2026-01-24 14:34:29 -05:00
|
|
|
buildConfig true
|
2025-07-18 09:37:07 -05:00
|
|
|
compose true
|
|
|
|
|
}
|
|
|
|
|
|
2025-05-29 21:12:00 +05:30
|
|
|
defaultConfig {
|
|
|
|
|
applicationId "app.alextran.immich"
|
2026-04-16 22:26:46 +05:30
|
|
|
minSdk = 26
|
|
|
|
|
targetSdk = flutter.targetSdkVersion
|
|
|
|
|
versionCode flutter.versionCode
|
|
|
|
|
versionName flutter.versionName
|
2025-05-29 21:12:00 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
signingConfigs {
|
|
|
|
|
release {
|
|
|
|
|
def keyAliasVal = System.getenv("ALIAS")
|
|
|
|
|
def keyPasswordVal = System.getenv("ANDROID_KEY_PASSWORD")
|
|
|
|
|
def storePasswordVal = System.getenv("ANDROID_STORE_PASSWORD")
|
|
|
|
|
|
2026-04-16 22:26:46 +05:30
|
|
|
keyAlias keyAliasVal ?: keystoreProperties['keyAlias']
|
|
|
|
|
keyPassword keyPasswordVal ?: keystoreProperties['keyPassword']
|
|
|
|
|
storeFile file("../key.jks").exists() ? file("../key.jks") : file(keystoreProperties['storeFile'] ?: '../key.jks')
|
|
|
|
|
storePassword storePasswordVal ?: keystoreProperties['storePassword']
|
2022-02-03 10:06:44 -06:00
|
|
|
}
|
2025-05-29 21:12:00 +05:30
|
|
|
}
|
2022-02-03 10:06:44 -06:00
|
|
|
|
2025-05-29 21:12:00 +05:30
|
|
|
buildTypes {
|
|
|
|
|
debug {
|
|
|
|
|
applicationIdSuffix '.debug'
|
|
|
|
|
versionNameSuffix '-DEBUG'
|
2022-02-03 10:06:44 -06:00
|
|
|
}
|
|
|
|
|
|
2025-05-29 21:12:00 +05:30
|
|
|
release {
|
feat(ci): publish PR Android APK to comment (#28283)
* feat(ci): publish PR Android APK to R2 with installable links
Adds a universal debug APK to PR builds and uploads it to a public
R2 bucket alongside the existing GitHub Actions artifact. Posts a
sticky PR comment with tap-to-install links and a QR code so testers
can install directly on their device without unzipping artifacts.
Required setup:
- Secrets: R2_APK_ACCESS_KEY_ID, R2_APK_SECRET_ACCESS_KEY,
R2_APK_ACCOUNT_ID, R2_APK_BUCKET
- Optional repo variable: APK_PUBLIC_HOST (defaults to apk.immich.app)
- R2 bucket configured with a public custom domain matching APK_PUBLIC_HOST
* chore(ci): drop R2 upload, link directly to GitHub artifact
Surfaces the existing release-apk-signed artifact in a sticky PR
comment with a QR code. Avoids new infra and secrets — the trade-off
is GitHub login and a zip wrapper instead of tap-to-install.
* feat(ci): build PR APK as release and publish to GitHub Release
PR builds now produce a release APK signed with the release keystore.
The universal APK is published as a GitHub Release asset under tag
'pr-<num>' (prerelease), giving testers a direct, unzipped, tap-to-
install URL plus a QR code in the PR comment. The release-apk-signed
artifact is unchanged.
* chore(ci): drop GitHub Release, publish universal APK as own artifact
Reverts the prerelease publish. Uploads the universal release APK as
a separate single-file artifact so its download URL gives a zip
containing only that APK — no extra files to dig through. The QR in
the PR comment points at this universal-only artifact.
* chore(ci): build only universal APK for PR, drop split artifact
PR builds skip the arm64-only split — release-apk-signed now contains
just the universal app-release.apk, so the download zip is a single
file. Removes the redundant separate universal artifact and points
the PR comment QR at the main artifact URL.
* feat(mobile): suffix PR APK applicationId so it installs alongside production
Each PR build now becomes app.alextran.immich.pr<num> via PR_NUMBER env
read in build.gradle, so testers can install multiple PR builds and the
Play Store version on the same device without uninstalling. Also tags
the version with -pr<num> for visibility.
* feat(ci): allow PR APK build to run on forks
Forks can now run the Android build job. Steps that need repo secrets
(create-workflow-token, Create Keystore) are skipped when the PR is
from a fork, the checkout falls back to GITHUB_TOKEN, and build.gradle
falls back to debug signing if the release keystore isn't materialised.
The PR comment still requires write access, so it's gated to non-fork
PRs — fork APKs are reachable from the workflow run's artifact tab.
2026-05-09 07:46:40 -05:00
|
|
|
def hasKeystore = file("../key.jks").exists() && file("../key.jks").length() > 0
|
|
|
|
|
signingConfig hasKeystore ? signingConfigs.release : signingConfigs.debug
|
2026-03-05 12:04:45 -05:00
|
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
feat(ci): publish PR Android APK to comment (#28283)
* feat(ci): publish PR Android APK to R2 with installable links
Adds a universal debug APK to PR builds and uploads it to a public
R2 bucket alongside the existing GitHub Actions artifact. Posts a
sticky PR comment with tap-to-install links and a QR code so testers
can install directly on their device without unzipping artifacts.
Required setup:
- Secrets: R2_APK_ACCESS_KEY_ID, R2_APK_SECRET_ACCESS_KEY,
R2_APK_ACCOUNT_ID, R2_APK_BUCKET
- Optional repo variable: APK_PUBLIC_HOST (defaults to apk.immich.app)
- R2 bucket configured with a public custom domain matching APK_PUBLIC_HOST
* chore(ci): drop R2 upload, link directly to GitHub artifact
Surfaces the existing release-apk-signed artifact in a sticky PR
comment with a QR code. Avoids new infra and secrets — the trade-off
is GitHub login and a zip wrapper instead of tap-to-install.
* feat(ci): build PR APK as release and publish to GitHub Release
PR builds now produce a release APK signed with the release keystore.
The universal APK is published as a GitHub Release asset under tag
'pr-<num>' (prerelease), giving testers a direct, unzipped, tap-to-
install URL plus a QR code in the PR comment. The release-apk-signed
artifact is unchanged.
* chore(ci): drop GitHub Release, publish universal APK as own artifact
Reverts the prerelease publish. Uploads the universal release APK as
a separate single-file artifact so its download URL gives a zip
containing only that APK — no extra files to dig through. The QR in
the PR comment points at this universal-only artifact.
* chore(ci): build only universal APK for PR, drop split artifact
PR builds skip the arm64-only split — release-apk-signed now contains
just the universal app-release.apk, so the download zip is a single
file. Removes the redundant separate universal artifact and points
the PR comment QR at the main artifact URL.
* feat(mobile): suffix PR APK applicationId so it installs alongside production
Each PR build now becomes app.alextran.immich.pr<num> via PR_NUMBER env
read in build.gradle, so testers can install multiple PR builds and the
Play Store version on the same device without uninstalling. Also tags
the version with -pr<num> for visibility.
* feat(ci): allow PR APK build to run on forks
Forks can now run the Android build job. Steps that need repo secrets
(create-workflow-token, Create Keystore) are skipped when the PR is
from a fork, the checkout falls back to GITHUB_TOKEN, and build.gradle
falls back to debug signing if the release keystore isn't materialised.
The PR comment still requires write access, so it's gated to non-fork
PRs — fork APKs are reachable from the workflow run's artifact tab.
2026-05-09 07:46:40 -05:00
|
|
|
|
|
|
|
|
def prNumber = System.getenv("PR_NUMBER")
|
|
|
|
|
if (prNumber) {
|
|
|
|
|
applicationIdSuffix ".pr${prNumber}"
|
|
|
|
|
versionNameSuffix "-pr${prNumber}"
|
|
|
|
|
}
|
2022-02-03 10:06:44 -06:00
|
|
|
}
|
2025-05-29 21:12:00 +05:30
|
|
|
}
|
|
|
|
|
namespace 'app.alextran.immich'
|
2025-08-19 12:48:35 -04:00
|
|
|
|
|
|
|
|
externalNativeBuild {
|
|
|
|
|
cmake {
|
|
|
|
|
path "CMakeLists.txt"
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-02-03 10:06:44 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
flutter {
|
2025-05-29 21:12:00 +05:30
|
|
|
source '../..'
|
2022-02-03 10:06:44 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dependencies {
|
2026-05-19 22:25:46 +02:00
|
|
|
constraints {
|
|
|
|
|
implementation("androidx.glance:glance-appwidget") {
|
|
|
|
|
version { strictly libs.versions.glance.get() }
|
|
|
|
|
because 'home_widget requests 1.+ which can resolve to pre-releases incompatible with our compileSdk/AGP'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-16 22:26:46 +05:30
|
|
|
implementation libs.okhttp
|
|
|
|
|
implementation libs.cronet.embedded
|
|
|
|
|
implementation libs.media3.datasource.okhttp
|
|
|
|
|
implementation libs.media3.datasource.cronet
|
|
|
|
|
implementation libs.kotlinx.coroutines.android
|
|
|
|
|
implementation libs.work.runtime.ktx
|
|
|
|
|
implementation libs.concurrent.futures
|
|
|
|
|
implementation libs.guava
|
|
|
|
|
implementation libs.glide
|
|
|
|
|
implementation libs.kotlinx.serialization.json
|
|
|
|
|
|
|
|
|
|
ksp libs.glide.ksp
|
|
|
|
|
coreLibraryDesugaring libs.desugar.jdk.libs
|
2025-07-18 09:37:07 -05:00
|
|
|
|
|
|
|
|
//Glance Widget
|
2026-04-16 22:26:46 +05:30
|
|
|
implementation libs.glance.appwidget
|
|
|
|
|
implementation libs.gson
|
2025-07-18 09:37:07 -05:00
|
|
|
|
|
|
|
|
// Glance Configure
|
2026-04-16 22:26:46 +05:30
|
|
|
implementation libs.activity.compose
|
|
|
|
|
implementation libs.compose.ui
|
|
|
|
|
implementation libs.compose.ui.tooling
|
|
|
|
|
implementation libs.compose.material3
|
|
|
|
|
implementation libs.lifecycle.runtime.ktx
|
|
|
|
|
implementation libs.material
|
2022-02-03 10:06:44 -06:00
|
|
|
}
|
2023-09-04 23:08:43 +00:00
|
|
|
|
|
|
|
|
// This is uncommented in F-Droid build script
|
|
|
|
|
//f configurations.all {
|
|
|
|
|
//f exclude group: 'com.google.android.gms'
|
|
|
|
|
//f }
|