diff --git a/LabApiUtilities/build.gradle b/LabApiUtilities/build.gradle index 1e38bfae7e..95a3338147 100644 --- a/LabApiUtilities/build.gradle +++ b/LabApiUtilities/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'maven-publish' - id 'com.microsoft.identity.buildsystem' version '0.2.3' + id 'com.microsoft.identity.buildsystem' version '0.2.5' // the below build plugin allows to generate BuildConfig files in a JAVA gradle project. // BuildConfig files are generated by default in an Android project, however, a non-Android java diff --git a/azure-pipelines/pull-request-validation/build-consumers.yml b/azure-pipelines/pull-request-validation/build-consumers.yml index d0db31a005..8e12758d86 100644 --- a/azure-pipelines/pull-request-validation/build-consumers.yml +++ b/azure-pipelines/pull-request-validation/build-consumers.yml @@ -125,7 +125,7 @@ stages: displayName: Assemble msal inputs: jdkArchitecture: x64 - jdkVersionOption: "1.11" + jdkVersionOption: "1.17" tasks: clean msal:assembleLocal - template: ../templates/steps/automation-cert.yml - task: Gradle@3 @@ -133,7 +133,7 @@ stages: inputs: tasks: msal:testLocalDebugUnitTest -Plabtest -PlabSecret=$(LabVaultAppCert) -ProbolectricSdkVersion=${{variables.robolectricSdkVersion}} -PmockApiUrl=$(MOCK_API_URL) jdkArchitecture: x64 - jdkVersionOption: "1.11" + jdkVersionOption: "1.17" # broker - job: brokerValidation displayName: Broker @@ -171,13 +171,13 @@ stages: tasks: AADAuthenticator:clean AADAuthenticator:assembleLocal --build-cache --info publishJUnitResults: false jdkArchitecture: x64 - jdkVersionOption: "1.11" + jdkVersionOption: "1.17" - task: Gradle@3 displayName: Run broker Unit tests inputs: tasks: AADAuthenticator:localDebugAADAuthenticatorUnitTestCoverageReport --build-cache --info -Plabtest -PlabSecret=$(LabVaultAppCert) -ProbolectricSdkVersion=${{variables.robolectricSdkVersion}} -PpowerLiftApiKey=$(powerliftApiKey) -PcodeCoverageEnabled=true ${{variables.shouldSkipLongRunningTest}} jdkArchitecture: x64 - jdkVersionOption: "1.11" + jdkVersionOption: "1.17" # Linux broker - job: linuxBrokerValidation displayName: Linux Broker @@ -226,6 +226,7 @@ stages: tasks: LinuxBroker:clean LinuxBroker:assemble --build-cache --info publishJUnitResults: false jdkArchitecture: x86 + jdkVersionOption: "1.17" - task: Bash@3 displayName: Execute tests inputs: @@ -277,10 +278,10 @@ stages: inputs: tasks: clean adal:assembleLocal jdkArchitecture: x64 - jdkVersionOption: "1.11" + jdkVersionOption: "1.17" - task: Gradle@3 displayName: Run adal Unit tests inputs: tasks: adal:testLocalDebugUnitTest -Plabtest -ProbolectricSdkVersion=${{variables.robolectricSdkVersion}} -PlabSecret=$(LabVaultAppCert) jdkArchitecture: x64 - jdkVersionOption: "1.11" + jdkVersionOption: "1.17" diff --git a/azure-pipelines/pull-request-validation/common.yml b/azure-pipelines/pull-request-validation/common.yml index 723c43a576..fdf72d1072 100644 --- a/azure-pipelines/pull-request-validation/common.yml +++ b/azure-pipelines/pull-request-validation/common.yml @@ -38,7 +38,7 @@ jobs: displayName: Assemble Local inputs: javaHomeSelection: JDKVersion - jdkVersionOption: "1.11" + jdkVersionOption: "1.17" tasks: clean common:assembleLocal publishJUnitResults: false jdkArchitecture: x64 @@ -48,14 +48,14 @@ jobs: displayName: Run Unit tests inputs: javaHomeSelection: JDKVersion - jdkVersionOption: "1.11" + jdkVersionOption: "1.17" tasks: common:testLocalDebugUnitTest -PlabSecret=$(LabVaultAppCert) -PmockApiUrl=$(MOCK_API_URL) - task: Gradle@3 displayName: Check Dependencies size condition: eq(variables['system.pullRequest.targetBranch'], 'dev') inputs: tasks: common:dependenciesSizeCheck -PdependenciesSizeCheckConfig=distReleaseRuntimeClasspath - jdkVersionOption: "1.11" + jdkVersionOption: "1.17" - job: spotbugs displayName: SpotBugs @@ -68,6 +68,7 @@ jobs: - template: ../templates/steps/spotbugs.yml parameters: project: common + - job: lint displayName: Lint cancelTimeoutInMinutes: 1 @@ -87,5 +88,5 @@ jobs: tasks: clean common:lintLocalDebug publishJUnitResults: false javaHomeSelection: JDKVersion - jdkVersionOption: "1.11" + jdkVersionOption: "1.17" ... diff --git a/azure-pipelines/pull-request-validation/common4j.yml b/azure-pipelines/pull-request-validation/common4j.yml index 00edf78f1c..de2ca1639d 100644 --- a/azure-pipelines/pull-request-validation/common4j.yml +++ b/azure-pipelines/pull-request-validation/common4j.yml @@ -31,6 +31,8 @@ jobs: inputs: cwd: $(Build.SourcesDirectory)/common-java-root tasks: clean common4j:assemble + javaHomeOption: JDKVersion + jdkVersionOption: 1.17 - template: ../templates/steps/spotbugs.yml parameters: project: common4j @@ -41,4 +43,6 @@ jobs: inputs: cwd: $(Build.SourcesDirectory)/common-java-root tasks: common4j:test -Psugar=true -PmockApiUrl=$(MOCK_API_URL) + javaHomeOption: JDKVersion + jdkVersionOption: 1.17 ... diff --git a/azure-pipelines/pull-request-validation/lab-utilities.yml b/azure-pipelines/pull-request-validation/lab-utilities.yml index 11f18c89a0..46c5f64f7d 100644 --- a/azure-pipelines/pull-request-validation/lab-utilities.yml +++ b/azure-pipelines/pull-request-validation/lab-utilities.yml @@ -31,6 +31,8 @@ jobs: inputs: cwd: $(Build.SourcesDirectory)/common-java-root tasks: LabApiUtilities:clean LabApiUtilities:assemble + javaHomeSelection: JDKVersion + jdkVersionOption: "1.17" - template: ../templates/steps/spotbugs.yml parameters: project: LabApiUtilities @@ -41,4 +43,6 @@ jobs: inputs: cwd: $(Build.SourcesDirectory)/common-java-root tasks: LabApiUtilities:test -Psugar=true -PlabSecret=$(LabVaultAppCert) + javaHomeSelection: JDKVersion + jdkVersionOption: "1.17" ... diff --git a/azure-pipelines/templates/steps/continuous-delivery/assemble-publish-projversion.yml b/azure-pipelines/templates/steps/continuous-delivery/assemble-publish-projversion.yml index 33435226ef..c2167cfbdb 100644 --- a/azure-pipelines/templates/steps/continuous-delivery/assemble-publish-projversion.yml +++ b/azure-pipelines/templates/steps/continuous-delivery/assemble-publish-projversion.yml @@ -37,19 +37,19 @@ steps: displayName: Assemble ${{ parameters.project }} ${{ parameters.variant }} inputs: javaHomeSelection: JDKVersion - jdkVersionOption: "1.11" + jdkVersionOption: "1.17" tasks: '${{ parameters.project }}:clean ${{ parameters.project }}:assemble${{ parameters.variant }} ${{ parameters.buildArguments }}' - task: Gradle@2 displayName: Publish inputs: javaHomeSelection: JDKVersion - jdkVersionOption: "1.11" + jdkVersionOption: "1.17" tasks: '${{ parameters.project }}:publish${{ parameters.variant }} ${{ parameters.buildArguments }}' - task: Gradle@2 displayName: Run unit tests inputs: javaHomeSelection: JDKVersion - jdkVersionOption: "1.11" + jdkVersionOption: "1.17" tasks: '${{ parameters.project }}:test${{ parameters.variant }} -PlabSecret=$(LabVaultAppCert)' - ${{ if ne(parameters.artifactFolder, '') }}: - task: CopyFiles@2 diff --git a/azure-pipelines/templates/steps/spotbugs.yml b/azure-pipelines/templates/steps/spotbugs.yml index 67ee83e272..b8f25ef890 100644 --- a/azure-pipelines/templates/steps/spotbugs.yml +++ b/azure-pipelines/templates/steps/spotbugs.yml @@ -10,13 +10,14 @@ parameters: default: CodeAnalysisLogs - name: cwd default: $(Build.SourcesDirectory) - +- name: javaVersion + default: "1.17" steps: - task: Gradle@3 displayName: 'Run Spotbugs' inputs: javaHomeSelection: JDKVersion - jdkVersionOption: "1.11" + jdkVersionOption: ${{parameters.javaVersion}} jdkArchitecture: x64 cwd: ${{ parameters.cwd }} tasks: ${{ parameters.project }}:${{ parameters.spotbugsCommand }} diff --git a/changelog.txt b/changelog.txt index 0d8de7d0b3..b8b30657e4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -23,6 +23,7 @@ Version 21.0.0 - [PATCH] Fix multiple prompts issue in cross cloud request (#2599) - [PATCH] Corrected error handling in cross cloud scenario (#2602) - [MINOR] Native auth: Add claimsRequest also to getAccessToken and signIn after signUp/SSPR flows (#2622) +- [MINOR] Upgrading AGP Version to 8.1.1 (#2587) Version 20.1.1 ---------- diff --git a/common-java-root/gradle.properties b/common-java-root/gradle.properties index 4f7790b94f..b3d2a4a63d 100644 --- a/common-java-root/gradle.properties +++ b/common-java-root/gradle.properties @@ -10,7 +10,8 @@ org.gradle.daemon=true # See https://stackoverflow.com/questions/56075455/expiring-daemon-because-jvm-heap-space-is-exhausted # we must make sure that the total size is <7G, as that's the RAM size of VM on the build pipeline. -org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError +# 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 # This the TSL versionName... versionName=1.5.9 diff --git a/common-java-root/gradle/wrapper/gradle-wrapper.properties b/common-java-root/gradle/wrapper/gradle-wrapper.properties index 8049c684f0..d33f6a1a7e 100644 --- a/common-java-root/gradle/wrapper/gradle-wrapper.properties +++ b/common-java-root/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip + zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/common/build.gradle b/common/build.gradle index 727e3fc370..0f67103016 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'com.microsoft.identity.buildsystem' version '0.2.3' + id 'com.microsoft.identity.buildsystem' version '0.2.5' id 'com.android.library' id 'pmd' id 'checkstyle' @@ -61,7 +61,11 @@ android { buildConfigField("boolean", "trustDebugBrokerFlag", "$trustDebugBrokerFlag") buildConfigField("boolean", "bypassRedirectUriCheck", "$bypassRedirectUriCheck") } - + //aidl is being set to true since aidl only generated with this set + buildFeatures { + buildConfig = true + aidl = true + } buildTypes { debug { testCoverageEnabled enableCodeCoverage @@ -118,6 +122,7 @@ android { sourceSets { main { manifest.srcFile 'src/main/AndroidManifest.xml' + aidl.srcDirs = ['src/main/aidl'] // Also load source from common-java java.srcDirs = ['src/main/java', 'src/main/kotlin'] @@ -240,7 +245,7 @@ android.libraryVariants.all { variant -> // Create tasks to generate javadoc jar android.libraryVariants.all { variant -> task("${variant.name}JavadocJar", type: Jar, dependsOn: "${variant.name}Javadoc") { - classifier 'javadoc' + archiveClassifier.set('javadoc') from tasks["${variant.name}Javadoc"].destinationDir } } @@ -248,7 +253,7 @@ android.libraryVariants.all { variant -> tasks.register('sourcesJar', Jar) { from android.sourceSets.main.java.srcDirs - classifier 'sources' + archiveClassifier.set('sources') destinationDirectory = reporting.file("$project.buildDir/outputs/jar/") } @@ -284,11 +289,10 @@ tasks.register('pmd', Pmd) { source = fileTree('src/main/java') reports { - xml.enabled = false - html.enabled = true + xml.required = false + html.required = true } } - // For publishing to the remote maven repo. afterEvaluate { @@ -335,6 +339,7 @@ afterEvaluate { groupId 'com.microsoft.identity' artifactId 'common-debug' //Edit the 'version' here for VSTS RC build + version = project.version } } @@ -364,11 +369,34 @@ tasks.configureEach { task -> if (task.name == 'assembleDistRelease') { task.dependsOn 'sourcesJar' } + //Due to gradle version increase, we need to be more explicit in the dependency chain + // More information https://discuss.gradle.org/t/g./gradle-8-project-dependency-requirement-clarification/46336 + if (task.name == "publishDistDebugPublicationToVsts-maven-adal-androidRepository") { + task.dependsOn 'generatePomFileForDistReleasePublication' + } + if (task.name == "publishDistReleasePublicationToVsts-maven-adal-androidRepository") { + task.dependsOn 'bundleDistReleaseAar' + } + if (task.name == "publishDistDebugPublicationToVsts-maven-adal-androidRepository") { + task.dependsOn 'bundleDistReleaseAar' + } + if (task.name == "generateMetadataFileForDistDebugPublication") { + task.dependsOn 'bundleDistReleaseAar' + } + if (task.name == "generateMetadataFileForDistReleasePublication") { + task.dependsOn 'bundleDistDebugAar' + } } -// This is used to generate the pom file for publishing to external maven in maven-release-jobs.yml +// This is used to generate the pom file for publishing to external maven in maven-release-jobs.yml. +// Need to distinguish between distDebug and distRelease for the distination tasks.withType(GenerateMavenPom).all { - destination = layout.buildDirectory.file("poms/${project.name}-${project.version}.pom").get().asFile + def functionName = name.toLowerCase() + if (functionName.contains("distdebug")) { + destination = layout.buildDirectory.file("poms/common-debug-${project.version}.pom").get().asFile + } else if (functionName.contains("distrelease")) { + destination = layout.buildDirectory.file("poms/common-${project.version}.pom").get().asFile + } } def dependenciesSizeInMb = project.hasProperty("dependenciesSizeMb") ? project.dependenciesSizeMb : "15" diff --git a/common4j/build.gradle b/common4j/build.gradle index 997eee0854..380c8f1098 100644 --- a/common4j/build.gradle +++ b/common4j/build.gradle @@ -8,7 +8,7 @@ plugins { id 'java-library' - id 'com.microsoft.identity.buildsystem' version '0.2.3' + id 'com.microsoft.identity.buildsystem' version '0.2.5' id 'maven-publish' // the below build plugin allows to generate BuildConfig files in a JAVA gradle project. @@ -61,13 +61,15 @@ project.ext.vstsPassword = System.getenv("ENV_VSTS_MVN_ANDROIDCOMMON_ACCESSTOKEN version = getAppVersionName() task sourcesJar(type: Jar) { + dependsOn generateBuildConfig from sourceSets.main.java.srcDirs - classifier 'sources' + archiveClassifier.set('sources') destinationDirectory = reporting.file("$project.buildDir/outputs/jars") } // Task to generate javadoc task generateJavadoc(type: Javadoc) { + dependsOn generateBuildConfig failOnError false title = "Microsoft Identity Common Java" source = sourceSets.main.java @@ -84,7 +86,7 @@ task generateJavadoc(type: Javadoc) { // Task to generate javadoc.jar task javadocJar(type: Jar, dependsOn: generateJavadoc) { from javadoc.destinationDir - classifier 'javadoc' + archiveClassifier.set('javadoc') destinationDirectory = reporting.file("$project.buildDir/outputs/jars") } diff --git a/common4j/gradle/wrapper/gradle-wrapper.properties b/common4j/gradle/wrapper/gradle-wrapper.properties index 8049c684f0..0ad737d55f 100644 --- a/common4j/gradle/wrapper/gradle-wrapper.properties +++ b/common4j/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradle.properties b/gradle.properties index 633f670803..b3c808ca91 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,8 @@ org.gradle.daemon=true # See https://stackoverflow.com/questions/56075455/expiring-daemon-because-jvm-heap-space-is-exhausted # we must make sure that the total size is <7G, as that's the RAM size of VM on the build pipeline. -org.gradle.jvmargs=-Xmx3072m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError +# 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 # This the TSL versionName... versionName=1.5.9 diff --git a/gradle/versions.gradle b/gradle/versions.gradle index 9d2f00350b..3d3ec0f7db 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -10,7 +10,7 @@ ext { buildToolsVersion = "28.0.3" // Plugins - gradleVersion = '7.4.2' + gradleVersion = '8.1.1' kotlinVersion = '1.7.21' spotBugsGradlePluginVersion = '4.7.1' jupiterApiVersion = '5.6.0' @@ -47,7 +47,7 @@ ext { uiAutomatorVersion = "2.2.0" daggerVersion = "2.31.2" daggerCompilerVersion = "2.31.2" - msal4jVersion = "1.10.0" + msal4jVersion = "1.20.1" moshiVersion = "1.14.0" moshiAdaptersVersion = "1.14.0" openpojoVersion = "0.9.1" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 30f80bdcf1..d536f56aaa 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip diff --git a/testutils/build.gradle b/testutils/build.gradle index a91beea3b7..6db1e7e28f 100644 --- a/testutils/build.gradle +++ b/testutils/build.gradle @@ -10,6 +10,8 @@ project.ext.vstsUsername = System.getenv("ENV_VSTS_MVN_ANDROIDCOMMON_USERNAME") project.ext.vstsPassword = System.getenv("ENV_VSTS_MVN_ANDROIDCOMMON_ACCESSTOKEN") != null ? System.getenv("ENV_VSTS_MVN_ANDROIDCOMMON_ACCESSTOKEN") : project.findProperty("vstsMavenAccessToken") android { + namespace "com.microsoft.identity.internal.testutils" + compileSdk rootProject.ext.compileSdkVersion testOptions { @@ -73,7 +75,9 @@ android { lintOptions { disable 'InvalidPackage' } - + buildFeatures { + buildConfig = true + } buildTypes { debug { testCoverageEnabled false @@ -97,9 +101,10 @@ android { task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier 'sources' + archiveClassifier.set('sources') } + tasks.whenTaskAdded { task -> if (task.name == 'assembleDebug' || task.name == 'assembleRelease') { task.dependsOn 'sourcesJar' diff --git a/testutils/src/main/AndroidManifest.xml b/testutils/src/main/AndroidManifest.xml index dad502773a..bdae66c8f5 100644 --- a/testutils/src/main/AndroidManifest.xml +++ b/testutils/src/main/AndroidManifest.xml @@ -1,3 +1,2 @@ - + diff --git a/uiautomationutilities/build.gradle b/uiautomationutilities/build.gradle index b90a2eacc8..daacfcf696 100644 --- a/uiautomationutilities/build.gradle +++ b/uiautomationutilities/build.gradle @@ -21,7 +21,7 @@ if (project.hasProperty("uiElementTimeout")) { } android { - + namespace "com.microsoft.identity.client.ui.automation" testOptions { compileOptions { // Flag to enable support for the new language APIs @@ -35,7 +35,9 @@ android { } animationsDisabled = true } - + buildFeatures { + buildConfig = true + } //Commenting out until the next major version of common/msal/etc... /* compileOptions { @@ -148,9 +150,10 @@ android { task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier 'sources' + archiveClassifier.set('sources') } + tasks.whenTaskAdded { task -> if (task.name == 'assembleDebug' || task.name == 'assembleRelease') { task.dependsOn 'sourcesJar' diff --git a/uiautomationutilities/src/main/AndroidManifest.xml b/uiautomationutilities/src/main/AndroidManifest.xml index 0e3553496b..c4e6c98d77 100644 --- a/uiautomationutilities/src/main/AndroidManifest.xml +++ b/uiautomationutilities/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - +