Merge "AGP 8.1.0-alpha03" into androidx-main
diff --git a/activity/activity-compose-lint/src/main/java/androidx/activity/compose/lint/ActivityComposeIssueRegistry.kt b/activity/activity-compose-lint/src/main/java/androidx/activity/compose/lint/ActivityComposeIssueRegistry.kt
index 656270a..76b1f3e 100644
--- a/activity/activity-compose-lint/src/main/java/androidx/activity/compose/lint/ActivityComposeIssueRegistry.kt
+++ b/activity/activity-compose-lint/src/main/java/androidx/activity/compose/lint/ActivityComposeIssueRegistry.kt
@@ -27,7 +27,7 @@
*/
class ActivityComposeIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(
ActivityResultLaunchDetector.LaunchDuringComposition
diff --git a/activity/activity-lint/src/main/java/androidx/activity/lint/ActivityIssueRegistry.kt b/activity/activity-lint/src/main/java/androidx/activity/lint/ActivityIssueRegistry.kt
index 794624c..168ec91 100644
--- a/activity/activity-lint/src/main/java/androidx/activity/lint/ActivityIssueRegistry.kt
+++ b/activity/activity-lint/src/main/java/androidx/activity/lint/ActivityIssueRegistry.kt
@@ -26,7 +26,7 @@
@Suppress("UnstableApiUsage")
class ActivityIssueRegistry : IssueRegistry() {
// tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(
ActivityResultFragmentVersionDetector.ISSUE
diff --git a/annotation/annotation-experimental-lint/src/main/java/androidx/annotation/experimental/lint/ExperimentalIssueRegistry.kt b/annotation/annotation-experimental-lint/src/main/java/androidx/annotation/experimental/lint/ExperimentalIssueRegistry.kt
index 0f6ff59..1cf3f9a 100644
--- a/annotation/annotation-experimental-lint/src/main/java/androidx/annotation/experimental/lint/ExperimentalIssueRegistry.kt
+++ b/annotation/annotation-experimental-lint/src/main/java/androidx/annotation/experimental/lint/ExperimentalIssueRegistry.kt
@@ -23,7 +23,7 @@
@Suppress("UnstableApiUsage")
class ExperimentalIssueRegistry : IssueRegistry() {
override val minApi = CURRENT_API
- override val api = 13
+ override val api = 14
override val issues get() = ExperimentalDetector.ISSUES + AnnotationRetentionDetector.ISSUES
override val vendor = Vendor(
feedbackUrl = "https://issuetracker.google.com/issues/new?component=459778",
diff --git a/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/AppCompatIssueRegistry.kt b/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/AppCompatIssueRegistry.kt
index ffb51ab..65f052b 100644
--- a/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/AppCompatIssueRegistry.kt
+++ b/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/AppCompatIssueRegistry.kt
@@ -32,7 +32,7 @@
@Suppress("UnstableApiUsage")
class AppCompatIssueRegistry : IssueRegistry() {
override val minApi = 10 // Only compatible with the latest lint
- override val api = 13
+ override val api = 14
override val issues get() = listOf(
SetActionBarDetector.USING_CORE_ACTION_BAR,
ColorStateListAlphaDetector.NOT_USING_ANDROID_ALPHA,
diff --git a/car/app/app/build.gradle b/car/app/app/build.gradle
index 74dff68..5807cb4 100644
--- a/car/app/app/build.gradle
+++ b/car/app/app/build.gradle
@@ -16,7 +16,6 @@
import androidx.build.LibraryType
import androidx.build.Release
-import androidx.build.checkapi.LibraryApiTaskConfig
import androidx.build.metalava.MetalavaRunnerKt
import androidx.build.uptodatedness.EnableCachingKt
import androidx.build.Version
@@ -30,8 +29,6 @@
import java.util.concurrent.TimeUnit
import javax.inject.Inject
-import static androidx.build.dependencies.DependenciesKt.*
-
buildscript {
dependencies {
// This dependency means that tasks in this project might become out-of-date whenever
@@ -317,12 +314,14 @@
@Input
String carApiLevel = project.latestCarAppApiLevel
- @OutputFile
- File apiLevelFile
+ @OutputDirectory
+ final DirectoryProperty outputDir = project.objects.directoryProperty()
@TaskAction
def exec() {
- PrintWriter writer = new PrintWriter(apiLevelFile)
+ def outputFile = new File(outputDir.get().asFile, "car-app-api.level")
+ outputFile.parentFile.mkdirs()
+ PrintWriter writer = new PrintWriter(outputFile)
writer.println(carApiLevel)
writer.close()
}
@@ -380,9 +379,6 @@
}
}
-def RESOURCE_DIRECTORY = "generatedResources"
-def API_LEVEL_FILE_PATH = "$RESOURCE_DIRECTORY/car-app-api.level"
-
LibraryExtension library = project.extensions.getByType(LibraryExtension.class)
def getLibraryExtension() {
@@ -413,24 +409,15 @@
return sourceCollection
}
+def writeCarApiLevelFileTask = tasks.register("writeCarApiLevelFile", ApiLevelFileWriterTask) { task ->
+ task.outputDir.set(new File(project.buildDir, "generatedResources"))
+}
+
+AndroidSourceDirectorySet resources = library.sourceSets.getByName("main").resources
+resources.srcDir(writeCarApiLevelFileTask.map {it.outputDir })
+
// afterEvaluate required to read extension properties
afterEvaluate {
- task writeCarApiLevelFile(type: ApiLevelFileWriterTask) {
- File artifactName = new File(buildDir, API_LEVEL_FILE_PATH)
- apiLevelFile = artifactName
- }
-
- AndroidSourceDirectorySet resources = library.sourceSets.getByName("main").resources
- Set<File> resFiles = new HashSet<>()
- resFiles.add(resources.srcDirs)
- resFiles.add(new File(buildDir, RESOURCE_DIRECTORY))
- resources.srcDirs(resFiles)
- Set<String> includes = resources.includes
- if (!includes.isEmpty()) {
- includes.add("*.level")
- resources.setIncludes(includes)
- }
-
FileCollection sourceCollection = getSourceCollection()
FileCollection dependencyClasspath = getLibraryVariant().getCompileClasspath(null)
FileCollection metalavaClasspath = MetalavaRunnerKt.getMetalavaClasspath(project)
diff --git a/compose/animation/animation-core-lint/src/main/java/androidx/compose/animation/core/lint/AnimationCoreIssueRegistry.kt b/compose/animation/animation-core-lint/src/main/java/androidx/compose/animation/core/lint/AnimationCoreIssueRegistry.kt
index 02be66d..7dce8cf 100644
--- a/compose/animation/animation-core-lint/src/main/java/androidx/compose/animation/core/lint/AnimationCoreIssueRegistry.kt
+++ b/compose/animation/animation-core-lint/src/main/java/androidx/compose/animation/core/lint/AnimationCoreIssueRegistry.kt
@@ -25,7 +25,7 @@
*/
class AnimationCoreIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(
TransitionDetector.UnusedTransitionTargetStateParameter,
diff --git a/compose/animation/animation-lint/src/main/java/androidx/compose/animation/lint/AnimationIssueRegistry.kt b/compose/animation/animation-lint/src/main/java/androidx/compose/animation/lint/AnimationIssueRegistry.kt
index 3884e78..6cff075 100644
--- a/compose/animation/animation-lint/src/main/java/androidx/compose/animation/lint/AnimationIssueRegistry.kt
+++ b/compose/animation/animation-lint/src/main/java/androidx/compose/animation/lint/AnimationIssueRegistry.kt
@@ -27,7 +27,7 @@
*/
class AnimationIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(
CrossfadeDetector.UnusedCrossfadeTargetStateParameter
diff --git a/compose/foundation/foundation-lint/src/main/java/androidx/compose/foundation/lint/FoundationIssueRegistry.kt b/compose/foundation/foundation-lint/src/main/java/androidx/compose/foundation/lint/FoundationIssueRegistry.kt
index ef9e339..9d622a1 100644
--- a/compose/foundation/foundation-lint/src/main/java/androidx/compose/foundation/lint/FoundationIssueRegistry.kt
+++ b/compose/foundation/foundation-lint/src/main/java/androidx/compose/foundation/lint/FoundationIssueRegistry.kt
@@ -27,7 +27,7 @@
*/
class FoundationIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(
LazyLayoutStateReadInCompositionDetector.FrequentlyChangedStateReadInComposition,
diff --git a/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/ComposeIssueRegistry.kt b/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/ComposeIssueRegistry.kt
index 6dd41f2..29098a8 100644
--- a/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/ComposeIssueRegistry.kt
+++ b/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/ComposeIssueRegistry.kt
@@ -25,7 +25,7 @@
class ComposeIssueRegistry : IssueRegistry() {
override val minApi = CURRENT_API
- override val api = 13
+ override val api = 14
override val issues get(): List<Issue> {
return listOf(
ListIteratorDetector.ISSUE,
diff --git a/compose/material/material-lint/src/main/java/androidx/compose/material/lint/MaterialIssueRegistry.kt b/compose/material/material-lint/src/main/java/androidx/compose/material/lint/MaterialIssueRegistry.kt
index 75ce926..f7b3b43 100644
--- a/compose/material/material-lint/src/main/java/androidx/compose/material/lint/MaterialIssueRegistry.kt
+++ b/compose/material/material-lint/src/main/java/androidx/compose/material/lint/MaterialIssueRegistry.kt
@@ -25,7 +25,7 @@
*/
class MaterialIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(
ColorsDetector.ConflictingOnColor,
diff --git a/compose/material3/material3-lint/src/main/java/androidx/compose/material3/lint/Material3IssueRegistry.kt b/compose/material3/material3-lint/src/main/java/androidx/compose/material3/lint/Material3IssueRegistry.kt
index 8529446..6887bda 100644
--- a/compose/material3/material3-lint/src/main/java/androidx/compose/material3/lint/Material3IssueRegistry.kt
+++ b/compose/material3/material3-lint/src/main/java/androidx/compose/material3/lint/Material3IssueRegistry.kt
@@ -25,7 +25,7 @@
*/
class Material3IssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(
ScaffoldPaddingDetector.UnusedMaterial3ScaffoldPaddingParameter
diff --git a/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/RuntimeIssueRegistry.kt b/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/RuntimeIssueRegistry.kt
index bd97ea2..edc16ae 100644
--- a/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/RuntimeIssueRegistry.kt
+++ b/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/RuntimeIssueRegistry.kt
@@ -27,7 +27,7 @@
*/
class RuntimeIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(
ComposableCoroutineCreationDetector.CoroutineCreationDuringComposition,
diff --git a/compose/runtime/runtime-saveable-lint/src/main/java/androidx/compose/runtime/saveable/lint/RuntimeSaveableIssueRegistry.kt b/compose/runtime/runtime-saveable-lint/src/main/java/androidx/compose/runtime/saveable/lint/RuntimeSaveableIssueRegistry.kt
index ce3e102..60bbfa0 100644
--- a/compose/runtime/runtime-saveable-lint/src/main/java/androidx/compose/runtime/saveable/lint/RuntimeSaveableIssueRegistry.kt
+++ b/compose/runtime/runtime-saveable-lint/src/main/java/androidx/compose/runtime/saveable/lint/RuntimeSaveableIssueRegistry.kt
@@ -27,7 +27,7 @@
*/
class RuntimeSaveableIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(
RememberSaveableDetector.RememberSaveableSaverParameter
diff --git a/compose/ui/ui-graphics-lint/src/main/java/androidx/compose/ui/graphics/lint/UiGraphicsIssueRegistry.kt b/compose/ui/ui-graphics-lint/src/main/java/androidx/compose/ui/graphics/lint/UiGraphicsIssueRegistry.kt
index bff18de..065492c4 100644
--- a/compose/ui/ui-graphics-lint/src/main/java/androidx/compose/ui/graphics/lint/UiGraphicsIssueRegistry.kt
+++ b/compose/ui/ui-graphics-lint/src/main/java/androidx/compose/ui/graphics/lint/UiGraphicsIssueRegistry.kt
@@ -25,7 +25,7 @@
*/
class UiGraphicsIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(
ColorDetector.MissingColorAlphaChannel,
diff --git a/compose/ui/ui-lint/src/main/java/androidx/compose/ui/lint/UiIssueRegistry.kt b/compose/ui/ui-lint/src/main/java/androidx/compose/ui/lint/UiIssueRegistry.kt
index 3c33786..109f8b0 100644
--- a/compose/ui/ui-lint/src/main/java/androidx/compose/ui/lint/UiIssueRegistry.kt
+++ b/compose/ui/ui-lint/src/main/java/androidx/compose/ui/lint/UiIssueRegistry.kt
@@ -27,7 +27,7 @@
*/
class UiIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(
ComposedModifierDetector.UnnecessaryComposedModifier,
diff --git a/compose/ui/ui-test-manifest-lint/src/main/java/androidx/compose/ui/test/manifest/lint/TestManifestIssueRegistry.kt b/compose/ui/ui-test-manifest-lint/src/main/java/androidx/compose/ui/test/manifest/lint/TestManifestIssueRegistry.kt
index 5879da0b..a0b10da 100644
--- a/compose/ui/ui-test-manifest-lint/src/main/java/androidx/compose/ui/test/manifest/lint/TestManifestIssueRegistry.kt
+++ b/compose/ui/ui-test-manifest-lint/src/main/java/androidx/compose/ui/test/manifest/lint/TestManifestIssueRegistry.kt
@@ -21,7 +21,7 @@
import com.android.tools.lint.detector.api.CURRENT_API
class TestManifestIssueRegistry : IssueRegistry() {
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(GradleDebugConfigurationDetector.ISSUE)
override val vendor = Vendor(
diff --git a/constraintlayout/constraintlayout-compose-lint/src/main/java/androidx/constraintlayout/compose/lint/ConstraintLayoutComposeIssueRegistry.kt b/constraintlayout/constraintlayout-compose-lint/src/main/java/androidx/constraintlayout/compose/lint/ConstraintLayoutComposeIssueRegistry.kt
index 13e6bed..f81e031 100644
--- a/constraintlayout/constraintlayout-compose-lint/src/main/java/androidx/constraintlayout/compose/lint/ConstraintLayoutComposeIssueRegistry.kt
+++ b/constraintlayout/constraintlayout-compose-lint/src/main/java/androidx/constraintlayout/compose/lint/ConstraintLayoutComposeIssueRegistry.kt
@@ -25,7 +25,7 @@
private const val CL_COMPOSE_NEW_ISSUE = "new?component=323867&template=1023345"
class ConstraintLayoutComposeIssueRegistry : IssueRegistry() {
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
diff --git a/core/core/src/androidTest/java/androidx/core/content/FileProviderTest.java b/core/core/src/androidTest/java/androidx/core/content/FileProviderTest.java
index 9de302e..36ef9c7 100644
--- a/core/core/src/androidTest/java/androidx/core/content/FileProviderTest.java
+++ b/core/core/src/androidTest/java/androidx/core/content/FileProviderTest.java
@@ -45,6 +45,7 @@
import org.junit.runner.RunWith;
import java.io.ByteArrayOutputStream;
+import java.io.Closeable;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
@@ -485,7 +486,7 @@
/**
* Closes 'closeable', ignoring any checked exceptions. Does nothing if 'closeable' is null.
*/
- private static void closeQuietly(AutoCloseable closeable) {
+ private static void closeQuietly(Closeable closeable) {
if (closeable != null) {
try {
closeable.close();
diff --git a/development/update_studio.sh b/development/update_studio.sh
index 187a9d4..d394214 100755
--- a/development/update_studio.sh
+++ b/development/update_studio.sh
@@ -1,9 +1,24 @@
#!/bin/bash
+
+function echoAndDo() {
+ echo "$@"
+ eval "$@"
+}
+
# Get versions
-AGP_VERSION=${1:-8.0.0-alpha07}
-STUDIO_VERSION_STRING=${2:-"Android Studio Flamingo (2022.2.1) Canary 7"}
-STUDIO_IFRAME_LINK=`curl "https://developer.android.com/studio/archive.html" | grep iframe | sed "s/.*src=\"\([a-zA-Z0-9\/\._]*\)\".*/https:\/\/android-dot-devsite-v2-prod.appspot.com\1/g"`
-STUDIO_LINK=`curl -s $STUDIO_IFRAME_LINK | grep -C30 "$STUDIO_VERSION_STRING" | grep Linux | tail -n 1 | sed 's/.*a href="\(.*\).*"/\1/g'`
+echo Getting Studio version and link
+AGP_VERSION=${1:-8.1.0-alpha03}
+STUDIO_VERSION_STRING=${2:-"Android Studio Giraffe | 2022.3.1 Canary 3"}
+STUDIO_IFRAME_LINK=`curl "https://developer.android.com/studio/archive.html" | grep "<iframe " | sed "s/.* src=\"\([^\"]*\)\".*/\1/g"`
+echo iframe link $STUDIO_IFRAME_LINK
+STUDIO_IFRAME_REDIRECT=`curl -s $STUDIO_IFRAME_LINK | grep href | sed 's/.*href="\([^"]*\)".*/\1/g'`
+echo iframe redirect $STUDIO_IFRAME_REDIRECT
+STUDIO_LINK=`curl -s $STUDIO_IFRAME_REDIRECT | grep -C30 "$STUDIO_VERSION_STRING" | grep Linux | tail -n 1 | sed 's/.*a href="\(.*\).*"/\1/g' | sed 's/>.*//'`
+echo STUDIO_LINK: $STUDIO_LINK
+if [ "$STUDIO_LINK" == "" ]; then
+ echo "Error: STUDIO_LINK must not be empty. Open this script and look for parsing errors. Does studio version '$STUDIO_VERSION_STRING' exist?"
+ exit 1
+fi
STUDIO_VERSION=`echo $STUDIO_LINK | sed "s/.*ide-zips\/\(.*\)\/android-studio-.*/\1/g"`
# Update AGP
@@ -22,7 +37,8 @@
ARTIFACTS_TO_DOWNLOAD+="com.android.tools.lint:lint-gradle:$LINT_VERSION,"
ARTIFACTS_TO_DOWNLOAD+="com.android.tools:ninepatch:$LINT_VERSION,"
-# Update studio_versions.properties
+# Update libs.versions.toml
+echo Updating dependency versions
sed -i "s/androidGradlePlugin = .*/androidGradlePlugin = \"$AGP_VERSION\"/g" gradle/libs.versions.toml
sed -i "s/androidLint = \".*/androidLint = \"$LINT_VERSION\"/g" gradle/libs.versions.toml
sed -i "s/androidStudio = .*/androidStudio = \"$STUDIO_VERSION\"/g" gradle/libs.versions.toml
@@ -44,4 +60,4 @@
ARTIFACTS_TO_DOWNLOAD+="com.google.testing.platform:core:$ATP_VERSION"
# Download all the artifacts
-./development/importMaven/importMaven.sh "$ARTIFACTS_TO_DOWNLOAD"
\ No newline at end of file
+echoAndDo ./development/importMaven/importMaven.sh "$ARTIFACTS_TO_DOWNLOAD"
diff --git a/fragment/fragment-lint/src/main/java/androidx/fragment/lint/FragmentIssueRegistry.kt b/fragment/fragment-lint/src/main/java/androidx/fragment/lint/FragmentIssueRegistry.kt
index 3032c3a..f44dbf7 100644
--- a/fragment/fragment-lint/src/main/java/androidx/fragment/lint/FragmentIssueRegistry.kt
+++ b/fragment/fragment-lint/src/main/java/androidx/fragment/lint/FragmentIssueRegistry.kt
@@ -26,7 +26,7 @@
@Suppress("UnstableApiUsage")
class FragmentIssueRegistry : IssueRegistry() {
// tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(
FragmentTagDetector.ISSUE,
diff --git a/fragment/fragment-testing-lint/src/main/java/androidx/fragment/testing/lint/FragmentTestingIssueRegistry.kt b/fragment/fragment-testing-lint/src/main/java/androidx/fragment/testing/lint/FragmentTestingIssueRegistry.kt
index 3ba8a76..304b578 100644
--- a/fragment/fragment-testing-lint/src/main/java/androidx/fragment/testing/lint/FragmentTestingIssueRegistry.kt
+++ b/fragment/fragment-testing-lint/src/main/java/androidx/fragment/testing/lint/FragmentTestingIssueRegistry.kt
@@ -22,7 +22,7 @@
@Suppress("UnstableApiUsage")
class FragmentTestingIssueRegistry : IssueRegistry() {
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(GradleConfigurationDetector.ISSUE)
override val vendor = Vendor(
diff --git a/fragment/fragment-testing-manifest-lint/src/main/java/androidx/fragment/testing/manifest/lint/FragmentTestingManifestIssueRegistry.kt b/fragment/fragment-testing-manifest-lint/src/main/java/androidx/fragment/testing/manifest/lint/FragmentTestingManifestIssueRegistry.kt
index 7ce1350..41a082b 100644
--- a/fragment/fragment-testing-manifest-lint/src/main/java/androidx/fragment/testing/manifest/lint/FragmentTestingManifestIssueRegistry.kt
+++ b/fragment/fragment-testing-manifest-lint/src/main/java/androidx/fragment/testing/manifest/lint/FragmentTestingManifestIssueRegistry.kt
@@ -22,7 +22,7 @@
@Suppress("UnstableApiUsage")
class FragmentTestingManifestIssueRegistry : IssueRegistry() {
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(GradleConfigurationDetector.ISSUE)
override val vendor = Vendor(
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index c73fd38..7ed33f1 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -2,13 +2,13 @@
# -----------------------------------------------------------------------------
# All of the following should be updated in sync.
# -----------------------------------------------------------------------------
-androidGradlePlugin = "8.0.0-alpha07"
+androidGradlePlugin = "8.1.0-alpha03"
# NOTE: When updating the lint version we also need to update the `api` version
# supported by `IssueRegistry`'s.' For e.g. r.android.com/1331903
-androidLint = "31.0.0-alpha07"
+androidLint = "31.1.0-alpha03"
# Once you have a chosen version of AGP to upgrade to, go to
# https://developer.android.com/studio/archive and find the matching version of Studio.
-androidStudio = "2022.2.1.7"
+androidStudio = "2022.3.1.3"
# -----------------------------------------------------------------------------
androidGradlePluginMin = "7.0.4"
diff --git a/lifecycle/lifecycle-livedata-core-ktx-lint/src/main/java/androidx/lifecycle/lint/LiveDataCoreIssueRegistry.kt b/lifecycle/lifecycle-livedata-core-ktx-lint/src/main/java/androidx/lifecycle/lint/LiveDataCoreIssueRegistry.kt
index b0aab4e..0b251e7 100644
--- a/lifecycle/lifecycle-livedata-core-ktx-lint/src/main/java/androidx/lifecycle/lint/LiveDataCoreIssueRegistry.kt
+++ b/lifecycle/lifecycle-livedata-core-ktx-lint/src/main/java/androidx/lifecycle/lint/LiveDataCoreIssueRegistry.kt
@@ -23,7 +23,7 @@
@Suppress("UnstableApiUsage")
class LiveDataCoreIssueRegistry : IssueRegistry() {
override val minApi = CURRENT_API
- override val api = 13
+ override val api = 14
override val issues get() = listOf(NonNullableMutableLiveDataDetector.ISSUE)
override val vendor = Vendor(
feedbackUrl = "https://issuetracker.google.com/issues/new?component=413132",
diff --git a/lifecycle/lifecycle-runtime-ktx-lint/src/main/java/androidx/lifecycle/lint/LifecycleRuntimeIssueRegistry.kt b/lifecycle/lifecycle-runtime-ktx-lint/src/main/java/androidx/lifecycle/lint/LifecycleRuntimeIssueRegistry.kt
index b655be5..ca0bb57 100644
--- a/lifecycle/lifecycle-runtime-ktx-lint/src/main/java/androidx/lifecycle/lint/LifecycleRuntimeIssueRegistry.kt
+++ b/lifecycle/lifecycle-runtime-ktx-lint/src/main/java/androidx/lifecycle/lint/LifecycleRuntimeIssueRegistry.kt
@@ -23,7 +23,7 @@
@Suppress("UnstableApiUsage")
class LifecycleRuntimeIssueRegistry : IssueRegistry() {
// tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(
LifecycleWhenChecks.ISSUE,
diff --git a/lint-checks/src/main/java/androidx/build/lint/AndroidXIssueRegistry.kt b/lint-checks/src/main/java/androidx/build/lint/AndroidXIssueRegistry.kt
index 312cadd..a4f7ce8 100644
--- a/lint-checks/src/main/java/androidx/build/lint/AndroidXIssueRegistry.kt
+++ b/lint-checks/src/main/java/androidx/build/lint/AndroidXIssueRegistry.kt
@@ -25,7 +25,7 @@
class AndroidXIssueRegistry : IssueRegistry() {
override val minApi = CURRENT_API
- override val api = 13
+ override val api = 14
override val issues get(): List<Issue> {
return Issues
}
diff --git a/lint-checks/src/main/java/androidx/build/lint/BanUncheckedReflection.kt b/lint-checks/src/main/java/androidx/build/lint/BanUncheckedReflection.kt
index ab2b60d..7bab6f3 100644
--- a/lint-checks/src/main/java/androidx/build/lint/BanUncheckedReflection.kt
+++ b/lint-checks/src/main/java/androidx/build/lint/BanUncheckedReflection.kt
@@ -17,17 +17,19 @@
package androidx.build.lint
+import com.android.sdklib.SdkVersionInfo.HIGHEST_KNOWN_API
+import com.android.tools.lint.detector.api.ApiConstraint
import com.android.tools.lint.detector.api.Category
import com.android.tools.lint.detector.api.Detector
import com.android.tools.lint.detector.api.Implementation
+import com.android.tools.lint.detector.api.Incident
import com.android.tools.lint.detector.api.Issue
import com.android.tools.lint.detector.api.JavaContext
import com.android.tools.lint.detector.api.Scope
-import com.android.sdklib.SdkVersionInfo.HIGHEST_KNOWN_API
-import com.android.tools.lint.detector.api.Incident
import com.android.tools.lint.detector.api.Severity
import com.android.tools.lint.detector.api.SourceCodeScanner
-import com.android.tools.lint.detector.api.VersionChecks
+import com.android.tools.lint.detector.api.VersionChecks.Companion.isPrecededByVersionCheckExit
+import com.android.tools.lint.detector.api.VersionChecks.Companion.isWithinVersionCheckConditional
import com.intellij.psi.PsiAnnotation
import com.intellij.psi.PsiMethod
import org.jetbrains.uast.UCallExpression
@@ -55,15 +57,14 @@
if (!context.evaluator.isMemberInClass(method, METHOD_REFLECTION_CLASS)) return
// Flag if the call isn't inside or preceded by an SDK_INT check.
- if (!VersionChecks.isWithinVersionCheckConditional(
+ if (!isWithinVersionCheckConditional(
context,
node,
- HIGHEST_KNOWN_API,
- false
+ ApiConstraint.get(HIGHEST_KNOWN_API), false
) &&
- !VersionChecks.isWithinVersionCheckConditional(context, node, 1, true) &&
- !VersionChecks.isPrecededByVersionCheckExit(context, node, HIGHEST_KNOWN_API) &&
- !VersionChecks.isPrecededByVersionCheckExit(context, node, 1) &&
+ !isWithinVersionCheckConditional(context, node, ApiConstraint.get(1), true) &&
+ !isPrecededByVersionCheckExit(context, node, ApiConstraint.get(HIGHEST_KNOWN_API)) &&
+ !isPrecededByVersionCheckExit(context, node, ApiConstraint.get(1)) &&
!isWithinDeprecatedSinceApiMethod(node) &&
!isWithinDeprecatedSinceApiClass(node)
) {
diff --git a/lint-checks/src/main/java/androidx/build/lint/ClassVerificationFailureDetector.kt b/lint-checks/src/main/java/androidx/build/lint/ClassVerificationFailureDetector.kt
index f8d3070..62d19a0 100644
--- a/lint-checks/src/main/java/androidx/build/lint/ClassVerificationFailureDetector.kt
+++ b/lint-checks/src/main/java/androidx/build/lint/ClassVerificationFailureDetector.kt
@@ -202,7 +202,7 @@
?: return
// Change: Removed SimpleDateFormat and Animator checks
-
+ @Suppress("DEPRECATION") // b/262915628
var api = apiDatabase.getMethodVersion(owner, name, desc)
if (api == -1) {
return
@@ -260,6 +260,7 @@
for (type in inheritanceChain) {
val expressionOwner = evaluator.getQualifiedName(type)
if (expressionOwner != null && expressionOwner != owner) {
+ @Suppress("DEPRECATION") // b/262915628
val specificApi = apiDatabase.getMethodVersion(
expressionOwner, name, desc
)
@@ -339,6 +340,7 @@
) {
break
}
+ @Suppress("DEPRECATION") // b/262915628
val specificApi =
apiDatabase.getMethodVersion(expressionOwner, name, desc)
if (specificApi == -1) {
@@ -385,6 +387,7 @@
if (provider != null) {
val methodOwner = evaluator.getQualifiedName(provider)
if (methodOwner != null) {
+ @Suppress("DEPRECATION") // b/262915628
val methodApi = apiDatabase.getMethodVersion(
methodOwner, name, desc
)
@@ -853,6 +856,7 @@
private fun classAvailableAtMinSdk(className: String): Boolean {
val apiDatabase = apiDatabase ?: return false
val minSdk = getMinSdk(context)
+ @Suppress("DEPRECATION") // b/262915628
val version = apiDatabase.getClassVersion(className)
return version <= minSdk
}
diff --git a/navigation/navigation-common-lint/src/main/java/androidx/navigation/common/lint/NavigationCommonIssueRegistry.kt b/navigation/navigation-common-lint/src/main/java/androidx/navigation/common/lint/NavigationCommonIssueRegistry.kt
index ff861cd..f5a5d52 100644
--- a/navigation/navigation-common-lint/src/main/java/androidx/navigation/common/lint/NavigationCommonIssueRegistry.kt
+++ b/navigation/navigation-common-lint/src/main/java/androidx/navigation/common/lint/NavigationCommonIssueRegistry.kt
@@ -27,7 +27,7 @@
*/
class NavigationCommonIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(
EmptyNavDeepLinkDetector.EmptyNavDeepLink
diff --git a/navigation/navigation-compose-lint/src/main/java/androidx/navigation/compose/lint/NavigationComposeIssueRegistry.kt b/navigation/navigation-compose-lint/src/main/java/androidx/navigation/compose/lint/NavigationComposeIssueRegistry.kt
index 402db3be..b6b5d155 100644
--- a/navigation/navigation-compose-lint/src/main/java/androidx/navigation/compose/lint/NavigationComposeIssueRegistry.kt
+++ b/navigation/navigation-compose-lint/src/main/java/androidx/navigation/compose/lint/NavigationComposeIssueRegistry.kt
@@ -27,7 +27,7 @@
*/
class NavigationComposeIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(
ComposableDestinationInComposeScopeDetector.ComposableDestinationInComposeScope,
diff --git a/navigation/navigation-runtime-lint/src/main/java/androidx/navigation/runtime/lint/NavigationRuntimeIssueRegistry.kt b/navigation/navigation-runtime-lint/src/main/java/androidx/navigation/runtime/lint/NavigationRuntimeIssueRegistry.kt
index b4d90ba..48b846a 100644
--- a/navigation/navigation-runtime-lint/src/main/java/androidx/navigation/runtime/lint/NavigationRuntimeIssueRegistry.kt
+++ b/navigation/navigation-runtime-lint/src/main/java/androidx/navigation/runtime/lint/NavigationRuntimeIssueRegistry.kt
@@ -27,7 +27,7 @@
*/
class NavigationRuntimeIssueRegistry : IssueRegistry() {
// Tests are run with this version. We ensure that with ApiLintVersionsTest
- override val api = 13
+ override val api = 14
override val minApi = CURRENT_API
override val issues get() = listOf(
DeepLinkInActivityDestinationDetector.DeepLinkInActivityDestination
diff --git a/recyclerview/recyclerview-lint/src/main/java/androidx/recyclerview/lint/RecyclerViewIssueRegistry.kt b/recyclerview/recyclerview-lint/src/main/java/androidx/recyclerview/lint/RecyclerViewIssueRegistry.kt
index 4e2d8ab..877177f 100644
--- a/recyclerview/recyclerview-lint/src/main/java/androidx/recyclerview/lint/RecyclerViewIssueRegistry.kt
+++ b/recyclerview/recyclerview-lint/src/main/java/androidx/recyclerview/lint/RecyclerViewIssueRegistry.kt
@@ -25,7 +25,7 @@
class RecyclerViewIssueRegistry : IssueRegistry() {
override val minApi = CURRENT_API
- override val api = 13
+ override val api = 14
override val issues: List<Issue>
get() = listOf(
InvalidSetHasFixedSizeDetector.ISSUE
diff --git a/room/room-runtime-lint/src/main/java/androidx/room/lint/CursorKotlinUseIssueDetector.kt b/room/room-runtime-lint/src/main/java/androidx/room/lint/CursorKotlinUseIssueDetector.kt
index 4ddc81c..57e13f0 100644
--- a/room/room-runtime-lint/src/main/java/androidx/room/lint/CursorKotlinUseIssueDetector.kt
+++ b/room/room-runtime-lint/src/main/java/androidx/room/lint/CursorKotlinUseIssueDetector.kt
@@ -64,7 +64,9 @@
}
// If the call is within an SDK_INT check, then its OK
if (
+ @Suppress("DEPRECATION") // b/262915639
VersionChecks.isWithinVersionCheckConditional(context, node, 16) ||
+ @Suppress("DEPRECATION") // b/262915639
VersionChecks.isPrecededByVersionCheckExit(context, node, 16)
) {
return
diff --git a/room/room-runtime-lint/src/main/java/androidx/room/lint/RoomIssueRegistry.kt b/room/room-runtime-lint/src/main/java/androidx/room/lint/RoomIssueRegistry.kt
index 577b802..daedba0 100644
--- a/room/room-runtime-lint/src/main/java/androidx/room/lint/RoomIssueRegistry.kt
+++ b/room/room-runtime-lint/src/main/java/androidx/room/lint/RoomIssueRegistry.kt
@@ -23,7 +23,7 @@
class RoomIssueRegistry : IssueRegistry() {
override val minApi = CURRENT_API
- override val api = 13
+ override val api = 14
override val issues: List<Issue> = listOf(
CursorKotlinUseIssueDetector.ISSUE,
)
diff --git a/startup/startup-runtime-lint/src/main/java/androidx/startup/lint/StartupRuntimeIssueRegistry.kt b/startup/startup-runtime-lint/src/main/java/androidx/startup/lint/StartupRuntimeIssueRegistry.kt
index 84f5620..fad6e87 100644
--- a/startup/startup-runtime-lint/src/main/java/androidx/startup/lint/StartupRuntimeIssueRegistry.kt
+++ b/startup/startup-runtime-lint/src/main/java/androidx/startup/lint/StartupRuntimeIssueRegistry.kt
@@ -28,7 +28,7 @@
*/
class StartupRuntimeIssueRegistry : IssueRegistry() {
override val minApi = CURRENT_API
- override val api = 13
+ override val api = 14
override val issues: List<Issue>
get() = listOf(
InitializerConstructorDetector.ISSUE,
diff --git a/work/work-lint/src/main/java/androidx/work/lint/WorkManagerIssueRegistry.kt b/work/work-lint/src/main/java/androidx/work/lint/WorkManagerIssueRegistry.kt
index 28e0e2f..ac9972b 100644
--- a/work/work-lint/src/main/java/androidx/work/lint/WorkManagerIssueRegistry.kt
+++ b/work/work-lint/src/main/java/androidx/work/lint/WorkManagerIssueRegistry.kt
@@ -25,7 +25,7 @@
class WorkManagerIssueRegistry : IssueRegistry() {
override val minApi = CURRENT_API
- override val api = 13
+ override val api = 14
override val issues: List<Issue> = listOf(
BadConfigurationProviderIssueDetector.ISSUE,
IdleBatteryChargingConstraintsDetector.ISSUE,