kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
refactor(build): update Spotless config (#2516)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>pull/2517/head
rodzic
35f5779483
commit
c61d31c3b8
|
@ -118,18 +118,8 @@ android {
|
||||||
create("google") {
|
create("google") {
|
||||||
dimension = "default"
|
dimension = "default"
|
||||||
// Enable Firebase Crashlytics for Google Play builds
|
// Enable Firebase Crashlytics for Google Play builds
|
||||||
apply(
|
apply(plugin = libs.plugins.google.services.get().pluginId)
|
||||||
plugin =
|
apply(plugin = libs.plugins.firebase.crashlytics.get().pluginId)
|
||||||
libs.plugins.google.services
|
|
||||||
.get()
|
|
||||||
.pluginId,
|
|
||||||
)
|
|
||||||
apply(
|
|
||||||
plugin =
|
|
||||||
libs.plugins.firebase.crashlytics
|
|
||||||
.get()
|
|
||||||
.pluginId,
|
|
||||||
)
|
|
||||||
versionName = "${Configs.VERSION_NAME_BASE} ($versionCode) google"
|
versionName = "${Configs.VERSION_NAME_BASE} ($versionCode) google"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -140,10 +130,7 @@ android {
|
||||||
}
|
}
|
||||||
isMinifyEnabled = true
|
isMinifyEnabled = true
|
||||||
isShrinkResources = true
|
isShrinkResources = true
|
||||||
proguardFiles(
|
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
||||||
"proguard-rules.pro",
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
named("debug") { isPseudoLocalesEnabled = true }
|
named("debug") { isPseudoLocalesEnabled = true }
|
||||||
}
|
}
|
||||||
|
@ -178,12 +165,7 @@ kotlin {
|
||||||
|
|
||||||
// per protobuf-gradle-plugin docs, this is recommended for android
|
// per protobuf-gradle-plugin docs, this is recommended for android
|
||||||
protobuf {
|
protobuf {
|
||||||
protoc {
|
protoc { artifact = libs.protobuf.protoc.get().toString() }
|
||||||
artifact =
|
|
||||||
libs.protobuf.protoc
|
|
||||||
.get()
|
|
||||||
.toString()
|
|
||||||
}
|
|
||||||
generateProtoTasks {
|
generateProtoTasks {
|
||||||
all().forEach { task ->
|
all().forEach { task ->
|
||||||
task.builtins {
|
task.builtins {
|
||||||
|
@ -282,8 +264,8 @@ detekt {
|
||||||
val googleServiceKeywords = listOf("crashlytics", "google")
|
val googleServiceKeywords = listOf("crashlytics", "google")
|
||||||
|
|
||||||
tasks.configureEach {
|
tasks.configureEach {
|
||||||
if (googleServiceKeywords.any { name.contains(it, ignoreCase = true) } &&
|
if (
|
||||||
name.contains("fdroid", ignoreCase = true)
|
googleServiceKeywords.any { name.contains(it, ignoreCase = true) } && name.contains("fdroid", ignoreCase = true)
|
||||||
) {
|
) {
|
||||||
project.logger.lifecycle("Disabling task for F-Droid: $name")
|
project.logger.lifecycle("Disabling task for F-Droid: $name")
|
||||||
enabled = false
|
enabled = false
|
||||||
|
@ -295,13 +277,13 @@ spotless {
|
||||||
kotlin {
|
kotlin {
|
||||||
target("src/*/kotlin/**/*.kt", "src/*/java/**/*.kt")
|
target("src/*/kotlin/**/*.kt", "src/*/java/**/*.kt")
|
||||||
targetExclude("**/build/**/*.kt")
|
targetExclude("**/build/**/*.kt")
|
||||||
ktfmt()
|
ktfmt().kotlinlangStyle().configure { it.setMaxWidth(120) }
|
||||||
ktlint("1.7.1").setEditorConfigPath("../config/spotless/.editorconfig")
|
ktlint("1.7.1").setEditorConfigPath("../config/spotless/.editorconfig")
|
||||||
licenseHeaderFile(rootProject.file("config/spotless/copyright.txt"))
|
licenseHeaderFile(rootProject.file("config/spotless/copyright.txt"))
|
||||||
}
|
}
|
||||||
kotlinGradle {
|
kotlinGradle {
|
||||||
target("**/*.gradle.kts")
|
target("**/*.gradle.kts")
|
||||||
ktfmt()
|
ktfmt().kotlinlangStyle().configure { it.setMaxWidth(120) }
|
||||||
ktlint("1.7.1").setEditorConfigPath("../config/spotless/.editorconfig")
|
ktlint("1.7.1").setEditorConfigPath("../config/spotless/.editorconfig")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,9 @@
|
||||||
[*.{kt,kts}]
|
|
||||||
ktlint_code_style = ktlint_official
|
|
||||||
ktlint_standard = enabled
|
|
||||||
ktlint_experimental = enabled
|
|
||||||
ktlint_custom_rule-set = enabled
|
|
||||||
ktlint_function_naming_ignore_when_annotated_with = Composable
|
|
||||||
|
|
||||||
root = true
|
root = true
|
||||||
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
|
|
||||||
ij_kotlin_name_count_to_use_star_import = 2147483647
|
|
||||||
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
|
|
||||||
ij_kotlin_packages_to_use_import_on_demand = unset
|
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
max_line_length=120
|
||||||
|
|
||||||
|
[*.{kt,kts}]
|
||||||
|
ktlint_code_style = intellij_idea
|
||||||
|
ktlint_function_naming_ignore_when_annotated_with = Composable
|
||||||
|
|
Ładowanie…
Reference in New Issue