refactor(build): Introduce AndroidLibraryFlavors convention plugin (#4449)

This commit is contained in:
James Rich 2026-02-04 16:01:09 -06:00 committed by GitHub
parent 854eff685e
commit 3eefa801d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 60 additions and 79 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2025 Meshtastic LLC
* Copyright (c) 2025-2026 Meshtastic LLC
*
* 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
@ -16,24 +16,9 @@
*/
import com.android.build.api.dsl.LibraryExtension
/*
* Copyright (c) 2025 Meshtastic LLC
*
* 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 <https://www.gnu.org/licenses/>.
*/
plugins {
alias(libs.plugins.meshtastic.android.library)
alias(libs.plugins.meshtastic.android.library.flavors)
alias(libs.plugins.meshtastic.android.library.compose)
alias(libs.plugins.meshtastic.hilt)
alias(libs.plugins.secrets)

View file

@ -30,15 +30,15 @@ configure<com.android.build.api.dsl.LibraryExtension> {
minSdk = 21
}
publishing { singleVariant("googleRelease") { withSourcesJar() } }
publishing { singleVariant("release") { withSourcesJar() } }
}
// Map the Android component to a Maven publication
afterEvaluate {
publishing {
publications {
create<MavenPublication>("googleRelease") {
from(components["googleRelease"])
create<MavenPublication>("release") {
from(components["release"])
artifactId = "core-api"
}
}

View file

@ -18,6 +18,7 @@ import com.android.build.api.dsl.LibraryExtension
plugins {
alias(libs.plugins.meshtastic.android.library)
alias(libs.plugins.meshtastic.android.library.flavors)
alias(libs.plugins.meshtastic.hilt)
alias(libs.plugins.meshtastic.kotlinx.serialization)
}

View file

@ -39,14 +39,14 @@ configure<LibraryExtension> {
testOptions { unitTests { isIncludeAndroidResources = true } }
publishing { singleVariant("googleRelease") { withSourcesJar() } }
publishing { singleVariant("release") { withSourcesJar() } }
}
afterEvaluate {
publishing {
publications {
create<MavenPublication>("googleRelease") {
from(components["googleRelease"])
create<MavenPublication>("release") {
from(components["release"])
artifactId = "core-model"
}
}

View file

@ -16,25 +16,9 @@
*/
import com.android.build.api.dsl.LibraryExtension
/*
* Copyright (c) 2025 Meshtastic LLC
*
* 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 <https://www.gnu.org/licenses/>.
*/
plugins {
alias(libs.plugins.meshtastic.android.library)
alias(libs.plugins.meshtastic.android.library.flavors)
alias(libs.plugins.meshtastic.hilt)
alias(libs.plugins.kotlin.serialization)
}

View file

@ -16,25 +16,9 @@
*/
import com.android.build.api.dsl.LibraryExtension
/*
* Copyright (c) 2025 Meshtastic LLC
*
* 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 <https://www.gnu.org/licenses/>.
*/
plugins {
alias(libs.plugins.meshtastic.android.library)
alias(libs.plugins.meshtastic.android.library.flavors)
alias(libs.plugins.meshtastic.hilt)
}