diff options
author | Cole Faust <colefaust@google.com> | 2024-01-10 12:30:35 -0800 |
---|---|---|
committer | Kevin Liu <congxiliu@google.com> | 2024-02-01 21:45:57 +0000 |
commit | 70932b7c25b95f4b8ebca79863ef8eb67e9aaf90 (patch) | |
tree | d7e4c349115c02703eb550a1c3f17d1a876b8791 | |
parent | 3c64d45e30eb29fa55f4e8a3d07f4db75cdc26e7 (diff) | |
download | robolectric-70932b7c25b95f4b8ebca79863ef8eb67e9aaf90.tar.gz |
Baseline NewApi issues
NewApi is a lint check that you don't call framework methods that were
introduced in versions later than your min_sdk_version. We want to
make this an error, so we're baselineing all existing issues.
This cl was generated automatically, by taking all the NewApi issues
from the reference baselines, and all the non-NewApi issues from the
existing checked in baselines.
Bug: 268261262
Test: Presubmits
Change-Id: Ic76c96b97b629bc2d3af6aba6be6bf90335a7006
Merged-In: Ic76c96b97b629bc2d3af6aba6be6bf90335a7006
-rw-r--r-- | integration_tests/nativegraphics/Android.bp | 8 | ||||
-rw-r--r-- | integration_tests/nativegraphics/lint-baseline.xml | 37 | ||||
-rw-r--r-- | testapp/Android.bp | 8 | ||||
-rw-r--r-- | testapp/lint-baseline.xml | 26 |
4 files changed, 77 insertions, 2 deletions
diff --git a/integration_tests/nativegraphics/Android.bp b/integration_tests/nativegraphics/Android.bp index 43040dc2d..b5a7ffe20 100644 --- a/integration_tests/nativegraphics/Android.bp +++ b/integration_tests/nativegraphics/Android.bp @@ -11,7 +11,10 @@ android_library { platform_apis: true, manifest: "AndroidManifest.xml", optimize: { - enabled: false + enabled: false, + }, + lint: { + baseline_filename: "lint-baseline.xml", }, } @@ -35,6 +38,9 @@ android_app { kotlincflags: ["-Xjvm-default=all"], plugins: ["dagger2-compiler"], + lint: { + baseline_filename: "lint-baseline.xml", + }, } android_robolectric_test { diff --git a/integration_tests/nativegraphics/lint-baseline.xml b/integration_tests/nativegraphics/lint-baseline.xml new file mode 100644 index 000000000..7fb99b50d --- /dev/null +++ b/integration_tests/nativegraphics/lint-baseline.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<issues format="6" by="lint 8.4.0-alpha01" type="baseline" client="" dependencies="true" name="" variant="all" version="8.4.0-alpha01"> + + <issue + id="NewApi" + message="`android:forceDarkAllowed` requires API level 29 (current min is 26)" + errorLine1=' <item name="android:forceDarkAllowed">false</item>' + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + <location + file="external/robolectric/integration_tests/nativegraphics/src/main/res/values/themes.xml" + line="28" + column="15"/> + </issue> + + <issue + id="NewApi" + message="`android:forceDarkAllowed` requires API level 29 (current min is 26)" + errorLine1=' <item name="android:forceDarkAllowed">true</item>' + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + <location + file="external/robolectric/integration_tests/nativegraphics/src/main/res/values/themes.xml" + line="31" + column="15"/> + </issue> + + <issue + id="NewApi" + message="`android:isLightTheme` requires API level 29 (current min is 26)" + errorLine1=' <item name="android:isLightTheme">true</item>' + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + <location + file="external/robolectric/integration_tests/nativegraphics/src/main/res/values/themes.xml" + line="32" + column="15"/> + </issue> + +</issues>
\ No newline at end of file diff --git a/testapp/Android.bp b/testapp/Android.bp index a11ba44f2..a8c52b815 100644 --- a/testapp/Android.bp +++ b/testapp/Android.bp @@ -11,7 +11,10 @@ android_library { platform_apis: true, manifest: "src/main/AndroidManifest.xml", optimize: { - enabled: false + enabled: false, + }, + lint: { + baseline_filename: "lint-baseline.xml", }, } @@ -38,4 +41,7 @@ android_app { kotlincflags: ["-Xjvm-default=all"], plugins: ["dagger2-compiler"], + lint: { + baseline_filename: "lint-baseline.xml", + }, } diff --git a/testapp/lint-baseline.xml b/testapp/lint-baseline.xml new file mode 100644 index 000000000..957e3d023 --- /dev/null +++ b/testapp/lint-baseline.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<issues format="6" by="lint 8.4.0-alpha01" type="baseline" client="" dependencies="true" name="" variant="all" version="8.4.0-alpha01"> + + <issue + id="NewApi" + message="`<vector>` requires API level 21 (current min is 16) or building with Android Gradle plugin 1.4.0 or higher" + errorLine1='<vector xmlns:android="http://schemas.android.com/apk/res/android"' + errorLine2=" ~~~~~~"> + <location + file="external/robolectric/testapp/src/main/res/drawable-anydpi/an_image_or_vector.xml" + line="2" + column="2"/> + </issue> + + <issue + id="NewApi" + message="`<vector>` requires API level 21 (current min is 16) or building with Android Gradle plugin 1.4.0 or higher" + errorLine1='<vector xmlns:android="http://schemas.android.com/apk/res/android"' + errorLine2=" ~~~~~~"> + <location + file="external/robolectric/testapp/src/main/res/drawable/vector.xml" + line="1" + column="2"/> + </issue> + +</issues>
\ No newline at end of file |