aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Faust <colefaust@google.com>2024-01-10 12:30:35 -0800
committerKevin Liu <congxiliu@google.com>2024-02-01 21:45:57 +0000
commit70932b7c25b95f4b8ebca79863ef8eb67e9aaf90 (patch)
treed7e4c349115c02703eb550a1c3f17d1a876b8791
parent3c64d45e30eb29fa55f4e8a3d07f4db75cdc26e7 (diff)
downloadrobolectric-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.bp8
-rw-r--r--integration_tests/nativegraphics/lint-baseline.xml37
-rw-r--r--testapp/Android.bp8
-rw-r--r--testapp/lint-baseline.xml26
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=' &lt;item name="android:forceDarkAllowed"&gt;false&lt;/item&gt;'
+ 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=' &lt;item name="android:forceDarkAllowed"&gt;true&lt;/item&gt;'
+ 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=' &lt;item name="android:isLightTheme"&gt;true&lt;/item&gt;'
+ 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="`&lt;vector&gt;` requires API level 21 (current min is 16) or building with Android Gradle plugin 1.4.0 or higher"
+ errorLine1='&lt;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="`&lt;vector&gt;` requires API level 21 (current min is 16) or building with Android Gradle plugin 1.4.0 or higher"
+ errorLine1='&lt;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