diff --git a/.drone.yml b/.drone.yml index cdd0b080..df3e8bd4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,7 +5,7 @@ name: tests steps: - name: gplay - image: ghcr.io/nextcloud/continuous-integration-androidandroidbase:5 + image: ghcr.io/nextcloud/continuous-integration-androidbase:3 environment: LOG_USERNAME: from_secret: LOG_USERNAME diff --git a/build.gradle b/build.gradle index 1322f96f..5bc2796c 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.2.0' classpath 'gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.7.5' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.4" diff --git a/gradle.properties b/gradle.properties index 5bac8ac5..39d0d431 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,3 @@ +android.nonFinalResIds=false +android.nonTransitiveRClass=false android.useAndroidX=true diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6e3ed712..4e7ef52c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Mar 10 15:14:55 CET 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/jitpack.yml b/jitpack.yml index 88cfba7a..bb8a4f69 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1 +1 @@ -jdk: openjdk11 +jdk: openjdk17 diff --git a/lib/build.gradle b/lib/build.gradle index 5c478f69..bb42eaa1 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -47,8 +47,14 @@ android { compileOptions { coreLibraryDesugaringEnabled true - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + publishing { + singleVariant('release') { + withSourcesJar() + } } productFlavors { } @@ -132,10 +138,12 @@ afterEvaluate { publishing { publications { release(MavenPublication) { - from components.release + components.getByName('release') groupId = 'com.nextcloud.android.sso' artifactId = 'master' + + from components.release } } } diff --git a/lib/src/main/java/com/nextcloud/android/sso/api/NextcloudAPI.java b/lib/src/main/java/com/nextcloud/android/sso/api/NextcloudAPI.java index e35edbbc..65ed40d1 100644 --- a/lib/src/main/java/com/nextcloud/android/sso/api/NextcloudAPI.java +++ b/lib/src/main/java/com/nextcloud/android/sso/api/NextcloudAPI.java @@ -48,19 +48,6 @@ public class NextcloudAPI implements AutoCloseable { private static final String TAG = NextcloudAPI.class.getCanonicalName(); - private static final Void NOTHING = getVoidInstance(); - - private static Void getVoidInstance() { - //noinspection unchecked - final Constructor constructor = (Constructor) Void.class.getDeclaredConstructors()[0]; - constructor.setAccessible(true); - try { - return constructor.newInstance(); - } catch (Exception e) { - throw new IllegalStateException("Should never happen, but did: unable to instantiate Void"); - } - } - private final NetworkRequest networkRequest; private Gson gson; @@ -154,16 +141,14 @@ public T convertStreamToTargetEntity(InputStream inputStream, Type targetEnt result = gson.fromJson(targetReader, targetEntity); if (result == null) { if (targetEntity == Object.class) { - //noinspection unchecked - return (T) NOTHING; + return null; } else { throw new IllegalStateException("Could not instantiate \"" + targetEntity.toString() + "\", because response was null."); } } } else { - //noinspection unchecked - result = (T) NOTHING; + result = null; } } return result; diff --git a/sample/build.gradle b/sample/build.gradle index 4b93b62c..90a3c087 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -3,8 +3,7 @@ apply plugin: 'com.android.application' android { namespace 'com.nextcloud.android.sso.sample' - compileSdkVersion 33 - buildToolsVersion "32.0.0" + compileSdk 33 defaultConfig { applicationId "com.nextcloud.android.sso.sample" @@ -24,8 +23,8 @@ android { } compileOptions { coreLibraryDesugaringEnabled true - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } }