|
1 | 1 | package com.threegap.bitnagil.convention |
2 | 2 |
|
3 | 3 | import com.android.build.api.dsl.ApplicationExtension |
| 4 | +import com.threegap.bitnagil.convention.extension.basePackage |
4 | 5 | import com.threegap.bitnagil.convention.extension.configureAppVersion |
5 | | -import com.threegap.bitnagil.convention.extension.configureApplicationId |
6 | 6 | import com.threegap.bitnagil.convention.extension.configureComposeAndroid |
7 | 7 | import com.threegap.bitnagil.convention.extension.configureKotlinAndroid |
| 8 | +import com.threegap.bitnagil.convention.extension.libs |
8 | 9 | import org.gradle.api.Plugin |
9 | 10 | import org.gradle.api.Project |
10 | | -import org.gradle.api.artifacts.VersionCatalogsExtension |
11 | | -import org.gradle.kotlin.dsl.getByType |
12 | 11 | import org.gradle.kotlin.dsl.configure |
13 | 12 |
|
14 | 13 | class AndroidApplicationPlugin : Plugin<Project> { |
15 | 14 | override fun apply(target: Project): Unit = with(target) { |
16 | 15 | pluginManager.apply { |
17 | 16 | apply("com.android.application") |
18 | | - apply("org.jetbrains.kotlin.android") |
19 | 17 | apply("org.jetbrains.kotlin.plugin.compose") |
| 18 | + apply("org.jlleitschuh.gradle.ktlint") |
20 | 19 | } |
21 | 20 |
|
22 | | - val libs = extensions.getByType<VersionCatalogsExtension>().named("libs") |
23 | 21 | extensions.configure<ApplicationExtension> { |
24 | 22 | configureKotlinAndroid(this) |
25 | 23 | configureComposeAndroid(this) |
26 | | - configureAppVersion() |
27 | | - configureApplicationId() |
| 24 | + configureAppVersion(this) |
28 | 25 | with(defaultConfig) { |
| 26 | + applicationId = basePackage |
29 | 27 | targetSdk = libs.findVersion("targetSdk").get().requiredVersion.toInt() |
30 | | - versionCode = libs.findVersion("versionCode").get().requiredVersion.toInt() |
31 | 28 | } |
32 | 29 | } |
33 | 30 | } |
|
0 commit comments