Skip to content

Conversation

@somalaya
Copy link
Contributor

@somalaya somalaya commented May 27, 2025

Reverts #2587

Reverting since the builds are failing after this change.

Fixes AB#2779502

Copilot AI review requested due to automatic review settings May 27, 2025 23:37
@somalaya somalaya requested review from a team as code owners May 27, 2025 23:37
@github-actions
Copy link

❌ Work item link check failed. Description does not contain AB#{ID}.

Click here to Learn more.

Copy link
Contributor

Copilot AI left a comment

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 reverts recent upgrades to Gradle, Android Gradle Plugin, and related build configurations because the builds started failing after moving to AGP 8.1.1 and Gradle 8.1.

  • Downgraded Gradle wrapper distributions back to Gradle 7.5 across multiple modules
  • Reverted plugin and library versions (AGP, msal4j, com.microsoft.identity.buildsystem) to previous stable releases
  • Restored original build feature and manifest namespace settings in automation/test modules

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
gradle/wrapper/gradle-wrapper.properties Revert Gradle distribution URL to 7.5
gradle/versions.gradle Roll back AGP, msal4j, and Gradle version settings
common/build.gradle Revert buildsystem plugin version, buildConfig, and AIDL setup
uiautomationutilities/build.gradle Restore namespace and BuildConfig feature for UI automation
testutils/build.gradle Restore namespace and BuildConfig feature for test utilities
gradle.properties Switch back to MaxMetaspaceSize instead of MaxPermSize
Comments suppressed due to low confidence (5)

uiautomationutilities/build.gradle:23

  • Removing the namespace declaration can prevent correct package resolution for the UI automation module. It should be restored.
-    namespace "com.microsoft.identity.client.ui.automation"

uiautomationutilities/build.gradle:37

  • The buildConfig feature was disabled here; code referencing BuildConfig constants may now fail. Consider re-enabling buildConfig.
-    buildFeatures {

common4j/build.gradle:63

  • Removing the generateBuildConfig dependency can prevent BuildConfig classes from being generated. Re-add the dependency to ensure build config values are available.
-    dependsOn generateBuildConfig

common/build.gradle:61

  • Disabling buildConfig and aidl build features may break code that relies on generated AIDL bindings or BuildConfig constants. Consider restoring those blocks.
-    buildFeatures {

testutils/src/main/AndroidManifest.xml:1

  • The manifest element is missing the Android XML namespace declaration (xmlns:android). Without it, resource attributes may not resolve correctly.
<manifest

# we must make sure that the total size is <7G, as that's the RAM size of VM on the build pipeline.
# MaxMetaspaceSize replaced MaxPermSize as of java 8+.https://www.oracle.com/java/technologies/javase/8-whats-new.html
org.gradle.jvmargs=-Xmx3072m -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.jvmargs=-Xmx3072m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

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

The -XX:MaxPermSize flag is not supported on Java 8+; it should use -XX:MaxMetaspaceSize instead.

Suggested change
org.gradle.jvmargs=-Xmx3072m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.jvmargs=-Xmx3072m -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError

Copilot uses AI. Check for mistakes.
} else if (functionName.contains("distrelease")) {
destination = layout.buildDirectory.file("poms/common-${project.version}.pom").get().asFile
}
destination = layout.buildDirectory.file("poms/${project.name}-${project.version}.pom").get().asFile
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

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

The POM generation logic no longer differentiates between debug and release artifacts, which can lead to incorrect POM filenames. Restore conditional naming to match artifact variants.

Suggested change
destination = layout.buildDirectory.file("poms/${project.name}-${project.version}.pom").get().asFile
def variant = project.hasProperty("buildVariant") ? project.buildVariant : "default"
destination = layout.buildDirectory.file("poms/${project.name}-${project.version}-${variant}.pom").get().asFile

Copilot uses AI. Check for mistakes.
# we must make sure that the total size is <7G, as that's the RAM size of VM on the build pipeline.
# MaxMetaspaceSize replaced MaxPermSize as of java 8+.https://www.oracle.com/java/technologies/javase/8-whats-new.html
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

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

Similar to above, -XX:MaxPermSize is obsolete on Java 8+; switch back to -XX:MaxMetaspaceSize to avoid JVM startup errors.

Suggested change
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError

Copilot uses AI. Check for mistakes.
somalaya added a commit to AzureAD/android-complete that referenced this pull request May 27, 2025
@github-actions
Copy link

✅ Work item link check complete. Description contains link AB#2779502 to an Azure Boards work item.

@somalaya somalaya added skip AB ID validation No-Changelog This Pull-Request has no associated changelog entry. Skip-Consumers-Check Only include this if making a breaking change purposefully, and there is an MSAL/ADAL/Broker PR labels May 27, 2025
@somalaya somalaya merged commit 654872f into dev May 28, 2025
56 of 63 checks passed
somalaya added a commit that referenced this pull request Jun 23, 2025
Reverts #2651

Same as this PR created by Jeffrey --
#2587

I previously merged the above PR and realized that it was some extra
changes were needed in related broker PR and there was not enough time
to make the changes, So I reverted it.

Successful builds : 
common4j Build and Test :
https://identitydivision.visualstudio.com/Engineering/_build/results?buildId=1493462&view=results
common Build and Test :
https://identitydivision.visualstudio.com/Engineering/_build/results?buildId=1493463&view=results

Fixes
[AB#2779502](https://identitydivision.visualstudio.com/fac9d424-53d2-45c0-91b5-ef6ba7a6bf26/_workitems/edit/2779502)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No-Changelog This Pull-Request has no associated changelog entry. Skip-Consumers-Check Only include this if making a breaking change purposefully, and there is an MSAL/ADAL/Broker PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants