Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle version change from APG 7.4.2 to 8.1.1 #2587

Open
wants to merge 19 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions LabApiUtilities/build.gradle
Original file line number Diff line number Diff line change
@@ -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.4'

// 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
Expand All @@ -24,8 +24,8 @@ if (project.hasProperty("labSecret")) {
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

buildSystem {
Expand Down
14 changes: 7 additions & 7 deletions azure-pipelines/pull-request-validation/build-consumers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ 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
displayName: Run msal Unit tests
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
Expand Down Expand Up @@ -169,13 +169,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
Expand Down Expand Up @@ -211,7 +211,7 @@ stages:
tasks: LinuxBroker:clean LinuxBroker:assemble --build-cache --info
publishJUnitResults: false
jdkArchitecture: x64
jdkVersionOption: "1.11"
jdkVersionOption: "1.17"
- task: Bash@3
retryCountOnTaskFailure: 3
displayName: Execute tests
Expand Down Expand Up @@ -264,10 +264,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"
9 changes: 5 additions & 4 deletions azure-pipelines/pull-request-validation/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -68,6 +68,7 @@ jobs:
- template: ../templates/steps/spotbugs.yml
parameters:
project: common

- job: lint
displayName: Lint
cancelTimeoutInMinutes: 1
Expand All @@ -87,5 +88,5 @@ jobs:
tasks: clean common:lintLocalDebug
publishJUnitResults: false
javaHomeSelection: JDKVersion
jdkVersionOption: "1.11"
jdkVersionOption: "1.17"
...
5 changes: 3 additions & 2 deletions azure-pipelines/templates/steps/spotbugs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ parameters:

steps:
- task: Gradle@3
displayName: 'Run Spotbugs'
displayName: 'Run SpotbugsTEST'
inputs:
javaHomeSelection: JDKVersion
jdkVersionOption: "1.11"
jdkVersionOption: "1.17"
jdkVersion: 1.17
jdkArchitecture: x64
cwd: ${{ parameters.cwd }}
tasks: ${{ parameters.project }}:${{ parameters.spotbugsCommand }}
Expand Down
3 changes: 2 additions & 1 deletion common-java-root/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
#org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError

# This the TSL versionName...
versionName=1.5.9
Expand Down
4 changes: 3 additions & 1 deletion common-java-root/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
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-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip

zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
54 changes: 46 additions & 8 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.microsoft.identity.buildsystem' version '0.2.3'
id 'com.microsoft.identity.buildsystem' version '0.2.4'
id 'com.android.library'
id 'pmd'
id 'checkstyle'
Expand Down Expand Up @@ -61,7 +61,10 @@ android {
buildConfigField("boolean", "trustDebugBrokerFlag", "$trustDebugBrokerFlag")
buildConfigField("boolean", "bypassRedirectUriCheck", "$bypassRedirectUriCheck")
}

buildFeatures {
buildConfig = true
aidl = true
}
buildTypes {
debug {
testCoverageEnabled enableCodeCoverage
Expand Down Expand Up @@ -113,11 +116,16 @@ android {
dist {
dimension "main"
}
production{
dimension "main"
matchingFallbacks = ['dist']
}
}

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']
Expand Down Expand Up @@ -240,15 +248,16 @@ 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
}
}


tasks.register('sourcesJar', Jar) {
from android.sourceSets.main.java.srcDirs
classifier 'sources'
// classifier 'sources'
archiveClassifier.set('sources')
destinationDirectory = reporting.file("$project.buildDir/outputs/jar/")
}

Expand Down Expand Up @@ -284,18 +293,20 @@ tasks.register('pmd', Pmd) {
source = fileTree('src/main/java')

reports {
xml.enabled = false
html.enabled = true
xml.required = false
html.required = true
}
}

println "Project version: ${project.version}"
// For publishing to the remote maven repo.
afterEvaluate {

publishing {
publications {
distRelease(MavenPublication) {
from components.distRelease
println "Components1: ${components.distRelease}"
println "pname: ${project.name}"
groupId 'com.microsoft.identity'
artifactId 'common'
//Edit the 'version' here for VSTS RC build
Expand Down Expand Up @@ -332,10 +343,16 @@ afterEvaluate {
}
distDebug(MavenPublication) {
from components.distDebug
println "Components2: ${components.distDebug}"
println "pname: ${project.name}"

// withoutComponent()
groupId 'com.microsoft.identity'
artifactId 'common-debug'
//Edit the 'version' here for VSTS RC build

version = project.version
// artifact{"$buildDir/outputs/aar/common-debug-${project.version}.aar"}
}
}

Expand Down Expand Up @@ -364,11 +381,32 @@ tasks.configureEach { task ->
if (task.name == 'assembleDistRelease') {
task.dependsOn 'sourcesJar'
}
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
tasks.withType(GenerateMavenPom).all {
destination = layout.buildDirectory.file("poms/${project.name}-${project.version}.pom").get().asFile
println "Generating POM: ${name}"
if (name.contains("distDebug")) {
destination = layout.buildDirectory.file("poms/common-debug-${project.version}.pom").get().asFile
} else if (name.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
}

def dependenciesSizeInMb = project.hasProperty("dependenciesSizeMb") ? project.dependenciesSizeMb : "15"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

import static com.microsoft.identity.common.adal.internal.AuthenticationConstants.Broker.BROKER_ACTIVITY_NAME;
import static com.microsoft.identity.common.adal.internal.AuthenticationConstants.Broker.BROKER_PACKAGE_NAME;
//import static com.microsoft.identity.common.adal.internal.AuthenticationConstants.BrokerContentProvider.API.MSAL_HELLO;
import static com.microsoft.identity.common.exception.BrokerCommunicationException.Category.OPERATION_NOT_SUPPORTED_ON_CLIENT_SIDE;
import static com.microsoft.identity.common.internal.broker.ipc.IIpcStrategy.Type.BOUND_SERVICE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ package com.microsoft.identity.common.sharedwithoneauth

import android.content.Context
import androidx.annotation.WorkerThread

import android.os.IInterface


import com.microsoft.identity.common.components.AndroidPlatformComponentsFactory
import com.microsoft.identity.common.internal.broker.BoundServiceClient
import com.microsoft.identity.common.internal.broker.MicrosoftAuthClient
import com.microsoft.identity.common.internal.broker.ipc.AccountManagerAddAccountStrategy
import com.microsoft.identity.common.internal.broker.ipc.BoundServiceStrategy
Expand Down Expand Up @@ -81,12 +86,13 @@ class OneAuthSharedFunctions {
sb.append("ContentProviderStrategy, ")
strategies.add(contentProviderStrategy)
}
// val boundServiceStrategy = BoundServiceStrategy(MicrosoftAuthClient(context) as BoundServiceClient<IMicrosoftAuthService>)
// val boundServiceStrategy = BoundServiceStrategy(MicrosoftAuthClient(context))

val boundServiceStrategy = BoundServiceStrategy(MicrosoftAuthClient(context))
if (boundServiceStrategy.isSupportedByTargetedBroker(activeBrokerPackageName)) {
sb.append("BoundServiceStrategy, ")
strategies.add(boundServiceStrategy)
}
// if (boundServiceStrategy.isSupportedByTargetedBroker(activeBrokerPackageName)) {
// sb.append("BoundServiceStrategy, ")
// strategies.add(boundServiceStrategy)
// }

val accountManagerStrategy = AccountManagerAddAccountStrategy(context)
if (accountManagerStrategy.isSupportedByTargetedBroker(activeBrokerPackageName)) {
Expand Down
11 changes: 8 additions & 3 deletions common4j/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.4'
id 'maven-publish'

// the below build plugin allows to generate BuildConfig files in a JAVA gradle project.
Expand Down Expand Up @@ -61,14 +61,18 @@ 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'
// classifier 'sources'
archiveClassifier.set('sources')
destinationDirectory = reporting.file("$project.buildDir/outputs/jars")
}

// Task to generate javadoc
task generateJavadoc(type: Javadoc) {
dependsOn generateBuildConfig
failOnError false
dependsOn
title = "Microsoft Identity Common Java"
source = sourceSets.main.java
classpath += project.sourceSets.main.compileClasspath
Expand All @@ -84,7 +88,8 @@ task generateJavadoc(type: Javadoc) {
// Task to generate javadoc.jar
task javadocJar(type: Jar, dependsOn: generateJavadoc) {
from javadoc.destinationDir
classifier 'javadoc'
// classifier 'javadoc'
archiveClassifier.set('javadoc')
destinationDirectory = reporting.file("$project.buildDir/outputs/jars")
}

Expand Down
4 changes: 3 additions & 1 deletion common4j/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
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-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip

zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
#org.gradle.jvmargs=-Xmx3072m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.jvmargs=-Xmx3072m -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError

# This the TSL versionName...
versionName=1.5.9
Expand Down
5 changes: 3 additions & 2 deletions gradle/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ ext {
compileSdkVersion = 34
buildToolsVersion = "28.0.3"

// Plugins
gradleVersion = '7.4.2'
// Pluginssssss
// gradleVersion = '7.4.2'
gradleVersion = '8.1.1'
kotlinVersion = '1.7.21'
spotBugsGradlePluginVersion = '4.7.1'
jupiterApiVersion = '5.6.0'
Expand Down
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ 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-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip
Loading
Loading