Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions build-logic/application/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
plugins {
`kotlin-dsl`
}

dependencies {
compileOnly(core.gradle.build.tools)
}

gradlePlugin {
plugins {
register("infomaniakApplication") {
id = "com.infomaniak.core.application"
implementationClass = "com.infomaniak.core.application.InfomaniakApplicationPlugin"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Infomaniak Core - Android
* Copyright (C) 2025 Infomaniak Network SA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.infomaniak.core.application

import com.android.build.api.dsl.CommonExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import java.io.File

/**
* Configures the shared debug signing certificate for Android application modules.
*/
class InfomaniakApplicationPlugin : Plugin<Project> {

override fun apply(target: Project) {
val keystoreFile = listOf(
target.rootProject.file("debug.keystore"),
target.rootProject.file("Core/config/debug.keystore"),
target.rootProject.file("config/debug.keystore"),
).firstOrNull(File::exists)

requireNotNull(keystoreFile) {
"Shared debug keystore not found. Expected it under <rootProject>/debug.keystore or Core/config/debug.keystore."
}

target.rootProject.allprojects {
plugins.withId("com.android.application") {
extensions.configure<CommonExtension<*, *, *, *, *, *>> ("android") {
signingConfigs {
getByName("debug") {
storeFile = keystoreFile
}
}
}
}
}
}
}
1 change: 1 addition & 0 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ rootProject.name = "build-logic"
include(
":composite",
":composeLint",
":application",
)
Binary file added config/debug.keystore
Binary file not shown.
1 change: 1 addition & 0 deletions gradle/core.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ android-library = { id = "com.android.library", version.ref = "agp" }
android-kmp-library = { id = "com.android.kotlin.multiplatform.library", version.ref = "agp" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
compose-lint = { id = "com.infomaniak.core.compose.lint" }
infomaniak-application = { id = "com.infomaniak.core.application" }
dagger-hilt = { id = "com.google.dagger.hilt.android", version.ref = "hiltAndroid" }
google-services = { id = "com.google.gms.google-services", version.ref = "googleServices" }
kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
Expand Down
Loading