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

Target, compile SDK, AGP and gradle versions increased #1755

Merged
merged 4 commits into from
Aug 24, 2023
Merged
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
18 changes: 10 additions & 8 deletions adal/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}

compileSdkVersion rootProject.ext.compileSdkVersion
compileSdk rootProject.ext.compileSdkVersion

defaultConfig {
multiDexEnabled true
Expand Down Expand Up @@ -190,7 +190,8 @@ task sourcesJar(type: Jar) {
task javadoc(type: Javadoc) {
failOnError false
source = android.sourceSets.main.java.srcDirs
classpath += configurations.compile
configurations.implementation.setCanBeResolved(true)
classpath += configurations.implementation
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.javadocDeps
exclude '**/*.aidl'
Expand All @@ -206,10 +207,11 @@ task javadoc(type: Javadoc) {
destinationDir = reporting.file("$project.buildDir/outputs/jar/javadoc/")
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
tasks.register('javadocJar', Jar) {
dependsOn javadoc
classifier 'javadoc'
from javadoc.destinationDir
destinationDir = reporting.file("$project.buildDir/outputs/jar/")
destinationDirectory = reporting.file("$project.buildDir/outputs/jar/")
}

// For publishing to the remote maven repo.
Expand Down Expand Up @@ -323,7 +325,7 @@ pmd {
reportsDir = file("$project.buildDir/outputs/")
}

task pmd(type: Pmd) {
tasks.register('pmd', Pmd) {
description 'Run pmd'
group 'verification'

Expand All @@ -344,7 +346,7 @@ checkstyle {
reportsDir = file("$project.buildDir/outputs/")
}

task checkstyle(type: Checkstyle) {
tasks.register('checkstyle', Checkstyle) {
configFile file("${project.rootDir}/config/checkstyle/checkstyle.xml")

configProperties.checkstyleConfigDir = checkstyleConfigDir
Expand All @@ -355,7 +357,7 @@ task checkstyle(type: Checkstyle) {
classpath = files()
}

tasks.whenTaskAdded { task ->
tasks.configureEach { task ->
if (task.name == 'assembleDebug' || task.name == 'assembleRelease') {
task.dependsOn 'checkstyle', 'pmd', 'lint'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import javax.crypto.spec.SecretKeySpec;

import static androidx.test.InstrumentationRegistry.getContext;
import static androidx.test.core.app.ApplicationProvider.getApplicationContext;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
Expand Down Expand Up @@ -101,8 +102,7 @@ public void setUp() throws Exception {

System.setProperty(
"org.mockito.android.target",
ApplicationProvider
.getApplicationContext()
getApplicationContext()
.getCacheDir()
.getPath()
);
Expand Down Expand Up @@ -130,7 +130,7 @@ public void tearDown() {
@SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.M)
public void testRefreshTokenFailedNoNetworkAppIsInactive() {
FileMockContext mockContext = new FileMockContext(getContext());
FileMockContext mockContext = new FileMockContext(getApplicationContext());
mockContext.setAppInactive();
ITokenCacheStore mockCache = getCacheForRefreshToken(TEST_IDTOKEN_USERID, TEST_IDTOKEN_UPN);

Expand All @@ -157,7 +157,7 @@ public void testRefreshTokenFailedNoNetworkAppIsInactive() {
@SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.M)
public void testRefreshTokenFailedNoNetworkDeviceIsIdle() {
FileMockContext mockContext = new FileMockContext(getContext());
FileMockContext mockContext = new FileMockContext(getApplicationContext());
mockContext.setDeviceInIdleMode();
ITokenCacheStore mockCache = getCacheForRefreshToken(TEST_IDTOKEN_USERID, TEST_IDTOKEN_UPN);

Expand All @@ -184,7 +184,7 @@ public void testRefreshTokenFailedNoNetworkDeviceIsIdle() {
@Test
public void testRefreshTokenWebRequestHasError() throws IOException {

FileMockContext mockContext = new FileMockContext(getContext());
FileMockContext mockContext = new FileMockContext(getApplicationContext());
ITokenCacheStore mockCache = getCacheForRefreshToken(TEST_IDTOKEN_USERID, TEST_IDTOKEN_UPN);

final String resource = "resource";
Expand Down Expand Up @@ -231,8 +231,8 @@ public void testRefreshTokenWebRequestHasError() throws IOException {
// Verify if regular RT exists, if the RT is not MRRT, we only redeem token with the regular RT.
@Test
public void testRegularRT() throws IOException, JSONException {
FileMockContext mockContext = new FileMockContext(getContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getContext());
FileMockContext mockContext = new FileMockContext(getApplicationContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getApplicationContext());
final String resource = "resource";
final String clientId = "clientId";

Expand Down Expand Up @@ -293,8 +293,8 @@ public void testRegularRT() throws IOException, JSONException {
// Test the current cache that does not mark RT as MRRT even it's MRRT.
@Test
public void testRegularRTExistsMRRTForSameClientIdExist() throws IOException, JSONException {
FileMockContext mockContext = new FileMockContext(getContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getContext());
FileMockContext mockContext = new FileMockContext(getApplicationContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getApplicationContext());
final String resource = "resource";
final String clientId = "clientId";

Expand Down Expand Up @@ -357,8 +357,8 @@ public void testRegularRTExistsMRRTForSameClientIdExist() throws IOException, JS
*/
@Test
public void testMRRTSuccessNoFoCI() throws IOException, JSONException {
FileMockContext mockContext = new FileMockContext(getContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getContext());
FileMockContext mockContext = new FileMockContext(getApplicationContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getApplicationContext());
final String resource = "resource";
final String clientId = "clientId";

Expand Down Expand Up @@ -414,7 +414,7 @@ public void testMRRTSuccessNoFoCI() throws IOException, JSONException {
@Test
public void testFRTSuccess() throws IOException, JSONException {

FileMockContext mockContext = new FileMockContext(getContext());
FileMockContext mockContext = new FileMockContext(getApplicationContext());
final ITokenCacheStore mockCache = new DefaultTokenCacheStore(mockContext);

// note: if only FRT exists, cache key will be hard-coded to 1
Expand Down Expand Up @@ -479,7 +479,7 @@ private void addAzureADCloudForValidAuthority() {
@Test
public void testFRTFailedWithInvalidGrant() throws IOException, JSONException {

FileMockContext mockContext = new FileMockContext(getContext());
FileMockContext mockContext = new FileMockContext(getApplicationContext());
final ITokenCacheStore mockCache = new DefaultTokenCacheStore(mockContext);
mockCache.removeAll();

Expand Down Expand Up @@ -525,8 +525,8 @@ public void testFRTFailedWithInvalidGrant() throws IOException, JSONException {
@Test
public void testFRTRequestFailedFallBackMRRTRequest() throws IOException, JSONException {

FileMockContext mockContext = new FileMockContext(getContext());
final ITokenCacheStore mockCache = new DefaultTokenCacheStore(getContext());
FileMockContext mockContext = new FileMockContext(getApplicationContext());
final ITokenCacheStore mockCache = new DefaultTokenCacheStore(getApplicationContext());
final String clientId = "clientId";
final String familyClientId = "familyClientId";

Expand Down Expand Up @@ -592,8 +592,8 @@ public void testFRTRequestFailedFallBackMRRTRequest() throws IOException, JSONEx
*/
@Test
public void testFRTRequestFailFallBackToMRTMRTRequestFail() throws IOException, JSONException {
FileMockContext mockContext = new FileMockContext(getContext());
final ITokenCacheStore mockCache = new DefaultTokenCacheStore(getContext());
FileMockContext mockContext = new FileMockContext(getApplicationContext());
final ITokenCacheStore mockCache = new DefaultTokenCacheStore(getApplicationContext());
mockCache.removeAll();
final String clientId = "clientId";
final String familyClientId = "familyClientId";
Expand Down Expand Up @@ -673,8 +673,8 @@ public void testFRTRequestFailFallBackToMRTMRTRequestFail() throws IOException,
*/
@Test
public void testMRRTRequestFailsTryFRT() throws JSONException, IOException {
FileMockContext mockContext = new FileMockContext(getContext());
final ITokenCacheStore mockCache = new DefaultTokenCacheStore(getContext());
FileMockContext mockContext = new FileMockContext(getApplicationContext());
final ITokenCacheStore mockCache = new DefaultTokenCacheStore(getApplicationContext());
mockCache.removeAll();
final String clientId = "clientId";
final String resource = "resource";
Expand Down Expand Up @@ -758,7 +758,7 @@ public void testMRRTRequestFailsTryFRT() throws JSONException, IOException {
*/
@Test
public void testRefreshTokenRequestNotReturnErrorCode() throws IOException, JSONException {
FileMockContext mockContext = new FileMockContext(getContext());
FileMockContext mockContext = new FileMockContext(getApplicationContext());
ITokenCacheStore mockCache = getCacheForRefreshToken(TEST_IDTOKEN_USERID, TEST_IDTOKEN_UPN);

final AuthenticationRequest authenticationRequest = getAuthenticationRequest(VALID_AUTHORITY, "resource", "clientid", false);
Expand Down Expand Up @@ -800,7 +800,7 @@ public void testRefreshTokenRequestNotReturnErrorCode() throws IOException, JSON
*/
@Test
public void testRefreshTokenWithInteractionRequiredCacheNotCleared() throws IOException, JSONException {
FileMockContext mockContext = new FileMockContext(getContext());
FileMockContext mockContext = new FileMockContext(getApplicationContext());
ITokenCacheStore mockCache = getCacheForRefreshToken(TEST_IDTOKEN_USERID, TEST_IDTOKEN_UPN);

final AuthenticationRequest authenticationRequest = getAuthenticationRequest(VALID_AUTHORITY, "resource", "clientid", false);
Expand Down Expand Up @@ -834,8 +834,8 @@ public void testRefreshTokenWithInteractionRequiredCacheNotCleared() throws IOEx

@Test
public void testMRRTItemNotContainRT() {
FileMockContext mockContext = new FileMockContext(getContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getContext());
FileMockContext mockContext = new FileMockContext(getApplicationContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getApplicationContext());
final String resource = "resource";
final String clientId = "clientId";

Expand Down Expand Up @@ -871,8 +871,8 @@ public void testMRRTItemNotContainRT() {

@Test
public void testAllTokenItemNotContainRT() {
FileMockContext mockContext = new FileMockContext(getContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getContext());
FileMockContext mockContext = new FileMockContext(getApplicationContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getApplicationContext());
final String resource = "resource";
final String clientId = "clientId";

Expand Down Expand Up @@ -934,8 +934,8 @@ public void testAllTokenItemNotContainRT() {

@Test
public void testRTExistedInPreferredCache() throws IOException, JSONException {
final FileMockContext mockContext = new FileMockContext(getContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getContext());
final FileMockContext mockContext = new FileMockContext(getApplicationContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getApplicationContext());
clearCache(mockedCache);

updateAuthorityMetadataCache();
Expand Down Expand Up @@ -996,8 +996,8 @@ public void testRTExistedInPreferredCache() throws IOException, JSONException {

@Test
public void testMRRTExistInPreferredLocation() throws IOException, JSONException {
final FileMockContext mockContext = new FileMockContext(getContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getContext());
final FileMockContext mockContext = new FileMockContext(getApplicationContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getApplicationContext());
clearCache(mockedCache);

updateAuthorityMetadataCache();
Expand Down Expand Up @@ -1056,8 +1056,8 @@ public void testMRRTExistInPreferredLocation() throws IOException, JSONException

@Test
public void testFRTExistedInPreferredLocation() throws IOException, JSONException {
final FileMockContext mockContext = new FileMockContext(getContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getContext());
final FileMockContext mockContext = new FileMockContext(getApplicationContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getApplicationContext());
clearCache(mockedCache);

updateAuthorityMetadataCache();
Expand Down Expand Up @@ -1123,8 +1123,8 @@ public void testFRTExistedInPreferredLocation() throws IOException, JSONExceptio
*/
@Test
public void testTokenPresentForPassedInAuthorityAndOtherAliasedHost() throws IOException, JSONException {
final FileMockContext mockContext = new FileMockContext(getContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getContext());
final FileMockContext mockContext = new FileMockContext(getApplicationContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getApplicationContext());
clearCache(mockedCache);

updateAuthorityMetadataCache();
Expand Down Expand Up @@ -1188,8 +1188,8 @@ public void testTokenPresentForPassedInAuthorityAndOtherAliasedHost() throws IOE

@Test
public void testTokenForAliasedAuthorityPresent() throws IOException, JSONException {
final FileMockContext mockContext = new FileMockContext(getContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getContext());
final FileMockContext mockContext = new FileMockContext(getApplicationContext());
final ITokenCacheStore mockedCache = new DefaultTokenCacheStore(getApplicationContext());
clearCache(mockedCache);

updateAuthorityMetadataCache();
Expand Down Expand Up @@ -1291,7 +1291,7 @@ private void saveTokenIntoCache(final ITokenCacheStore mockedCache, final TokenC

// No Family client id set in the cache. Only regular RT token cache entry
private ITokenCacheStore getCacheForRefreshToken(String userId, String displayableId) {
DefaultTokenCacheStore cache = new DefaultTokenCacheStore(getContext());
DefaultTokenCacheStore cache = new DefaultTokenCacheStore(getApplicationContext());
cache.removeAll();
Calendar expiredTime = new GregorianCalendar();
Logger.d("Test", "Time now:" + expiredTime.toString());
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines/maven-release/adal-maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
projectVersion: $(AdalVersion)
checkoutSubmodules: recursive
envVstsMvnAndroidAccessTokenVar: ENV_VSTS_MVN_ANDROIDADAL_ACCESSTOKEN
gradleAssembleReleaseTask: adal:clean adal:assembleDist adal:javadocJar
gradleAssembleReleaseTask: adal:clean adal:assembleDistRelease adal:javadocJar
gradleGeneratePomFiletask: adal:generatePomFileForAdalPublication
aarSourceFolder: adal/build/outputs/aar
jarSourceFolder: adal/build/outputs/jar
Expand Down
11 changes: 9 additions & 2 deletions azure-pipelines/pull-request-validation/pr-adal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ jobs:
clean: true
submodules: recursive
persistCredentials: True
- task: JavaToolInstaller@0
displayName: Use Java 11
inputs:
versionSpec: '11'
jdkArchitectureOption: x64
jdkSourceOption: PreInstalled
- task: CmdLine@1
displayName: Set Office MVN Access Token in Environment
inputs:
Expand Down Expand Up @@ -67,8 +73,8 @@ jobs:
inputs:
tasks: clean adal:assembleLocal
publishJUnitResults: false
jdkArchitecture: x86
sqAnalysisBreakBuildIfQualityGateFailed: false
jdkArchitecture: x64
jdkVersion: 1.11
- job: lint
displayName: Lint
cancelTimeoutInMinutes: 1
Expand All @@ -87,6 +93,7 @@ jobs:
inputs:
tasks: clean adal:lintLocalDebug
publishJUnitResults: false
jdkVersion: 1.11

- job: spotbugs
displayName: SpotBugs
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
vNext
-------------
- [MINOR] Target, compile SDK, AGP and gradle versions increased (#1755)

Version 4.7.5
-------------
- [PATCH] Update YubiKit version to 2.3.0 (#1744)
Expand Down
12 changes: 6 additions & 6 deletions gradle/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ ext {
minSdkVersion = 16
brokerProjectMinSdkVersion = 24
automationAppMinSDKVersion = 21
targetSdkVersion = 30
compileSdkVersion = 30
targetSdkVersion = 33
compileSdkVersion = 34
buildToolsVersion = "28.0.3"

// Plugins
gradleVersion = '4.2.2'
gradleVersion = '7.4.2'
kotlinVersion = '1.7.21'
spotBugsGradlePluginVersion = '4.7.1'
jupiterApiVersion = '5.6.0'

//Java Language Support
coreLibraryDesugaringVersion = "1.0.9"
coreLibraryDesugaringVersion = "1.1.5"

// Libraries
androidxTestRunnerVersion = "1.4.0"
Expand All @@ -34,7 +34,7 @@ ext {
junitVersion = "4.12"
legacySupportV4Version = "1.0.0"
localBroadcastManagerVersion = "1.0.0"
lombokVersion = "1.18.12"
lombokVersion = "1.18.22"
materialVersion = "1.0.0"
mockitoCoreVersion = "3.6.28"
mockitoAndroidVersion = "3.6.28"
Expand Down Expand Up @@ -68,7 +68,7 @@ ext {
javaAssistVersion = "3.27.0-GA"
yubikitAndroidVersion = "2.3.0"
yubikitPivVersion = "2.3.0"
powerliftAndroidVersion="1.0.0"
powerliftAndroidVersion="1.0.3"

// microsoft-diagnostics-uploader app versions
powerliftVersion = "0.14.7"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
Loading
Loading