review fix
This commit is contained in:
parent
70819e7f41
commit
566ea7ad30
|
|
@ -19,3 +19,8 @@ local.properties
|
|||
*.iml
|
||||
|
||||
app/src/main/res/*/*strings.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
plugins {
|
||||
id(Plugins.ANDROID_APP_PLUGIN_WITH_DEFAULT_CONFIG)
|
||||
id(libs.plugins.android.application.get().pluginId)
|
||||
id(libs.plugins.kotlin.android.get().pluginId)
|
||||
id(libs.plugins.kotlin.kapt.get().pluginId)
|
||||
alias(libs.plugins.google.services)
|
||||
id(libs.plugins.android.app.get().pluginId)
|
||||
alias(libs.plugins.firebase.crashlytics)
|
||||
alias(libs.plugins.firebase.perf)
|
||||
id(libs.plugins.google.oss.licenses.plugin.get().pluginId)
|
||||
|
|
|
|||
|
|
@ -1,40 +0,0 @@
|
|||
{
|
||||
"project_info": {
|
||||
"project_number": "1084813714260",
|
||||
"firebase_url": "https://testproject-ac7fe.firebaseio.com",
|
||||
"project_id": "testproject-ac7fe",
|
||||
"storage_bucket": "testproject-ac7fe.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:1084813714260:android:b6d7bb18a0acfe96255ec1",
|
||||
"android_client_info": {
|
||||
"package_name": "ru.touchin.template"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "1084813714260-ijq13dkdc1h5i5j87t45tiibl8eg2v9e.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyBVsh_CN-RCfU3LkHuvhLdqVS-ZUJbOljE"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "1084813714260-ijq13dkdc1h5i5j87t45tiibl8eg2v9e.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
|
|
@ -8,9 +8,7 @@ buildscript {
|
|||
dependencies {
|
||||
classpath(libs.android.gradle.plugin)
|
||||
classpath(libs.kotlin.gradle.plugin)
|
||||
classpath(libs.google.oss.licenses.plugin) {
|
||||
exclude(group = "com.google.protobuf")
|
||||
}
|
||||
classpath(libs.google.oss.licenses.plugin)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import com.android.build.gradle.BaseExtension
|
|||
import org.gradle.api.Project
|
||||
import org.gradle.api.artifacts.VersionCatalog
|
||||
import org.gradle.kotlin.dsl.extra
|
||||
import versioncatalog.versionName
|
||||
|
||||
fun BaseExtension.addFlavors(dimensionName: String, vararg flavorNames: String) {
|
||||
if (flavorNames.isEmpty()) return
|
||||
|
|
@ -34,9 +35,9 @@ fun BaseExtension.addBuildType(
|
|||
isShrinkResources = type.optimizeAndObfuscate
|
||||
setMatchingFallbacks(type.matchingFallbacks)
|
||||
|
||||
// if (listOf(BuildType.Develop, BuildType.Debug).contains(type)) {
|
||||
// applicationIdSuffix = ".${type.name}"
|
||||
// }
|
||||
if (listOf(BuildType.Develop, BuildType.Debug).contains(type)) {
|
||||
applicationIdSuffix = ".${type.name}"
|
||||
}
|
||||
|
||||
if (type.optimizeAndObfuscate) {
|
||||
setProguardFiles(
|
||||
|
|
@ -65,6 +66,7 @@ fun BaseExtension.addLibBuildType(
|
|||
buildTypes {
|
||||
maybeCreate(type.name)
|
||||
getByName(type.name) {
|
||||
isDebuggable = !type.optimizeAndObfuscate
|
||||
isMinifyEnabled = type.optimizeAndObfuscate
|
||||
setMatchingFallbacks(type.matchingFallbacks)
|
||||
buildConfigField("String", "VERSION_NAME", "\"${versionCatalog.versionName}\"")
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
object Plugins {
|
||||
const val ANDROID_APPLICATION = "com.android.application"
|
||||
const val ANDROID_LIBRARY = "com.android.library"
|
||||
|
||||
const val ANDROID_APP_PLUGIN_WITH_DEFAULT_CONFIG = "android_app"
|
||||
const val ANDROID_LIB_PLUGIN_WITH_DEFAULT_CONFIG = "android_lib"
|
||||
|
||||
const val KOTLIN_ANDROID = "org.jetbrains.kotlin.android"
|
||||
const val KOTLIN_KAPT = "kotlin-kapt"
|
||||
}
|
||||
|
|
@ -1,15 +1,12 @@
|
|||
package plugins
|
||||
|
||||
import Plugins
|
||||
import versioncatalog.androidApplicationPlugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.artifacts.VersionCatalog
|
||||
import org.gradle.api.artifacts.VersionCatalogsExtension
|
||||
import org.gradle.kotlin.dsl.getByType
|
||||
|
||||
class AndroidAppPlugin : BaseAndroidPlugin() {
|
||||
|
||||
override fun apply(target: Project) {
|
||||
target.plugins.apply(Plugins.ANDROID_APPLICATION)
|
||||
target.plugins.apply(target.libs.androidApplicationPlugin)
|
||||
super.apply(target)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
package plugins
|
||||
|
||||
import Plugins
|
||||
import org.gradle.api.Project
|
||||
import versioncatalog.androidLibraryPlugin
|
||||
|
||||
class AndroidLibPlugin : BaseAndroidPlugin() {
|
||||
|
||||
override fun apply(target: Project) {
|
||||
target.plugins.apply(Plugins.ANDROID_LIBRARY)
|
||||
target.plugins.apply(target.libs.androidLibraryPlugin)
|
||||
super.apply(target)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
package plugins
|
||||
|
||||
import AndroidConfig
|
||||
import BuildType
|
||||
import Plugins
|
||||
import com.android.build.gradle.BaseExtension
|
||||
import jvmBytecode
|
||||
import versioncatalog.jvmBytecode
|
||||
import org.gradle.api.JavaVersion
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
|
|
@ -12,15 +9,16 @@ import org.gradle.api.artifacts.Dependency
|
|||
import org.gradle.api.artifacts.VersionCatalog
|
||||
import org.gradle.api.artifacts.VersionCatalogsExtension
|
||||
import org.gradle.api.artifacts.dsl.DependencyHandler
|
||||
import org.gradle.internal.impldep.junit.runner.Version.id
|
||||
import org.gradle.kotlin.dsl.dependencies
|
||||
import org.gradle.kotlin.dsl.getByType
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import sdkCompile
|
||||
import sdkMin
|
||||
import sdkTarget
|
||||
import versionCode
|
||||
import versionName
|
||||
import versioncatalog.compileSdk
|
||||
import versioncatalog.kotlinAndroidPlugin
|
||||
import versioncatalog.kotlinKaptPlugin
|
||||
import versioncatalog.minSdk
|
||||
import versioncatalog.targetSdk
|
||||
import versioncatalog.versionCode
|
||||
import versioncatalog.versionName
|
||||
|
||||
abstract class BaseAndroidPlugin : Plugin<Project> {
|
||||
override fun apply(target: Project) {
|
||||
|
|
@ -30,16 +28,16 @@ abstract class BaseAndroidPlugin : Plugin<Project> {
|
|||
}
|
||||
|
||||
private fun Project.configurePlugins() {
|
||||
plugins.apply(Plugins.KOTLIN_ANDROID)
|
||||
plugins.apply(Plugins.KOTLIN_KAPT)
|
||||
plugins.apply(libs.kotlinAndroidPlugin)
|
||||
plugins.apply(libs.kotlinKaptPlugin)
|
||||
}
|
||||
|
||||
private fun Project.configureAndroid() = extensions.getByType<BaseExtension>().run {
|
||||
compileSdkVersion(libs.sdkCompile.toInt())
|
||||
compileSdkVersion(libs.compileSdk.toInt())
|
||||
|
||||
defaultConfig {
|
||||
minSdk = libs.sdkMin.toInt()
|
||||
targetSdk = libs.sdkTarget.toInt()
|
||||
minSdk = libs.minSdk.toInt()
|
||||
targetSdk = libs.targetSdk.toInt()
|
||||
versionCode = libs.versionCode.toInt()
|
||||
versionName = libs.versionName
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import org.gradle.api.artifacts.MinimalExternalModuleDependency
|
||||
package versioncatalog
|
||||
|
||||
import org.gradle.api.artifacts.VersionCatalog
|
||||
import org.gradle.api.provider.Provider
|
||||
|
||||
private fun VersionCatalog.getLibrary(library: String) = findLibrary(library).get()
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package versioncatalog
|
||||
|
||||
import org.gradle.api.artifacts.VersionCatalog
|
||||
|
||||
val VersionCatalog.androidApplicationPlugin: String
|
||||
get() = findPlugin("android-application").get().orNull?.pluginId.toString()
|
||||
|
||||
val VersionCatalog.androidLibraryPlugin: String
|
||||
get() = findPlugin("android-library").get().orNull?.pluginId.toString()
|
||||
|
||||
val VersionCatalog.kotlinAndroidPlugin: String
|
||||
get() = findPlugin("kotlin-android").get().orNull?.pluginId.toString()
|
||||
|
||||
val VersionCatalog.kotlinKaptPlugin: String
|
||||
get() = findPlugin("kotlin-kapt").get().orNull?.pluginId.toString()
|
||||
|
|
@ -1,12 +1,14 @@
|
|||
package versioncatalog
|
||||
|
||||
import org.gradle.api.artifacts.VersionCatalog
|
||||
|
||||
val VersionCatalog.sdkCompile: String
|
||||
val VersionCatalog.compileSdk: String
|
||||
get() = findVersion("compileSdk").get().requiredVersion
|
||||
|
||||
val VersionCatalog.sdkMin: String
|
||||
val VersionCatalog.minSdk: String
|
||||
get() = findVersion("minSdk").get().requiredVersion
|
||||
|
||||
val VersionCatalog.sdkTarget: String
|
||||
val VersionCatalog.targetSdk: String
|
||||
get() = findVersion("targetSdk").get().requiredVersion
|
||||
|
||||
val VersionCatalog.jvmBytecode: String
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
plugins {
|
||||
id(Plugins.ANDROID_LIB_PLUGIN_WITH_DEFAULT_CONFIG)
|
||||
id(libs.plugins.android.lib.get().pluginId)
|
||||
}
|
||||
|
||||
private val serverType = Environment.SERVER_ENVIRONMENT.getenv()?.takeIf(String::isNotBlank)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
plugins {
|
||||
id(Plugins.ANDROID_LIB_PLUGIN_WITH_DEFAULT_CONFIG)
|
||||
id(libs.plugins.android.lib.get().pluginId)
|
||||
}
|
||||
|
||||
private val versionCatalog: VersionCatalog
|
||||
|
|
|
|||
|
|
@ -167,6 +167,9 @@ google-oss-licenses-plugin = { id = "com.google.android.gms.oss-licenses-plugin"
|
|||
firebase-crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "firebaseCrashlytics" }
|
||||
firebase-perf = { id = "com.google.firebase.firebase-perf", version.ref = "firebasePerf" }
|
||||
|
||||
android-app = { id = "android_app" }
|
||||
android-lib = { id = "android_lib" }
|
||||
|
||||
[bundles]
|
||||
|
||||
androidX = ["androidx-compat", "androidx-constraint", "androidx-core", "androidx-recycler"]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
plugins {
|
||||
id(Plugins.ANDROID_LIB_PLUGIN_WITH_DEFAULT_CONFIG)
|
||||
id(libs.plugins.android.lib.get().pluginId)
|
||||
}
|
||||
|
||||
private val versionCatalog: VersionCatalog
|
||||
|
|
|
|||
Loading…
Reference in New Issue