Skip to content

Commit 0031ac6

Browse files
author
Karl Rieb
committed
Add build task for generating distribution ZIP containing all required JARs.
The distribution ZIP is meant to be attached to GitHub releases. Some 3rd party developers have asked for links to directly download the JARs instead of using dependency management systems like maven or gradle. Fixes T96253.
1 parent 3b7ddf4 commit 0031ac6

4 files changed

Lines changed: 18 additions & 2 deletions

File tree

ReadMe.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ dependencies {
2727
}
2828
```
2929

30+
You can also download the Java SDK JAR and and its dependencies directly from the [latest release page](https://github.com/dropbox/dropbox-sdk-java/releases/latest).
31+
3032
## Get a Dropbox API key
3133

3234
You need a Dropbox API key to make API requests.

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ ext {
1717
generatedResources = file("$buildDir/generated-resources")
1818
authInfoPropertyName = 'com.dropbox.test.authInfoFile'
1919
basePom = pom {
20+
name = 'Official Dropbox Java SDK'
2021
artifactId = archivesBaseName
2122
project {
2223
packaging 'jar'

release.gradle

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'java'
2+
apply plugin: 'java-library-distribution'
23
apply plugin: 'signing'
34
apply plugin: 'maven'
45
apply plugin: 'com.github.ben-manes.versions' // dependencyUpdates task
@@ -38,7 +39,6 @@ def getPassword(prop, description) {
3839

3940
gradle.taskGraph.whenReady { graph ->
4041
if (graph.hasTask(signArchives) && signArchives.required) {
41-
println "${graph.allTasks}"
4242
['signing.keyId', 'signing.secretKeyRingFile'].each { prop ->
4343
def dropboxProp = "com.dropbox.api.${prop}"
4444
if (!project.hasProperty(dropboxProp)) {
@@ -57,6 +57,19 @@ gradle.taskGraph.whenReady { graph ->
5757
}
5858
}
5959

60+
// Remember to upload binary with releases on GitHub. Some 3rd party developers still rely on
61+
// manually downloading and managing their dependencies.
62+
distributions {
63+
main {
64+
baseName = project.archivesBaseName
65+
contents {
66+
// Add source JARs
67+
from { sourcesJar.outputs.getFiles() }
68+
from { 'ChangeLog.txt' }
69+
}
70+
}
71+
}
72+
6073
task sonatypeCredentials () {
6174
ext {
6275
usernameProp = "com.dropbox.api.release.sonatypeUser"

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
rootProject.name = 'Official Dropbox Java SDK'
1+
rootProject.name = 'dropbox-sdk-java'
22

33
/* BEGIN PRIVATE REPO ONLY */
44
include ':proguard'

0 commit comments

Comments
 (0)