Upgrade Android SDK used in common lib to Android 17, targets AB#3689049, Fixes AB#3689049#3186
Open
ridam-arora wants to merge 15 commits into
Open
Upgrade Android SDK used in common lib to Android 17, targets AB#3689049, Fixes AB#3689049#3186ridam-arora wants to merge 15 commits into
ridam-arora wants to merge 15 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Common Android library’s build/tooling stack to align with newer Android SDK levels and a Gradle/AGP/Kotlin + CI JDK 21 toolchain, while keeping publishing, tests, and auxiliary modules compatible.
⚠️ Warning: Changes detected⚠️ Please follow the recommendations in Adding or Updating Gradle Dependencies.
Changes:
- Bump SDK/toolchain versions (compile/target SDK, build tools, Gradle wrapper) and update CI pipelines to JDK 21.
- Migrate Android modules to AGP 9 “built-in Kotlin” configuration style (removing
kotlinOptions {}blocks in favor ofkotlin { compilerOptions { ... } }). - Update build plugins / build config generation wiring (gmazzo BuildConfig plugin 6.x task/name changes; publishing variant declaration for AGP 9).
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| uiautomationutilities/build.gradle | Switches default Proguard file name for release configuration. |
| testutils/build.gradle | Moves Kotlin JVM target configuration to kotlin { compilerOptions { ... } } for AGP 9 built-in Kotlin. |
| settings.gradle | Updates VSTS Maven credential fallback to use providers.gradleProperty(...).getOrNull(). |
| LabApiUtilities/build.gradle | Updates build plugins and adapts BuildConfig generation output paths/task names for newer plugin versions. |
| labapi/build.gradle | Moves Java compatibility settings into java { ... } block. |
| keyvault/build.gradle | Moves Java compatibility settings into java { ... } block. |
| gradle/wrapper/gradle-wrapper.properties | Updates Gradle wrapper distribution to 9.3.1. |
| gradle/versions.gradle | Updates SDK levels/build tools + AGP/Kotlin/Robolectric versions and related comments. |
| gradle.properties | Adds android.newDsl=false opt-out flag for AGP 9 legacy DSL/Variant API usage. |
| common4j/build.gradle | Updates build plugins and BuildConfig task wiring for Gradle 9 + buildconfig 6.x. |
| common/src/test/java/com/microsoft/identity/common/internal/util/AndroidKeyStoreUtilTest.java | Updates Robolectric SDK config and clarifies test intent for padding retrieval failure path. |
| common/build.gradle | Updates buildsystem plugin, Kotlin compiler options configuration, publishing variant declarations, and output naming for AGP 9. |
| azure-pipelines/templates/steps/spotbugs.yml | Updates pipeline Java version default to 1.21. |
| azure-pipelines/templates/steps/continuous-delivery/assemble-publish-projversion.yml | Updates pipeline JDK selection to 1.21 for assemble/publish/test steps. |
| azure-pipelines/pull-request-validation/lab-utilities.yml | Updates PR validation JDK selection to 1.21. |
| azure-pipelines/pull-request-validation/common4j.yml | Updates PR validation JDK selection to 1.21. |
| azure-pipelines/pull-request-validation/common.yml | Updates PR validation JDK selection to 1.21 across build/test/lint steps. |
| azure-pipelines/pull-request-validation/build-consumers.yml | Updates consumer-build validation JDK selection to 1.21. |
Comment on lines
+19
to
+23
| kotlin { | ||
| compilerOptions { | ||
| jvmTarget = JvmTarget.JVM_1_8 | ||
| } | ||
| } |
Comment on lines
+15
to
+19
| kotlin { | ||
| compilerOptions { | ||
| jvmTarget = JvmTarget.JVM_1_8 | ||
| } | ||
| } |
Comment on lines
+489
to
+492
| @Test | ||
| @Config(sdk = Build.VERSION_CODES.LOLLIPOP) // API 21, before M | ||
| @Config(sdk = Build.VERSION_CODES.M) // API 23 (Robolectric 4.16 dropped SDK 21/22 emulation; the empty-list path here is SDK-independent - it comes from the mocked KeyPair failing, not the API level) | ||
| public void testGetKeyPairEncryptionPaddings_LegacyAPI_ReturnsEmptyList() { | ||
| // Act - Call the REAL method on legacy API | ||
| // Act - Call the REAL method; the mocked KeyPair drives the failure/empty path |
# Conflicts: # common/src/test/java/com/microsoft/identity/common/internal/util/AndroidKeyStoreUtilTest.java
|
Please refer to this document for more details. |
…atterns instead of reportLevel
…(Robolectric->Guava) not mirrored in internal feed
…tlin (built_in_kotlinc) so coverage includes Kotlin classes
…lds and publishes jacocoReportDev; PR jobs stay on JDK 21
…publishing jacocoReportDev
…-upgrade SpotBugs doesn't crash on JDK 21
…, InMemoryStorage Strengthens coverage of actively-used utility logic (URL/query-string parsing, Future completion/exception/timeout contract, in-memory storage semantics) to keep common4j line coverage at parity with dev after the toolchain upgrade.
…Test, drop InMemoryStorageTest) Adds StringUtilTest for pure string utilities (isUuid, join, home-account-id parsing, RFC3339 round-trip, null/empty arg validation). Trims UrlUtilTest to the value-bearing cases and asserts the MALFORMED_URL error code on the throwing paths. Removes InMemoryStorageTest (thin ConcurrentHashMap delegation). common4j line coverage remains above the dev baseline.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AB#3689049
Changes in this PR
SelfResolvingDependency); 2.2.21 is the version compatible with both Gradle 9 and AGP 9's built-in Kotlin.FingerprintManager, removed from API 37'sandroid.jar→ test compile fails.findProperty→providers.gradleProperty(...).getOrNull()pluginManagementcredentials.android.newDsl=falselibraryVariantsDSL usable under AGP 9. Remove before AGP 10.kotlin-androidplugin; added top-levelkotlin { compilerOptions };publishing { singleVariant }built_in_kotlinc/.../classessourceDirslaunch fix (Windows-gated)-sourcepath <all files>and overflows the Windows command-line limit; kept repo-local.org.jspecify:jspecifygenerateBuildConfigClasses,generated/sourcespath,useJavaOutput());java {}blocksourceDirsfix + exclude jspecifycommon.DMI_RANDOM_USED_ONLY_ONCE+ 20 new-detector patternsSecureRandomfalse positive.@Config(sdk = LOLLIPOP)→MsourceCompatibility/targetCompatibilityinjava {}sourceCompatibility/targetCompatibilityinjava {}generated/sourcespath,buildConfig {}scoping), removed top-levelsourceCompatibilityimport ...JvmTarget+ built-in Kotlin configproguard-android.txt→proguard-android-optimize.txtjavaVersion: 1.17+ SpotBugs runs lastjavaVersiondefault → 1.21