diff --git a/constants.gradle b/constants.gradle index 8f99783c..0e0c2692 100644 --- a/constants.gradle +++ b/constants.gradle @@ -15,7 +15,7 @@ */ ext { groupId = "com.grab.grazel" - versionName = "0.4.1-alpha.22" + versionName = "0.4.1-alpha.23" website = "https://grab.github.io/Grazel/" } diff --git a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/bazel/starlark/LintConfigs.kt b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/bazel/starlark/LintConfigs.kt index 63de8367..628f7a51 100644 --- a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/bazel/starlark/LintConfigs.kt +++ b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/bazel/starlark/LintConfigs.kt @@ -16,8 +16,13 @@ package com.grab.grazel.bazel.starlark -data class LintConfigs(val configPath: String? = null, val baselinePath: String? = null) { +data class LintConfigs( + val enabled: Boolean = true, + val configPath: String? = null, + val baselinePath: String? = null +) { val merged: Map = mapOf( + "enabled" to enabled.toString(), "config" to configPath, "baseline" to baselinePath ).filterValues { it != null } as Map diff --git a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/migrate/android/AndroidExtractor.kt b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/migrate/android/AndroidExtractor.kt index 1faa3ea3..e3f36088 100644 --- a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/migrate/android/AndroidExtractor.kt +++ b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/migrate/android/AndroidExtractor.kt @@ -167,6 +167,9 @@ private fun lintConfigs( lintOptions: LintOptions, project: Project ): LintConfigs { + // enable lint for all targets by default + val enabled = true + val configPath = if (lintOptions.lintConfig?.absolutePath != null) { project.relativePath(lintOptions.lintConfig!!.absolutePath) } else { @@ -177,7 +180,7 @@ private fun lintConfigs( } else { null } - return LintConfigs(configPath, baseLinePath) + return LintConfigs(enabled, configPath, baseLinePath) } internal interface AndroidBinaryDataExtractor : AndroidExtractor diff --git a/sample-android-flavor/BUILD.bazel b/sample-android-flavor/BUILD.bazel index 93c3ab21..02d6bcd2 100644 --- a/sample-android-flavor/BUILD.bazel +++ b/sample-android-flavor/BUILD.bazel @@ -9,6 +9,9 @@ android_library( custom_package = "com.grab.grazel.android.flavor", enable_compose = True, enable_data_binding = True, + lint_options = { + "enabled": "true", + }, manifest = "src/main/AndroidManifest.xml", res_values = { "strings": { @@ -44,6 +47,9 @@ android_library( custom_package = "com.grab.grazel.android.flavor", enable_compose = True, enable_data_binding = True, + lint_options = { + "enabled": "true", + }, manifest = "src/main/AndroidManifest.xml", res_values = { "strings": { @@ -79,6 +85,9 @@ android_library( custom_package = "com.grab.grazel.android.flavor", enable_compose = True, enable_data_binding = True, + lint_options = { + "enabled": "true", + }, manifest = "src/main/AndroidManifest.xml", res_values = { "strings": { @@ -114,6 +123,9 @@ android_library( custom_package = "com.grab.grazel.android.flavor", enable_compose = True, enable_data_binding = True, + lint_options = { + "enabled": "true", + }, manifest = "src/main/AndroidManifest.xml", res_values = { "strings": { diff --git a/sample-android-library/BUILD.bazel b/sample-android-library/BUILD.bazel index 0f8a7fd6..338e5d54 100644 --- a/sample-android-library/BUILD.bazel +++ b/sample-android-library/BUILD.bazel @@ -7,6 +7,9 @@ android_library( ]), custom_package = "com.grab.grazel.android.sample.lib", enable_data_binding = True, + lint_options = { + "enabled": "true", + }, manifest = "src/main/AndroidManifest.xml", visibility = [ "//visibility:public", @@ -23,6 +26,9 @@ android_library( ]), custom_package = "com.grab.grazel.android.sample.lib", enable_data_binding = True, + lint_options = { + "enabled": "true", + }, manifest = "src/main/AndroidManifest.xml", visibility = [ "//visibility:public", @@ -39,6 +45,9 @@ android_library( ]), custom_package = "com.grab.grazel.android.sample.lib", enable_data_binding = True, + lint_options = { + "enabled": "true", + }, manifest = "src/main/AndroidManifest.xml", visibility = [ "//visibility:public", @@ -55,6 +64,9 @@ android_library( ]), custom_package = "com.grab.grazel.android.sample.lib", enable_data_binding = True, + lint_options = { + "enabled": "true", + }, manifest = "src/main/AndroidManifest.xml", visibility = [ "//visibility:public", diff --git a/sample-android/BUILD.bazel b/sample-android/BUILD.bazel index ee3d5ce2..935b7677 100644 --- a/sample-android/BUILD.bazel +++ b/sample-android/BUILD.bazel @@ -35,6 +35,7 @@ android_binary( enable_data_binding = True, incremental_dexing = True, lint_options = { + "enabled": "true", "baseline": "lint_baseline.xml", }, manifest = "src/debug/AndroidManifest.xml", @@ -125,6 +126,7 @@ android_binary( enable_data_binding = True, incremental_dexing = True, lint_options = { + "enabled": "true", "baseline": "lint_baseline.xml", }, manifest = "src/debug/AndroidManifest.xml", @@ -215,6 +217,7 @@ android_binary( enable_data_binding = True, incremental_dexing = True, lint_options = { + "enabled": "true", "baseline": "lint_baseline.xml", }, manifest = "src/debug/AndroidManifest.xml", @@ -305,6 +308,7 @@ android_binary( enable_data_binding = True, incremental_dexing = True, lint_options = { + "enabled": "true", "baseline": "lint_baseline.xml", }, manifest = "src/debug/AndroidManifest.xml", diff --git a/settings.gradle b/settings.gradle index 17abdc7f..b4151315 100644 --- a/settings.gradle +++ b/settings.gradle @@ -15,6 +15,7 @@ */ pluginManagement { repositories { + mavenLocal() gradlePluginPortal() mavenCentral() }