Skip to content

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
devfrom
ridamarora/sdkupgrade
Open

Upgrade Android SDK used in common lib to Android 17, targets AB#3689049, Fixes AB#3689049#3186
ridam-arora wants to merge 15 commits into
devfrom
ridamarora/sdkupgrade

Conversation

@ridam-arora

@ridam-arora ridam-arora commented Jul 15, 2026

Copy link
Copy Markdown

AB#3689049

Changes in this PR

File Type Change Why
gradle/wrapper/gradle-wrapper.properties Upgrade target Gradle 8.11.1 → 9.3.1 Core upgrade goal (Gradle 9).
gradle/versions.gradle Upgrade target compileSdk & buildToolsVersion → 37, AGP → 9.1.1, targetSdk kept at 36 Android API 37 + AGP 9; targetSdk is a runtime opt-in, out of scope.
gradle/versions.gradle Forced by Gradle 9 Kotlin 1.8 → 2.2.21 Kotlin 1.8 crashes on Gradle 9 (removed SelfResolvingDependency); 2.2.21 is the version compatible with both Gradle 9 and AGP 9's built-in Kotlin.
gradle/versions.gradle Forced by compileSdk 37 Robolectric 4.14 → 4.16.1 4.14 hard-references FingerprintManager, removed from API 37's android.jar → test compile fails.
settings.gradle Forced by Gradle 9 findPropertyproviders.gradleProperty(...).getOrNull() Gradle 9 changed property access in pluginManagement credentials.
gradle.properties Forced by AGP 9 (stopgap) Added android.newDsl=false Keeps the legacy libraryVariants DSL usable under AGP 9. Remove before AGP 10.
common/build.gradle Forced by AGP 9 Removed kotlin-android plugin; added top-level kotlin { compilerOptions }; publishing { singleVariant } AGP 9 has built-in Kotlin (old plugin gone); publishing components are no longer auto-created.
common/build.gradle Forced by AGP 9 jacoco Kotlin classDir → built_in_kotlinc/.../classes AGP 9 moved compiled Kotlin classes; the old path was empty, silently dropping Kotlin from coverage.
common/build.gradle Forced by SpotBugs 6.x Windows sourceDirs launch fix (Windows-gated) 6.x emits -sourcepath <all files> and overflows the Windows command-line limit; kept repo-local.
common/build.gradle Dependency / feed Exclude org.jspecify:jspecify Robolectric 4.16.1 → Guava 33.4.8 pulls jspecify 1.0.0, not mirrored in the internal feed; compile-only annotations, safe to exclude.
common4j/build.gradle Forced by Gradle 9 buildsystem → 0.2.6, gmazzo buildconfig 3.0.0 → 6.0.10 (generateBuildConfigClasses, generated/sources path, useJavaOutput()); java {} block Old buildconfig plugin & top-level convention props are incompatible with Gradle 9.
common4j/build.gradle Forced by SpotBugs 6.x / Dependency Windows sourceDirs fix + exclude jspecify Same SpotBugs and jspecify reasons as common.
config/spotbugs/exclude.xml Forced by SpotBugs 6.x Added class-scoped DMI_RANDOM_USED_ONLY_ONCE + 20 new-detector patterns Gradle 9 forced SpotBugs 4.7→6.x, which flags new findings on unchanged code; DMI is a SecureRandom false positive.
common/src/test/.../AndroidKeyStoreUtilTest.java Forced by compileSdk 37 / Robolectric @Config(sdk = LOLLIPOP)M Robolectric can't emulate the old scenario; the assertion is mock-driven/SDK-independent.
keyvault/build.gradle Forced by Gradle 9 Wrap sourceCompatibility/targetCompatibility in java {} Gradle 9 removed the top-level convention properties.
labapi/build.gradle Forced by Gradle 9 Wrap sourceCompatibility/targetCompatibility in java {} Same as keyvault.
LabApiUtilities/build.gradle Forced by Gradle 9 buildsystem 0.2.5 → 0.2.6, gmazzo 3.0.0 → 6.0.10 (task renames, generated/sources path, buildConfig {} scoping), removed top-level sourceCompatibility Gradle 9 / gmazzo 6 migration.
testutils/build.gradle Forced by AGP 9 import ...JvmTarget + built-in Kotlin config AGP 9 built-in Kotlin DSL.
uiautomationutilities/build.gradle Forced by AGP 9 proguard-android.txtproguard-android-optimize.txt AGP 9 dropped the non-optimized default proguard file.
azure-pipelines/.../common.yml CI (JDK) PR jobs JDK 1.17 → 1.21; dev-baseline job kept on 1.17 JDK 21 required by AGP 9/Gradle 9; the dev-baseline job builds dev's old code (⚠️ flip to 1.21 post-merge).
azure-pipelines/.../common4j.yml CI (JDK) PR job → 1.21; dev-baseline → 1.17 + SpotBugs javaVersion: 1.17 + SpotBugs runs last Same JDK reason; run dev's old SpotBugs under JDK 17, after the coverage artifact publishes.
azure-pipelines/templates/steps/spotbugs.yml CI (JDK) javaVersion default → 1.21 New-toolchain default; per-call overridable (dev-baseline passes 1.17).
azure-pipelines/.../build-consumers.yml CI (JDK) Consumer (MSAL/broker) jobs 1.17 → 1.21 New toolchain; consumer validation is skipped via label until MSAL/broker adopt the same toolchain.
azure-pipelines/.../lab-utilities.yml CI (JDK) 1.17 → 1.21 New toolchain.
azure-pipelines/vsts-releases/assemble-publish-projversion.yml CI (JDK) 1.17 → 1.21 New toolchain.

@ridam-arora
ridam-arora requested a review from a team as a code owner July 15, 2026 22:11
Copilot AI review requested due to automatic review settings July 15, 2026 22:11
@ridam-arora ridam-arora changed the title Upgrade Android SDK used in common lib to Android 17, tagrtes AB#3689049 Upgrade Android SDK used in common lib to Android 17, targets AB#3689049 Jul 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 of kotlin { 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 thread common/build.gradle
Comment on lines +19 to +23
kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}
Comment thread testutils/build.gradle
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
@github-actions

Copy link
Copy Markdown

⚠️ Warning: Changes detected in the 'versions.gradle' file! ⚠️

Please refer to this document for more details.

@github-actions github-actions Bot changed the title Upgrade Android SDK used in common lib to Android 17, targets AB#3689049 Upgrade Android SDK used in common lib to Android 17, targets AB#3689049, Fixes AB#3689049 Jul 15, 2026
@ridam-arora
ridam-arora requested a review from a team as a code owner July 20, 2026 21:49
…, 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants