Skip to content

Commit 5a60e29

Browse files
author
Karl Rieb
committed
ChangeLog/ReadMe: Update for 2.0.5 release.
1 parent 5a763b8 commit 5a60e29

File tree

8 files changed

+25
-95
lines changed

8 files changed

+25
-95
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build/
99
intellij/
1010
.idea/
1111
*.iml
12-
local.properties
12+
gradle.properties
1313

1414
# Output file when rendering ReadMe.md locally.
1515
/ReadMe.html

ChangeLog.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
2.0.6
1+
2.0.6 (2016-06-20)
22
---------------------------------------------
33
- Update to latest API specs:
44
- Files (DbxUserFilesRequests)

ReadMe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ If you're using Maven, then edit your project's "pom.xml" and add this to the `<
1414
<dependency>
1515
<groupId>com.dropbox.core</groupId>
1616
<artifactId>dropbox-core-sdk</artifactId>
17-
<version>2.0.5</version>
17+
<version>2.0.6</version>
1818
</dependency>
1919
```
2020

@@ -23,7 +23,7 @@ If you are using Gradle, then edit your project's "build.gradle" and add this to
2323
```groovy
2424
dependencies {
2525
// ...
26-
compile 'com.dropbox.core:dropbox-core-sdk:2.0.5'
26+
compile 'com.dropbox.core:dropbox-core-sdk:2.0.6'
2727
}
2828
```
2929

generator/java.stoneg.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3404,6 +3404,9 @@ def generate_struct_builder(self, data_type):
34043404
# Setter/Adder methods
34053405
#
34063406
self.generate_builder_methods(data_type.java_builder_class, fields)
3407+
# delegate to parent builder, but make sure we return ourselves for proper chaining
3408+
if parent_supports_builder:
3409+
self.generate_builder_methods(data_type.java_builder_class, data_type.all_parent_fields, wrapped_builder_name="super")
34073410

34083411
#
34093412
# Build method
@@ -3421,6 +3424,10 @@ def generate_builder_methods(self, builder_class, fields, wrapped_builder_name=N
34213424
out = self.g.emit
34223425
javadoc = self.doc.generate_javadoc
34233426

3427+
# qualify builder name if necessary to avoid name conflicts
3428+
if wrapped_builder_name and wrapped_builder_name != 'super':
3429+
wrapped_builder_name = 'this.' + wrapped_builder_name
3430+
34243431
for field in fields:
34253432
if not field.is_optional:
34263433
continue
@@ -3445,7 +3452,7 @@ def generate_builder_methods(self, builder_class, fields, wrapped_builder_name=N
34453452
field.java_name,
34463453
)):
34473454
if wrapped_builder_name:
3448-
out('this.%s.%s(%s);' % (wrapped_builder_name, field.java_builder_setter, field.java_name))
3455+
out('%s.%s(%s);' % (wrapped_builder_name, field.java_builder_setter, field.java_name))
34493456
else:
34503457
self.generate_field_validation(field)
34513458
self.generate_field_assignment(field)

release.gradle

Lines changed: 2 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,12 @@ apply plugin: 'java-library-distribution'
33
apply plugin: 'signing'
44
apply plugin: 'maven'
55

6-
def getPassword(prop, description) {
7-
if (project.hasProperty(prop)) {
8-
return project.getProperty(prop)
9-
}
10-
11-
def console = System.console()
12-
if (console != null) {
13-
println "Please enter ${description}:"
14-
return new String(console.readPassword())
15-
}
16-
17-
// If gradle is run as a daemon or through an IDE, then we won't have a console
18-
throw new GradleException(
19-
"Missing password property: ${prop}. " +
20-
"Run with --no-daemon option, specify the property with the -P flag, or add it to " +
21-
"~/.gradle/gradle.properties."
22-
)
23-
}
24-
256
task releaseTest() {
267
dependsOn ':proguard:proguardTest'
278
dependsOn test
289
dependsOn integrationTest
2910
}
3011

