diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc9dc883..4e47b008 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,15 +8,15 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 + - uses: actions/checkout@v3 + - name: Set up JDK 17 uses: actions/setup-java@v2 with: - java-version: '11' - distribution: 'adopt' + java-version: '17' + distribution: 'temurin' - name: Cache Gradle packages - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.gradle/caches @@ -29,4 +29,4 @@ jobs: run: ./gradlew check jacoco assemble - name: Codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 diff --git a/README.md b/README.md index b0f5b08a..eb238917 100644 --- a/README.md +++ b/README.md @@ -466,7 +466,7 @@ private void endSession() { @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == RC_END_SESSION) { - EndSessionResonse resp = EndSessionResonse.fromIntent(data); + EndSessionResponse resp = EndSessionResponse.fromIntent(data); AuthorizationException ex = AuthorizationException.fromIntent(data); // ... process the response or exception ... } else { diff --git a/app/AndroidManifest.xml b/app/AndroidManifest.xml index 6c6f6272..30082737 100644 --- a/app/AndroidManifest.xml +++ b/app/AndroidManifest.xml @@ -11,9 +11,7 @@ * express or implied. See the License for the specific language governing permissions and * limitations under the License. --> - + @@ -31,8 +29,6 @@ + + + + + diff --git a/build.gradle b/build.gradle index 100602b4..869da42d 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:4.2.1' + classpath 'com.android.tools.build:gradle:8.0.1' classpath 'org.ajoberstar.grgit:grgit-gradle:4.1.1' classpath 'org.jacoco:org.jacoco.core:0.8.7' } @@ -26,7 +26,7 @@ ext.verifyKeystore() project.ext { minSdkVersion = 16 compileSdkVersion = 33 - versionID = "0.11.1" + versionID = "0.11.2" versionName = """$versionID-skyscanner""" try { diff --git a/config/android-common.gradle b/config/android-common.gradle index 909c90c2..668ff1fd 100644 --- a/config/android-common.gradle +++ b/config/android-common.gradle @@ -1,4 +1,5 @@ android { + namespace 'net.openid.appauth' compileSdkVersion rootProject.compileSdkVersion defaultConfig { minSdkVersion rootProject.minSdkVersion @@ -41,7 +42,7 @@ task jar(type: Copy, dependsOn:'bundleRelease') { // produces a JAR containing sources task sourcesJar(type: Jar, dependsOn:'generateReleaseSources') { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier = 'sources' } tasks.withType(JavaCompile) { diff --git a/config/coverage.gradle b/config/coverage.gradle index 4e589e5b..e68f9c18 100644 --- a/config/coverage.gradle +++ b/config/coverage.gradle @@ -8,14 +8,17 @@ android { } } } + unitTestVariants.all { + it.mergedFlavor.manifestPlaceholders = ['appAuthRedirectScheme': 'net.openid.appauthdemo'] + } } task jacocoTestReport(type: JacocoReport, dependsOn: "testDebugUnitTest") { group = "Reporting" description = "Generate Jacoco coverage reports after running tests." reports { - xml.enabled = true - html.enabled = true + xml.required.set(true) + html.required.set(true) } // Class R is used, but usage will not be covered, so ignore this class from report afterEvaluate { diff --git a/config/javadoc.gradle b/config/javadoc.gradle index ac8d15e5..d9aaf3d1 100644 --- a/config/javadoc.gradle +++ b/config/javadoc.gradle @@ -3,13 +3,14 @@ configurations { } dependencies { - mdDoclet 'org.jdrupes.mdoclet:doclet:2.0.0' + mdDoclet 'org.jdrupes.mdoclet:doclet:3.1.0' } task androidJavadoc(type: JavaExec) { - jvmArgs = ['--add-exports=jdk.javadoc/jdk.javadoc.internal.tool=ALL-UNNAMED'] + jvmArgs = ['--add-exports=jdk.javadoc/jdk.javadoc.internal.tool=ALL-UNNAMED', + '--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED'] classpath files(project.android.getBootClasspath()) - main = 'jdk.javadoc.internal.tool.Main' + mainClass = 'jdk.javadoc.internal.tool.Main' ext.destinationDir = file("${project.buildDir}/docs/javadoc") args = ['-doctitle', "AppAuth for Android", '-use', @@ -22,10 +23,11 @@ task androidJavadoc(type: JavaExec) { '-d', ext.destinationDir, '-Xdoclint:none', ] + android.sourceSets.main.java.sourceFiles.files + mustRunAfter(':library:assembleRelease', ':library:assembleDebug') } task javadocJar(type: Jar, dependsOn: androidJavadoc) { - classifier = 'javadoc' + archiveClassifier = 'javadoc' from androidJavadoc.ext.destinationDir } diff --git a/config/style.gradle b/config/style.gradle index e73817b6..323f0af9 100644 --- a/config/style.gradle +++ b/config/style.gradle @@ -10,7 +10,7 @@ task checkAllSource(type: Checkstyle) { afterEvaluate { source 'java' include '**/*.java' - classpath = files project.configurations.compile.files + classpath = files() } } diff --git a/config/testdeps.gradle b/config/testdeps.gradle index 238fb5b2..635c141b 100644 --- a/config/testdeps.gradle +++ b/config/testdeps.gradle @@ -1,9 +1,9 @@ testImplementation 'junit:junit:4.13.2' testImplementation 'org.hamcrest:hamcrest:2.2' testImplementation 'org.mockito:mockito-core:3.10.0' -testImplementation 'org.robolectric:robolectric:4.5.1' +testImplementation 'org.robolectric:robolectric:4.9' testImplementation 'org.assertj:assertj-core:3.19.0' -testImplementation 'androidx.test.ext:junit:1.1.3' -testImplementation 'androidx.test.ext:truth:1.3.0' +testImplementation 'androidx.test.ext:junit:1.1.5' +testImplementation 'androidx.test.ext:truth:1.5.0' testImplementation 'com.google.truth:truth:1.1.3' testImplementation 'xmlpull:xmlpull:1.1.3.1' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 55df8853..c017ac4b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,4 @@ #Sat Jun 13 20:20:21 CEST 2020 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip diff --git a/library/AndroidManifest.xml b/library/AndroidManifest.xml index 31737510..40982c43 100644 --- a/library/AndroidManifest.xml +++ b/library/AndroidManifest.xml @@ -12,8 +12,7 @@ * express or implied. See the License for the specific language governing permissions and * limitations under the License. --> - + diff --git a/library/gradle-maven-push.gradle b/library/gradle-maven-push.gradle index 4ddd8075..a09f6325 100644 --- a/library/gradle-maven-push.gradle +++ b/library/gradle-maven-push.gradle @@ -4,7 +4,7 @@ def artifactoryURL = "https://artifactory.skyscannertools.net/artifactory/infras task sourceJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier "source" + archiveClassifier = 'source' } afterEvaluate { project -> diff --git a/library/javatests/AndroidManifest.xml b/library/javatests/AndroidManifest.xml index 3e6faa03..e95bb820 100644 --- a/library/javatests/AndroidManifest.xml +++ b/library/javatests/AndroidManifest.xml @@ -13,12 +13,11 @@ * limitations under the License. --> + xmlns:tools="http://schemas.android.com/tools"> + android:exported="true"> diff --git a/library/javatests/net/openid/appauth/browser/AnyBrowserMatcherTest.java b/library/javatests/net/openid/appauth/browser/AnyBrowserMatcherTest.java index c04c337f..cc47cc34 100644 --- a/library/javatests/net/openid/appauth/browser/AnyBrowserMatcherTest.java +++ b/library/javatests/net/openid/appauth/browser/AnyBrowserMatcherTest.java @@ -16,7 +16,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import net.openid.appauth.BuildConfig; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; diff --git a/library/javatests/net/openid/appauth/browser/BrowserAllowListTest.java b/library/javatests/net/openid/appauth/browser/BrowserAllowListTest.java index 84eaf2c8..c222ec4f 100644 --- a/library/javatests/net/openid/appauth/browser/BrowserAllowListTest.java +++ b/library/javatests/net/openid/appauth/browser/BrowserAllowListTest.java @@ -16,7 +16,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import net.openid.appauth.BuildConfig; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; diff --git a/library/javatests/net/openid/appauth/browser/BrowserDenyListTest.java b/library/javatests/net/openid/appauth/browser/BrowserDenyListTest.java index f299de8c..00adab81 100644 --- a/library/javatests/net/openid/appauth/browser/BrowserDenyListTest.java +++ b/library/javatests/net/openid/appauth/browser/BrowserDenyListTest.java @@ -16,7 +16,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import net.openid.appauth.BuildConfig; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; diff --git a/library/javatests/net/openid/appauth/browser/CustomTabManagerTest.java b/library/javatests/net/openid/appauth/browser/CustomTabManagerTest.java index bda1ef23..044ad3fe 100644 --- a/library/javatests/net/openid/appauth/browser/CustomTabManagerTest.java +++ b/library/javatests/net/openid/appauth/browser/CustomTabManagerTest.java @@ -14,7 +14,6 @@ import androidx.browser.customtabs.CustomTabsServiceConnection; import androidx.browser.customtabs.CustomTabsSession; import java.util.List; -import net.openid.appauth.BuildConfig; import org.junit.After; import org.junit.Before; diff --git a/library/javatests/net/openid/appauth/browser/DelimitedVersionTest.java b/library/javatests/net/openid/appauth/browser/DelimitedVersionTest.java index 9a45026c..5746f06e 100644 --- a/library/javatests/net/openid/appauth/browser/DelimitedVersionTest.java +++ b/library/javatests/net/openid/appauth/browser/DelimitedVersionTest.java @@ -16,7 +16,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import net.openid.appauth.BuildConfig; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; diff --git a/library/javatests/net/openid/appauth/browser/DeprecationMigrationTest.java b/library/javatests/net/openid/appauth/browser/DeprecationMigrationTest.java index fef4778e..9a21e40a 100644 --- a/library/javatests/net/openid/appauth/browser/DeprecationMigrationTest.java +++ b/library/javatests/net/openid/appauth/browser/DeprecationMigrationTest.java @@ -1,7 +1,5 @@ package net.openid.appauth.browser; -import net.openid.appauth.BuildConfig; - import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; diff --git a/library/javatests/net/openid/appauth/browser/VersionRangeTest.java b/library/javatests/net/openid/appauth/browser/VersionRangeTest.java index 973da024..33211883 100644 --- a/library/javatests/net/openid/appauth/browser/VersionRangeTest.java +++ b/library/javatests/net/openid/appauth/browser/VersionRangeTest.java @@ -16,7 +16,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import net.openid.appauth.BuildConfig; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; diff --git a/library/javatests/net/openid/appauth/browser/VersionedBrowserMatcherTest.java b/library/javatests/net/openid/appauth/browser/VersionedBrowserMatcherTest.java index dfa87e2e..1548509a 100644 --- a/library/javatests/net/openid/appauth/browser/VersionedBrowserMatcherTest.java +++ b/library/javatests/net/openid/appauth/browser/VersionedBrowserMatcherTest.java @@ -19,7 +19,6 @@ import java.util.Collections; import java.util.HashSet; -import net.openid.appauth.BuildConfig; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/library/javatests/net/openid/appauth/internal/LoggerTest.java b/library/javatests/net/openid/appauth/internal/LoggerTest.java index 1e7c4393..a6a5402b 100644 --- a/library/javatests/net/openid/appauth/internal/LoggerTest.java +++ b/library/javatests/net/openid/appauth/internal/LoggerTest.java @@ -23,7 +23,6 @@ import android.util.Log; -import net.openid.appauth.BuildConfig; import org.junit.After; import org.junit.Before; diff --git a/library/javatests/net/openid/appauth/internal/UriUtilTest.java b/library/javatests/net/openid/appauth/internal/UriUtilTest.java index 51e00b2f..68d3ab82 100644 --- a/library/javatests/net/openid/appauth/internal/UriUtilTest.java +++ b/library/javatests/net/openid/appauth/internal/UriUtilTest.java @@ -19,8 +19,6 @@ import android.os.Bundle; import androidx.browser.customtabs.CustomTabsService; -import net.openid.appauth.BuildConfig; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -66,7 +64,7 @@ public void testFormUrlEncode_withSpaceSeparatedValueForParameter() { parameters.put("test2", "value2 value3"); String query = UriUtil.formUrlEncode(parameters); - assertThat(query.contains("value2+value3")); + assertThat(query).contains("value2+value3"); mSanitizer.parseQuery(query); for (Map.Entry param : parameters.entrySet()) { assertThat(mSanitizer.getValue(param.getKey())).isEqualTo(param.getValue());