feat(build): add androidx.lint checks to build-logic
This commit is contained in:
parent
9298fa9ea0
commit
9a6d7d267a
|
@ -4,7 +4,10 @@
|
|||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
plugins { `kotlin-dsl` }
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
alias(libs.plugins.android.lint)
|
||||
}
|
||||
|
||||
kotlin.jvmToolchain(17)
|
||||
|
||||
|
@ -61,6 +64,8 @@ gradlePlugin {
|
|||
}
|
||||
}
|
||||
|
||||
lint.baseline = project.file("lint-baseline.xml")
|
||||
|
||||
dependencies {
|
||||
implementation(libs.build.agp)
|
||||
implementation(libs.build.cachefix)
|
||||
|
@ -72,4 +77,6 @@ dependencies {
|
|||
|
||||
// Expose the generated version catalog API to the plugin.
|
||||
implementation(files(libs::class.java.superclass.protectionDomain.codeSource.location))
|
||||
|
||||
lintChecks(libs.androidx.lint)
|
||||
}
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<issues format="6" by="lint 8.3.0" type="baseline" client="gradle" dependencies="false" name="AGP (8.3.0)" variant="all" version="8.3.0">
|
||||
|
||||
<issue
|
||||
id="InternalGradleApiUsage"
|
||||
message="Avoid using internal Android Gradle Plugin APIs"
|
||||
errorLine1="import com.android.build.gradle.internal.dsl.BaseAppModuleExtension"
|
||||
errorLine2="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/kotlin/dev/msfjarvis/claw/gradle/signing/AppSigning.kt"
|
||||
line="9"
|
||||
column="1"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="InternalGradleApiUsage"
|
||||
message="Avoid using internal Android Gradle Plugin APIs"
|
||||
errorLine1="import com.android.build.gradle.internal.plugins.AppPlugin"
|
||||
errorLine2="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/kotlin/dev/msfjarvis/claw/gradle/versioning/VersioningPlugin.kt"
|
||||
line="11"
|
||||
column="1"/>
|
||||
</issue>
|
||||
|
||||
</issues>
|
|
@ -23,6 +23,14 @@ pluginManagement {
|
|||
includeModule("org.gradle.kotlin", "gradle-kotlin-dsl-plugins")
|
||||
}
|
||||
}
|
||||
exclusiveContent {
|
||||
forRepository { google() }
|
||||
filter {
|
||||
includeGroup("androidx.databinding")
|
||||
includeGroupByRegex("com.android.*")
|
||||
includeGroup("com.google.testing.platform")
|
||||
}
|
||||
}
|
||||
mavenCentral { mavenContent { releasesOnly() } }
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +41,7 @@ dependencyResolutionManagement {
|
|||
forRepository(::google)
|
||||
filter {
|
||||
includeGroup("androidx.databinding")
|
||||
includeGroup("androidx.lint")
|
||||
includeGroupByRegex("com.android.*")
|
||||
includeGroup("com.google.testing.platform")
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright © 2022-2023 Harsh Shandilya.
|
||||
* Copyright © 2022-2024 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
|
@ -33,26 +33,22 @@ class ApplicationPlugin : Plugin<Project> {
|
|||
buildConfig = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
all {
|
||||
setProguardFiles(
|
||||
listOf(
|
||||
"proguard-android-optimize.pro",
|
||||
"proguard-rules.pro",
|
||||
"proguard-rules-missing-classes.pro",
|
||||
)
|
||||
buildTypes.configureEach {
|
||||
setProguardFiles(
|
||||
listOf(
|
||||
"proguard-android-optimize.pro",
|
||||
"proguard-rules.pro",
|
||||
"proguard-rules-missing-classes.pro",
|
||||
)
|
||||
}
|
||||
named("release") {
|
||||
)
|
||||
if (name == "release") {
|
||||
isMinifyEnabled = !project.providers.environmentVariable("DISABLE_MINIFY").isPresent
|
||||
}
|
||||
named("debug") {
|
||||
} else if (name == "debug") {
|
||||
applicationIdSuffix = ".debug"
|
||||
versionNameSuffix = "-debug"
|
||||
isMinifyEnabled = false
|
||||
}
|
||||
}
|
||||
|
||||
project.configureBuildSigning()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright © 2022 Harsh Shandilya.
|
||||
* Copyright © 2022-2024 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
|
@ -31,7 +31,7 @@ internal fun Project.configureBuildSigning() {
|
|||
}
|
||||
}
|
||||
val signingConfig = signingConfigs.getByName("release")
|
||||
buildTypes.all { setSigningConfig(signingConfig) }
|
||||
buildTypes.configureEach { setSigningConfig(signingConfig) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ androidx-core-splashscreen = "androidx.core:core-splashscreen:1.1.0-alpha02"
|
|||
androidx-lifecycle-common = { module = "androidx.lifecycle:lifecycle-common", version.ref = "lifecycle" }
|
||||
androidx-lifecycle-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycle" }
|
||||
androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime", version.ref = "lifecycle" }
|
||||
androidx-lint = "androidx.lint:lint-gradle:1.0.0-alpha01"
|
||||
androidx-navigation-compose = "androidx.navigation:navigation-compose:2.8.0-alpha03"
|
||||
androidx-paging-compose = "androidx.paging:paging-compose:3.3.0-alpha03"
|
||||
androidx-profileinstaller = "androidx.profileinstaller:profileinstaller:1.4.0-alpha01"
|
||||
|
@ -108,6 +109,7 @@ unfurl = "me.saket.unfurl:unfurl:1.7.0"
|
|||
|
||||
[plugins]
|
||||
aboutlibraries = { id = "com.mikepenz.aboutlibraries.plugin", version.ref = "aboutLibraries" }
|
||||
android-lint = { id = "com.android.lint", version.ref = "agp" }
|
||||
android-test = { id = "com.android.test", version.ref = "agp" }
|
||||
anvil = "com.squareup.anvil:2.5.0-beta03"
|
||||
baselineprofile = { id = "androidx.baselineprofile", version.ref = "benchmark" }
|
||||
|
|
Loading…
Reference in New Issue