31-
task signingCredentials() {
32-
ext {
33-
dbxPropPrefix = 'com.dropbox.api'
34-
keyIdProp = 'signing.keyId'
35-
keyRingProp = 'signing.secretKeyRingFile'
36-
passwordProp = 'signing.password'
37-
}
38-
39-
doLast {
40-
[keyIdProp, keyRingProp].each { prop ->
41-
def dropboxProp = "${dbxPropPrefix}.${prop}"
42-
if (!project.hasProperty(dropboxProp)) {
43-
throw new GradleException(
44-
"Missing required property for signing: ${dropboxProp}. " +
45-
"Add the property to ~/.gradle/gradle.properties or specify it with the -P flag."
46-
)
47-
}
48-
project.ext.set(prop, project.getProperty(dropboxProp))
49-
}
50-
51-
project.ext."${passwordProp}" = getPassword(
52-
"${dbxPropPrefix}.${passwordProp}",
53-
'PGP Private Key Password'
54-
)
55-
}
56-
}
5712

5813
signing {
5914
required {
@@ -63,8 +18,6 @@ signing {
6318
sign configurations.archives
6419
}
6520

66-
tasks.signArchives.dependsOn signingCredentials
67-
6821
// Remember to upload binary with releases on GitHub. Some 3rd party developers still rely on
6922
// manually downloading and managing their dependencies.
7023
distributions {
@@ -78,26 +31,7 @@ distributions {
7831
}
7932
}
8033

81-
task sonatypeCredentials () {
82-
ext {
83-
usernameProp = "com.dropbox.api.release.sonatypeUser"
84-
passwordProp = "com.dropbox.api.release.sonatypePassword"
85-
username = "dropbox-api-team"
86-
password = null
87-
}
88-
89-
doLast {
90-
if (project.hasProperty(usernameProp)) {
91-
username = getProperty(usernameProp)
92-
}
93-
94-
password = getPassword(passwordProp, 'OSS Sonatype password')
95-
}
96-
}
97-
9834
uploadArchives {
99-
dependsOn sonatypeCredentials
100-
10135
repositories {
10236
mavenDeployer {
10337
beforeDeployment { deployment ->
@@ -108,8 +42,8 @@ uploadArchives {
10842

10943
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
11044
authentication(
111-
userName: sonatypeCredentials.username,
112-
password: sonatypeCredentials.password
45+
userName: ossrhUsername,
46+
password: ossrhPassword
11347
)
11448
}
11549
}

src/test/java/com/dropbox/core/v2/DbxClientV2Test.java

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ public void testRetrySuccess() throws DbxException, IOException {
7575
DbxClientV2 client = new DbxClientV2(config, "fakeAccessToken");
7676
FileMetadata expected = new FileMetadata(
7777
"bar.txt",
78-
"/foo/bar.txt",
79-
"/foo/bar.txt",
8078
"id:1HkLjqifwMAAAAAAAAAAAQ",
8179
new Date(1456169040985L),
8280
new Date(1456169040985L),
@@ -94,13 +92,14 @@ public void testRetrySuccess() throws DbxException, IOException {
9492
when(mockRequestor.startPost(anyString(), anyHeaders()))
9593
.thenReturn(mockUploader);
9694

97-
Metadata actual = client.files().getMetadata(expected.getPathLower());
95+
Metadata actual = client.files().getMetadata(expected.getId());
9896

9997
// should have only been called 3 times: initial call + 2 retries
10098
verify(mockRequestor, times(3)).startPost(anyString(), anyHeaders());
10199

102-
assertEquals(actual.getPathLower(), expected.getPathLower());
100+
assertEquals(actual.getName(), expected.getName());
103101
assertTrue(actual instanceof FileMetadata, actual.getClass().toString());
102+
assertEquals(((FileMetadata) actual).getId(), expected.getId());
104103
}
105104

106105
@Test(expectedExceptions = RetryException.class)
@@ -166,8 +165,6 @@ public void testRetryDownload() throws DbxException, IOException {
166165

167166
FileMetadata expectedMetadata = new FileMetadata(
168167
"download_me.txt",
169-
"/download_me.txt",
170-
"/download_me.txt",
171168
"id:KLavC4viCDAAAAAAAAAAAQ",
172169
new Date(1456169692501L),
173170
new Date(1456169692501L),
@@ -184,7 +181,7 @@ public void testRetryDownload() throws DbxException, IOException {
184181
when(mockRequestor.startPost(anyString(), anyHeaders()))
185182
.thenReturn(mockUploader);
186183

187-
DbxDownloader<FileMetadata> downloader = client.files().download(expectedMetadata.getPathLower());
184+
DbxDownloader<FileMetadata> downloader = client.files().download(expectedMetadata.getId());
188185

189186
// should have been attempted twice
190187
verify(mockRequestor, times(2)).startPost(anyString(), anyHeaders());
@@ -208,8 +205,6 @@ public void testRetrySuccessWithBackoff() throws DbxException, IOException {
208205
DbxClientV2 client = new DbxClientV2(config, "fakeAccessToken");
209206
FileMetadata expected = new FileMetadata(
210207
"banana.png",
211-
"/banana.png",
212-
"/banana.png",
213208
"id:eRsVsAya9YAAAAAAAAAAAQ",
214209
new Date(1456173312172L),
215210
new Date(1456173312172L),
@@ -229,7 +224,7 @@ public void testRetrySuccessWithBackoff() throws DbxException, IOException {
229224
.thenReturn(mockUploader);
230225

231226
long start = System.currentTimeMillis();
232-
Metadata actual = client.files().getMetadata(expected.getPathLower());
227+
Metadata actual = client.files().getMetadata(expected.getId());
233228
long end = System.currentTimeMillis();
234229

235230
// no way easy way to properly test this, but request should
@@ -239,7 +234,7 @@ public void testRetrySuccessWithBackoff() throws DbxException, IOException {
239234
// should have been called 4 times: initial call + 3 retries
240235
verify(mockRequestor, times(4)).startPost(anyString(), anyHeaders());
241236

242-
assertEquals(actual.getPathLower(), expected.getPathLower());
237+
assertEquals(actual.getName(), expected.getName());
243238
assertTrue(actual instanceof FileMetadata, actual.getClass().toString());
244239
}
245240

src/test/java/com/dropbox/core/v2/files/DataTypeSerializationTest.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ public void testDateTimestamp() throws Exception {
9898
public void testEnumeratedSubtypes() throws Exception {
9999
FileMetadata file = FileMetadata.newBuilder(
100100
"foo.PNG",
101-
"/path/foo.png",
102-
"/path/foo.PNG",
103101
"id:fyte8AYWx_AAAAAAAAAfgg",
104102
new Date(1457477907029L),
105103
new Date(1457479027750L),
106104
"3cee38735597",
107105
18480
108106
)
107+
.withPathLower("/path/foo.png")
108+
.withPathDisplay("/path/foo.PNG")
109109
.withParentSharedFolderId("2")
110110
.withSharingInfo(new FileSharingInfo(false, "2"))
111111
.withMediaInfo(
@@ -119,22 +119,16 @@ public void testEnumeratedSubtypes() throws Exception {
119119
.build();
120120

121121
FolderMetadata folder = new FolderMetadata(
122-
"/Photos",
123-
"/photos",
124122
"/Photos",
125123
"id:fyte8AYWx_AAAAAAAAAf8w"
126124
);
127125

128126
DeletedMetadata deleted = new DeletedMetadata(
129-
"Old.log",
130-
"/logs/old.log",
131-
"/logs/Old.log"
127+
"Old.log"
132128
);
133129

134130
Metadata metadata = new Metadata(
135-
"generic",
136-
"/generic",
137-
"/generic"
131+
"generic"
138132
);
139133

140134
String json = FileMetadata.Serializer.INSTANCE.serialize(file);

stone.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ task generateStoneSources(type: Exec) {
3232
sourceSets {
3333
main {
3434
java {
35-
srcDir "${generatedSources}"
35+
srcDir generateStoneSources.outputDir
3636
}
3737
}
3838
}

0 commit comments

Comments
 (0)