mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Added even more tweaks to convention plugins setup
This commit is contained in:
1 parent
e2bf2a09a4
commit
8c1df334d8
18 files changed
+138
-167
No files matched your search
@@ -1,3 +1,3 @@
|
||||
plugins {
|
||||
alias(libs.plugins.convention.androidAppPlugin)
|
||||
alias(libs.plugins.convention.applicationPlugin)
|
||||
}
|
||||
@@ -24,25 +24,25 @@ group = "com.rtbishop.look4sat.build_logic.convention"
|
||||
|
||||
gradlePlugin {
|
||||
plugins {
|
||||
register("androidAppPlugin") {
|
||||
id = libs.plugins.convention.androidAppPlugin.get().pluginId
|
||||
implementationClass = "com.rtbishop.look4sat.convention.AndroidAppPlugin"
|
||||
register("applicationPlugin") {
|
||||
id = libs.plugins.convention.applicationPlugin.get().pluginId
|
||||
implementationClass = "com.rtbishop.look4sat.convention.ApplicationPlugin"
|
||||
}
|
||||
register("androidLibraryPlugin") {
|
||||
id = libs.plugins.convention.androidLibraryPlugin.get().pluginId
|
||||
implementationClass = "com.rtbishop.look4sat.convention.AndroidLibraryPlugin"
|
||||
register("coreDataPlugin") {
|
||||
id = libs.plugins.convention.coreDataPlugin.get().pluginId
|
||||
implementationClass = "com.rtbishop.look4sat.convention.CoreDataPlugin"
|
||||
}
|
||||
register("composeFeaturePlugin") {
|
||||
id = libs.plugins.convention.composeFeaturePlugin.get().pluginId
|
||||
implementationClass = "com.rtbishop.look4sat.convention.ComposeFeaturePlugin"
|
||||
register("coreDomainPlugin") {
|
||||
id = libs.plugins.convention.coreDomainPlugin.get().pluginId
|
||||
implementationClass = "com.rtbishop.look4sat.convention.CoreDomainPlugin"
|
||||
}
|
||||
register("composeLibraryPlugin") {
|
||||
id = libs.plugins.convention.composeLibraryPlugin.get().pluginId
|
||||
implementationClass = "com.rtbishop.look4sat.convention.ComposeLibraryPlugin"
|
||||
register("corePresentationPlugin") {
|
||||
id = libs.plugins.convention.corePresentationPlugin.get().pluginId
|
||||
implementationClass = "com.rtbishop.look4sat.convention.CorePresentationPlugin"
|
||||
}
|
||||
register("kotlinLibraryPlugin") {
|
||||
id = libs.plugins.convention.kotlinLibraryPlugin.get().pluginId
|
||||
implementationClass = "com.rtbishop.look4sat.convention.KotlinLibraryPlugin"
|
||||
register("featurePlugin") {
|
||||
id = libs.plugins.convention.featurePlugin.get().pluginId
|
||||
implementationClass = "com.rtbishop.look4sat.convention.FeaturePlugin"
|
||||
}
|
||||
}
|
||||
}
|
||||
-46
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Look4Sat. Amateur radio satellite tracker and pass predictor.
|
||||
* Copyright (C) 2019-2026 Arty Bishop and contributors.
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.convention
|
||||
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.dependencies
|
||||
|
||||
@Suppress("Unused")
|
||||
internal class AndroidAppPlugin : Plugin<Project> {
|
||||
override fun apply(target: Project) {
|
||||
with(target) {
|
||||
setupAndroidApplication()
|
||||
setupComposeFeature()
|
||||
setupKotlinToolchain()
|
||||
setupAndroidTestDependencies()
|
||||
setupTestDependencies()
|
||||
dependencies {
|
||||
IMPLEMENTATION(project(":core:data"))
|
||||
IMPLEMENTATION(project(":core:domain"))
|
||||
IMPLEMENTATION(project(":core:presentation"))
|
||||
IMPLEMENTATION(project(":feature:map"))
|
||||
IMPLEMENTATION(project(":feature:passes"))
|
||||
IMPLEMENTATION(project(":feature:radar"))
|
||||
IMPLEMENTATION(project(":feature:satellites"))
|
||||
IMPLEMENTATION(project(":feature:settings"))
|
||||
IMPLEMENTATION(libs.androidx.core.splashscreen)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
-18
@@ -22,25 +22,22 @@ import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.dependencies
|
||||
|
||||
@Suppress("Unused")
|
||||
internal class AndroidLibraryPlugin : Plugin<Project> {
|
||||
override fun apply(target: Project) {
|
||||
with(target) {
|
||||
with(pluginManager) {
|
||||
alias(libs.plugins.google.ksp)
|
||||
}
|
||||
setupCommonLibrary()
|
||||
setupKotlinToolchain()
|
||||
setupAndroidTestDependencies()
|
||||
setupTestDependencies()
|
||||
internal class ApplicationPlugin : Plugin<Project> {
|
||||
override fun apply(target: Project) = with(target) {
|
||||
setupAndroidApp()
|
||||
setupCompose()
|
||||
setupKotlin()
|
||||
dependencies {
|
||||
IMPLEMENTATION(project(":core:domain"))
|
||||
IMPLEMENTATION(libs.androidx.core.ktx)
|
||||
IMPLEMENTATION(libs.androidx.room.asProvider())
|
||||
IMPLEMENTATION(libs.androidx.room.runtime)
|
||||
KSP(libs.androidx.room.compiler)
|
||||
IMPLEMENTATION(libs.other.coroutines)
|
||||
IMPLEMENTATION(libs.other.okhttp)
|
||||
}
|
||||
implementation(project(":core:data"))
|
||||
implementation(project(":core:domain"))
|
||||
implementation(project(":core:presentation"))
|
||||
implementation(project(":feature:map"))
|
||||
implementation(project(":feature:passes"))
|
||||
implementation(project(":feature:radar"))
|
||||
implementation(project(":feature:satellites"))
|
||||
implementation(project(":feature:settings"))
|
||||
implementation(libs.androidx.core.splashscreen)
|
||||
androidTestImplementation(libs.bundles.androidTest)
|
||||
}
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Look4Sat. Amateur radio satellite tracker and pass predictor.
|
||||
* Copyright (C) 2019-2026 Arty Bishop and contributors.
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
package com.rtbishop.look4sat.convention
|
||||
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.dependencies
|
||||
|
||||
@Suppress("Unused")
|
||||
internal class CoreDataPlugin : Plugin<Project> {
|
||||
override fun apply(target: Project) = with(target) {
|
||||
applyPlugin(libs.plugins.google.ksp)
|
||||
setupAndroidLib()
|
||||
setupKotlin()
|
||||
dependencies {
|
||||
implementation(project(":core:domain"))
|
||||
implementation(libs.androidx.core.ktx)
|
||||
implementation(libs.androidx.room)
|
||||
implementation(libs.androidx.room.runtime)
|
||||
ksp(libs.androidx.room.compiler)
|
||||
implementation(libs.other.coroutines)
|
||||
implementation(libs.other.okhttp)
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-11
@@ -22,18 +22,13 @@ import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.dependencies
|
||||
|
||||
@Suppress("Unused")
|
||||
internal class KotlinLibraryPlugin : Plugin<Project> {
|
||||
override fun apply(target: Project) {
|
||||
with(target) {
|
||||
with(pluginManager) {
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
}
|
||||
setupKotlinToolchain()
|
||||
setupTestDependencies()
|
||||
internal class CoreDomainPlugin : Plugin<Project> {
|
||||
override fun apply(target: Project) = with(target) {
|
||||
applyPlugin(libs.plugins.kotlin.jvm)
|
||||
setupKotlin()
|
||||
dependencies {
|
||||
IMPLEMENTATION(libs.other.coroutines)
|
||||
IMPLEMENTATION(libs.other.json)
|
||||
}
|
||||
implementation(libs.other.coroutines)
|
||||
implementation(libs.other.json)
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
-11
@@ -22,18 +22,14 @@ import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.dependencies
|
||||
|
||||
@Suppress("Unused")
|
||||
internal class ComposeFeaturePlugin : Plugin<Project> {
|
||||
override fun apply(target: Project) {
|
||||
with(target) {
|
||||
setupCommonLibrary()
|
||||
setupComposeFeature()
|
||||
setupKotlinToolchain()
|
||||
setupAndroidTestDependencies()
|
||||
setupTestDependencies()
|
||||
internal class CorePresentationPlugin : Plugin<Project> {
|
||||
override fun apply(target: Project) = with(target) {
|
||||
setupAndroidLib()
|
||||
setupCompose()
|
||||
setupKotlin()
|
||||
dependencies {
|
||||
IMPLEMENTATION(project(":core:domain"))
|
||||
IMPLEMENTATION(project(":core:presentation"))
|
||||
}
|
||||
implementation(project(":core:domain"))
|
||||
implementation(libs.androidx.core.splashscreen)
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
-11
@@ -22,18 +22,14 @@ import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.dependencies
|
||||
|
||||
@Suppress("Unused")
|
||||
internal class ComposeLibraryPlugin : Plugin<Project> {
|
||||
override fun apply(target: Project) {
|
||||
with(target) {
|
||||
setupCommonLibrary()
|
||||
setupComposeFeature()
|
||||
setupKotlinToolchain()
|
||||
setupAndroidTestDependencies()
|
||||
setupTestDependencies()
|
||||
internal class FeaturePlugin : Plugin<Project> {
|
||||
override fun apply(target: Project) = with(target) {
|
||||
setupAndroidLib()
|
||||
setupCompose()
|
||||
setupKotlin()
|
||||
dependencies {
|
||||
IMPLEMENTATION(project(":core:domain"))
|
||||
IMPLEMENTATION(libs.androidx.core.splashscreen)
|
||||
}
|
||||
implementation(project(":core:domain"))
|
||||
implementation(project(":core:presentation"))
|
||||
}
|
||||
}
|
||||
}
|
||||
+32
-39
@@ -21,7 +21,7 @@ import com.android.build.api.dsl.ApplicationExtension
|
||||
import com.android.build.api.dsl.CommonExtension
|
||||
import org.gradle.accessors.dm.LibrariesForLibs
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.plugins.PluginManager
|
||||
import org.gradle.api.artifacts.dsl.DependencyHandler
|
||||
import org.gradle.api.provider.Provider
|
||||
import org.gradle.kotlin.dsl.accessors.runtime.extensionOf
|
||||
import org.gradle.kotlin.dsl.configure
|
||||
@@ -29,23 +29,30 @@ import org.gradle.kotlin.dsl.dependencies
|
||||
import org.gradle.plugin.use.PluginDependency
|
||||
import org.jetbrains.kotlin.gradle.dsl.kotlinExtension
|
||||
|
||||
internal const val ANDROID_TEST_IMPLEMENTATION = "androidTestImplementation"
|
||||
internal const val DEBUG_IMPLEMENTATION = "debugImplementation"
|
||||
internal const val IMPLEMENTATION = "implementation"
|
||||
internal const val KSP = "ksp"
|
||||
internal const val TEST_IMPLEMENTATION = "testImplementation"
|
||||
|
||||
internal val Project.libs
|
||||
get(): LibrariesForLibs = extensionOf(this, "libs") as LibrariesForLibs
|
||||
|
||||
internal fun PluginManager.alias(notation: Provider<PluginDependency>) {
|
||||
apply(notation.get().pluginId)
|
||||
internal fun Project.applyPlugin(notation: Provider<PluginDependency>) {
|
||||
pluginManager.apply(notation.get().pluginId)
|
||||
}
|
||||
|
||||
internal fun Project.setupAndroidApplication() {
|
||||
with(pluginManager) {
|
||||
alias(libs.plugins.android.application)
|
||||
}
|
||||
internal fun DependencyHandler.implementation(dependencyNotation: Any) =
|
||||
add("implementation", dependencyNotation)
|
||||
|
||||
internal fun DependencyHandler.debugImplementation(dependencyNotation: Any) =
|
||||
add("debugImplementation", dependencyNotation)
|
||||
|
||||
internal fun DependencyHandler.testImplementation(dependencyNotation: Any) =
|
||||
add("testImplementation", dependencyNotation)
|
||||
|
||||
internal fun DependencyHandler.androidTestImplementation(dependencyNotation: Any) =
|
||||
add("androidTestImplementation", dependencyNotation)
|
||||
|
||||
internal fun DependencyHandler.ksp(dependencyNotation: Any) =
|
||||
add("ksp", dependencyNotation)
|
||||
|
||||
internal fun Project.setupAndroidApp() {
|
||||
applyPlugin(libs.plugins.android.application)
|
||||
extensions.configure<ApplicationExtension> {
|
||||
namespace = libs.versions.packageName.get()
|
||||
compileSdk = libs.versions.compileSdk.get().toInt()
|
||||
@@ -55,9 +62,6 @@ internal fun Project.setupAndroidApplication() {
|
||||
versionCode = libs.versions.appVersionCode.get().toInt()
|
||||
versionName = libs.versions.appVersionName.get()
|
||||
}
|
||||
buildFeatures {
|
||||
compose = true
|
||||
}
|
||||
buildTypes {
|
||||
debug {
|
||||
applicationIdSuffix = ".debug"
|
||||
@@ -76,43 +80,32 @@ internal fun Project.setupAndroidApplication() {
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Project.setupCommonLibrary() {
|
||||
with(pluginManager) {
|
||||
alias(libs.plugins.android.library)
|
||||
}
|
||||
internal fun Project.setupAndroidLib() {
|
||||
applyPlugin(libs.plugins.android.library)
|
||||
extensions.configure<CommonExtension> {
|
||||
compileSdk = libs.versions.compileSdk.get().toInt()
|
||||
defaultConfig.minSdk = libs.versions.minSdk.get().toInt()
|
||||
}
|
||||
dependencies {
|
||||
androidTestImplementation(libs.bundles.androidTest)
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Project.setupComposeFeature() {
|
||||
with(pluginManager) {
|
||||
alias(libs.plugins.compose.compiler)
|
||||
}
|
||||
internal fun Project.setupCompose() {
|
||||
applyPlugin(libs.plugins.compose.compiler)
|
||||
extensions.configure<CommonExtension> {
|
||||
buildFeatures.compose = true
|
||||
}
|
||||
dependencies {
|
||||
IMPLEMENTATION(platform(libs.compose.bom))
|
||||
IMPLEMENTATION(libs.bundles.composeAll)
|
||||
DEBUG_IMPLEMENTATION(libs.bundles.composeDebug)
|
||||
implementation(platform(libs.compose.bom))
|
||||
implementation(libs.bundles.composeAll)
|
||||
debugImplementation(libs.bundles.composeDebug)
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Project.setupKotlinToolchain() {
|
||||
internal fun Project.setupKotlin() {
|
||||
kotlinExtension.jvmToolchain(libs.versions.jdkVersion.get().toInt())
|
||||
}
|
||||
|
||||
internal fun Project.setupAndroidTestDependencies() {
|
||||
dependencies {
|
||||
ANDROID_TEST_IMPLEMENTATION(libs.bundles.androidTest)
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Project.setupTestDependencies() {
|
||||
dependencies {
|
||||
TEST_IMPLEMENTATION(libs.test.coroutines)
|
||||
TEST_IMPLEMENTATION(libs.test.junit4)
|
||||
testImplementation(libs.bundles.unitTest)
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
alias(libs.plugins.convention.androidLibraryPlugin)
|
||||
alias(libs.plugins.convention.coreDataPlugin)
|
||||
}
|
||||
|
||||
android {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
plugins {
|
||||
alias(libs.plugins.convention.kotlinLibraryPlugin)
|
||||
alias(libs.plugins.convention.coreDomainPlugin)
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
alias(libs.plugins.convention.composeLibraryPlugin)
|
||||
alias(libs.plugins.convention.corePresentationPlugin)
|
||||
}
|
||||
|
||||
android {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
alias(libs.plugins.convention.composeFeaturePlugin)
|
||||
alias(libs.plugins.convention.featurePlugin)
|
||||
}
|
||||
|
||||
android {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
alias(libs.plugins.convention.composeFeaturePlugin)
|
||||
alias(libs.plugins.convention.featurePlugin)
|
||||
}
|
||||
|
||||
android {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
alias(libs.plugins.convention.composeFeaturePlugin)
|
||||
alias(libs.plugins.convention.featurePlugin)
|
||||
}
|
||||
|
||||
android {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
alias(libs.plugins.convention.composeFeaturePlugin)
|
||||
alias(libs.plugins.convention.featurePlugin)
|
||||
}
|
||||
|
||||
android {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
alias(libs.plugins.convention.composeFeaturePlugin)
|
||||
alias(libs.plugins.convention.featurePlugin)
|
||||
}
|
||||
|
||||
android {
|
||||
|
||||
@@ -12,7 +12,7 @@ jdkVersion = "17"
|
||||
#noinspection UnusedVersionCatalogEntry
|
||||
packageName = "com.rtbishop.look4sat"
|
||||
|
||||
android-gradle-plugin = "9.0.1"
|
||||
android-gradle-plugin = "9.1.0"
|
||||
google-ksp = "2.3.6"
|
||||
kotlin = "2.3.20"
|
||||
|
||||
@@ -20,7 +20,7 @@ androidx-core-ktx = "1.18.0"
|
||||
androidx-core-splashscreen = "1.2.0"
|
||||
androidx-room = "2.8.4"
|
||||
|
||||
compose-bom = "2026.03.00"
|
||||
compose-bom = "2026.03.01"
|
||||
compose-activity = "1.13.0"
|
||||
compose-lifecycle = "2.10.0"
|
||||
compose-navigation = "2.9.7"
|
||||
@@ -88,11 +88,11 @@ compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "
|
||||
google-ksp = { id = "com.google.devtools.ksp", version.ref = "google-ksp" }
|
||||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||
# plugins defined by this project
|
||||
convention-androidAppPlugin = { id = "com.rtbishop.look4sat.convention.androidAppPlugin" }
|
||||
convention-androidLibraryPlugin = { id = "com.rtbishop.look4sat.convention.androidLibraryPlugin" }
|
||||
convention-composeFeaturePlugin = { id = "com.rtbishop.look4sat.convention.composeFeaturePlugin" }
|
||||
convention-composeLibraryPlugin = { id = "com.rtbishop.look4sat.convention.composeLibraryPlugin" }
|
||||
convention-kotlinLibraryPlugin = { id = "com.rtbishop.look4sat.convention.kotlinLibraryPlugin" }
|
||||
convention-applicationPlugin = { id = "com.rtbishop.look4sat.convention.applicationPlugin" }
|
||||
convention-coreDataPlugin = { id = "com.rtbishop.look4sat.convention.coreDataPlugin" }
|
||||
convention-coreDomainPlugin = { id = "com.rtbishop.look4sat.convention.coreDomainPlugin" }
|
||||
convention-corePresentationPlugin = { id = "com.rtbishop.look4sat.convention.corePresentationPlugin" }
|
||||
convention-featurePlugin = { id = "com.rtbishop.look4sat.convention.featurePlugin" }
|
||||
|
||||
[bundles]
|
||||
#noinspection UnusedVersionCatalogEntry
|
||||
|
||||
Reference in new issue
Block a user