Skip to content
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
24 changes: 12 additions & 12 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3
uses: gradle/actions/wrapper-validation@v4

- name: Set up JDK 11
uses: actions/setup-java@v3
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '21'
distribution: 'zulu'

- name: Set up Python
Expand Down Expand Up @@ -83,16 +83,16 @@ jobs:
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3
uses: gradle/actions/wrapper-validation@v4

- name: Install JDK 11
uses: actions/setup-java@v3
- name: Install JDK 21
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 11
java-version: 21

- name: Set up Python
uses: actions/setup-python@v3
Expand All @@ -107,7 +107,7 @@ jobs:
run: ./update-submodules

- name: Upload Artifacts
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel --no-configuration-cache --stacktrace
run: ./gradlew publishToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
Expand All @@ -119,7 +119,7 @@ jobs:
echo "VERSION_NAME=$(cat gradle.properties | grep -w "VERSION_NAME" | cut -d'=' -f2)" >> $GITHUB_ENV

- name: Publish Release to Maven Central
run: ./gradlew closeAndReleaseRepository --no-daemon --no-parallel
run: ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel
if: "!endsWith(env.VERSION_NAME, '-SNAPSHOT')"
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ If you leverage jettifier and see the following errors then please add `android.
Failed to transform jackson-core-2.15.0.jar (com.fasterxml.jackson.core:jackson-core:2.15.0) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api}.
```

The Android code in this SDK is written in Kotlin (as of 5.4.x) and Kotlin is now a runtime dependency. If you do not already have Kotlin in your project, you will need to add `implementation("org.jetbrains.kotlin:kotlin-stdlib:1.6.21")` to your dependencies block in order to avoid a runtime exception.
The Android code in this SDK is written in Kotlin (as of 5.4.x) and Kotlin is now a runtime dependency. If you do not already have Kotlin in your project, you will need to add `implementation("org.jetbrains.kotlin:kotlin-stdlib:2.4.0")` to your dependencies block in order to avoid a runtime exception.

If the [official Dropbox App](https://play.google.com/store/apps/details?id=com.dropbox.android) is installed, it will attempt to use it to do authorization. If it is not, a web authentication flow is launched in-browser.

Expand Down Expand Up @@ -370,7 +370,7 @@ dependencies {
The JAR's manifest has the following line:

```
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=11))"
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
```

Most OSGi containers should provide this capability. Unfortunately, some OSGi containers don't do this correctly and will reject the bundle JAR in the OSGi subsystem context.
Expand Down Expand Up @@ -440,4 +440,3 @@ OkHttpClient httpClient = OkHttpRequestor.defaultOkHttpClient().clone()
.setCertificatePinner(myCertificatePinner)
.build();
```

77 changes: 68 additions & 9 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import com.vanniktech.maven.publish.SonatypeHost
import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
import kotlinx.validation.KotlinApiBuildTask
import kotlinx.validation.KotlinApiCompareTask
import kotlinx.validation.SyncFile

plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id "org.jetbrains.kotlinx.binary-compatibility-validator"
id "com.vanniktech.maven.publish"
id "com.github.ben-manes.versions"
Expand All @@ -11,26 +13,83 @@ plugins {

android {
namespace = "com.dropbox.core.sdk.android"
compileSdk dropboxJavaSdkLibs.versions.android.compile.sdk.get().toInteger()
compileSdk = dropboxJavaSdkLibs.versions.android.compile.sdk.get().toInteger()

buildFeatures {
buildConfig = true
}

defaultConfig {
minSdk dropboxJavaSdkLibs.versions.android.min.sdk.get().toInteger()
targetSdk dropboxJavaSdkLibs.versions.android.target.sdk.get().toInteger()
minSdk = dropboxJavaSdkLibs.versions.android.min.sdk.get().toInteger()
targetSdk = dropboxJavaSdkLibs.versions.android.target.sdk.get().toInteger()
}

kotlinOptions {
freeCompilerArgs += '-Xexplicit-api=strict'
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}

kotlin {
compilerOptions {
freeCompilerArgs.add('-Xexplicit-api=strict')
}
}

dependencies {
api(project(path: ":core", configuration: "withoutOsgi"))
}

configurations {
androidApiValidationRuntime
}

dependencies {
androidApiValidationRuntime("org.jetbrains.kotlinx:binary-compatibility-validator:${dropboxJavaSdkLibs.versions.binary.compatibility.validator.get()}")
androidApiValidationRuntime(dropboxJavaSdkLibs.kotlin.stdlib)
androidApiValidationRuntime("org.jetbrains.kotlin:kotlin-metadata-jvm:${dropboxJavaSdkLibs.versions.kotlin.asProvider().get()}")
}

def androidApiBuild = tasks.register("apiBuild", KotlinApiBuildTask) {
description = "Builds Kotlin API for release variant of ${project.name}."

def bundleReleaseClassesJar = tasks.named("bundleLibCompileToJarRelease")
dependsOn(bundleReleaseClassesJar)
inputJar.set(bundleReleaseClassesJar.flatMap { it.output })
inputDependencies.from(configurations.named("releaseCompileClasspath"))
ignoredClasses.add("com.dropbox.core.sdk.android.R")
outputApiFile.set(layout.buildDirectory.file("api/${project.name}.api"))
runtimeClasspath.from(configurations.named("androidApiValidationRuntime"))
}

tasks.register("apiCheck", KotlinApiCompareTask) {
group = "verification"
description = "Checks signatures of public API against the golden value in API folder for ${project.name}."

dependsOn(androidApiBuild)
projectApiFile.set(layout.projectDirectory.file("api/${project.name}.api"))
generatedApiFile.set(androidApiBuild.flatMap { it.outputApiFile })
}

tasks.register("apiDump", SyncFile) {
group = "verification"
description = "Syncs the API file for ${project.name}."

dependsOn(androidApiBuild)
from.set(androidApiBuild.flatMap { it.outputApiFile })
to.set(layout.projectDirectory.file("api/${project.name}.api"))
}

tasks.named("check") {
dependsOn(tasks.named("apiCheck"))
}

dependencyGuard {
configuration("releaseRuntimeClasspath")
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.S01)
configure(new AndroidSingleVariantLibrary("release", true, true))
publishToMavenCentral()
signAllPublications()
}
}
5 changes: 1 addition & 4 deletions android/dependencies/releaseRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@ ch.randelshofer:fastdoubleparser:0.8.0
com.fasterxml.jackson.core:jackson-core:2.15.0
com.fasterxml.jackson:jackson-bom:2.15.0
com.google.code.findbugs:jsr305:3.0.2
org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21
org.jetbrains.kotlin:kotlin-stdlib:1.6.21
org.jetbrains.kotlin:kotlin-stdlib:2.4.0
org.jetbrains:annotations:13.0
5 changes: 2 additions & 3 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dropbox.core.sdk.android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />

<queries>
<package android:name="com.dropbox.android" />
</queries>
</manifest>
</manifest>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ plugins {
alias(dropboxJavaSdkLibs.plugins.dependency.guard)
alias(dropboxJavaSdkLibs.plugins.maven.publish.plugin) apply false
alias(dropboxJavaSdkLibs.plugins.gradle.version.plugin) apply false
alias(dropboxJavaSdkLibs.plugins.blind.pirate.osgi) apply false
alias(dropboxJavaSdkLibs.plugins.bnd.builder) apply false
alias(dropboxJavaSdkLibs.plugins.binary.compatibility.validator) apply false
}

Expand Down
Loading
Loading