add gitlab ci

This commit is contained in:
m
2026-09-16 14:47:10 +02:00
parent 906d48702c
commit cd4f0179fc
32 changed files with 1462 additions and 40 deletions
+30 -2
View File
@@ -8,6 +8,21 @@ plugins {
alias(libs.plugins.hilt)
}
// Source unique de vérité : VERSION à la racine du dépôt (ex. 0.1.0).
val vaultVersion: String = rootProject.file("../VERSION").readText().trim()
val vaultVersionCode: Int = run {
val parts = vaultVersion.split('.').map { it.toInt() }
check(parts.size == 3) { "VERSION doit être major.minor.patch, reçu: $vaultVersion" }
parts[0] * 1_000_000 + parts[1] * 1_000 + parts[2]
}
// Signature release : signing.properties (gitignoré) en local, variables
// d'env (SIGNING_*) en CI. Jamais de keystore commité.
val signingProps = Properties().apply {
val f = file("signing.properties")
if (f.exists()) f.inputStream().use { load(it) }
}
android {
namespace = "com.vaultdrop.mobile"
compileSdk = 35
@@ -19,8 +34,8 @@ android {
// OpenCV/CameraX sont en 4K (warning de compatibilité sur devices
// 16K-pages). On reste en 34 tant qu'elles ne sont pas mises à jour.
targetSdk = 34
versionCode = 1
versionName = "0.1.0"
versionCode = vaultVersionCode
versionName = vaultVersion
// OpenCV natif : on conserve uniquement les ABIs ciblés
// (arm64 = devices, x86_64 = émulateur) pour garder l'APK raisonnable.
@@ -29,6 +44,18 @@ android {
}
}
signingConfigs {
create("release") {
val storePath = signingProps.getProperty("storeFile") ?: System.getenv("SIGNING_STORE_FILE")
if (storePath != null) {
storeFile = file(storePath)
storePassword = signingProps.getProperty("storePassword") ?: System.getenv("SIGNING_STORE_PASSWORD")
keyAlias = signingProps.getProperty("keyAlias") ?: System.getenv("SIGNING_KEY_ALIAS")
keyPassword = signingProps.getProperty("keyPassword") ?: System.getenv("SIGNING_KEY_PASSWORD")
}
}
}
buildTypes {
release {
isMinifyEnabled = false
@@ -36,6 +63,7 @@ android {
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
signingConfig = signingConfigs.getByName("release")
}
}
compileOptions {