Skip to content

Commit 974cf04

Browse files
committed
Merge remote-tracking branch 'origin/master'
# Conflicts: # gradle.properties
2 parents 2eb7f65 + 52f6120 commit 974cf04

File tree

14 files changed

+59
-46
lines changed

14 files changed

+59
-46
lines changed

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ android:
1515
components:
1616
- tools
1717
- platform-tools
18-
- build-tools-25.0.3
19-
- build-tools-26.0.1
20-
- build-tools-27.0.2
18+
- build-tools-27.0.3
2119
- android-21
2220
- android-27
2321
- extra-google-google_play_services

gradle-scripts/common.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ allprojects {
1212
}
1313

1414
dependencies {
15-
classpath 'com.android.tools.build:gradle:3.0.1'
15+
classpath 'com.android.tools.build:gradle:3.1.2'
1616
}
1717
}
1818

@@ -21,18 +21,19 @@ allprojects {
2121
}
2222

2323
repositories {
24-
jcenter()
25-
mavenCentral()
2624
maven {
2725
url "https://maven.google.com"
2826
}
27+
28+
jcenter()
29+
mavenCentral()
2930
}
3031

3132
project.ext.set("publishGroupId", group)
3233
}
3334

3435
task wrapper(type: Wrapper) {
35-
gradleVersion = '4.1'
36+
gradleVersion = '4.5'
3637
}
3738

3839
ext.filterManifest = {manifestPath, newValue ->

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ [email protected]
1515
group=com.cloudinary
1616
version=1.24.0
1717
cloudinaryLibsVersion=1.18.0
18-
androidSupportVersion=27.0.2
19-
org.gradle.jvmargs=-Xmx1024m
18+
androidSupportVersion=27.1.1
19+
org.gradle.jvmargs=-Xmx1024m

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip

lib/build.gradle

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
22

33
android {
44
compileSdkVersion 27
5-
buildToolsVersion "27.0.2"
5+
buildToolsVersion "27.0.3"
66

77
defaultConfig {
88
minSdkVersion 14
@@ -27,7 +27,7 @@ android {
2727
testVariants.all { variant ->
2828
variant.outputs.each { output ->
2929
output.processManifest.doLast {
30-
def url = System.getenv('CLOUDINARY_URL') ?: project.findProperty("cloudinaryUrl")
30+
def url = System.getenv('CLOUDINARY_URL') ?: project.findProperty("cloudinary.url")
3131
if(!url) {
3232
throw new GradleException("Missing credentials: please set CLOUDINARY_URL environment variable or cloudianryUrl build property.")
3333
}
@@ -40,10 +40,9 @@ android {
4040
dependencies {
4141
api "com.cloudinary:cloudinary-core:${cloudinaryLibsVersion}"
4242

43-
implementation "com.android.support:support-v4:${androidSupportVersion}"
44-
45-
implementation ('com.evernote:android-job:1.2.1', {
46-
exclude group: 'com.android.support', module: 'support-v4'
43+
implementation "com.android.support:support-compat:${androidSupportVersion}"
44+
implementation ('com.evernote:android-job:1.2.6', {
45+
exclude group: 'com.android.support', module: 'support-compat'
4746
})
4847

4948
testImplementation 'junit:junit:4.12'
@@ -55,8 +54,8 @@ dependencies {
5554
})
5655

5756
androidTestImplementation "com.android.support:support-annotations:${androidSupportVersion}"
58-
androidTestImplementation "com.android.support.test:runner:1.0.1"
59-
androidTestImplementation "com.android.support.test:rules:1.0.1"
57+
androidTestImplementation "com.android.support.test:runner:1.0.2"
58+
androidTestImplementation "com.android.support.test:rules:1.0.2"
6059
androidTestImplementation "org.hamcrest:hamcrest-library:1.3"
6160
}
6261

lib/src/androidTest/java/com/cloudinary/android/RequestProcessorTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
import org.awaitility.Awaitility;
1515
import org.awaitility.Duration;
16-
import org.junit.Assert;
1716
import org.junit.Test;
1817
import org.junit.runner.RunWith;
1918

@@ -22,13 +21,11 @@
2221
import java.util.UUID;
2322
import java.util.concurrent.Callable;
2423

24+
import static org.junit.Assert.assertEquals;
25+
import static org.junit.Assert.assertNotNull;
26+
2527
@RunWith(AndroidJUnit4.class)
2628
public class RequestProcessorTest extends AbstractTest {
27-
@Test
28-
public void testStuff() {
29-
Assert.assertEquals(3, 3);
30-
}
31-
3229
/**
3330
* Centralize processor creation in case we want to test different implementations in the future.
3431
*/
@@ -70,13 +67,16 @@ public void testValidUploadWithParams() throws IOException {
7067
callbackDispatcher.registerCallback(statefulCallback);
7168
processor.processRequest(InstrumentationRegistry.getTargetContext(), params);
7269

70+
// wait for result
7371
Awaitility.await().atMost(Duration.TEN_SECONDS).until(new Callable<Boolean>() {
7472
@Override
75-
public Boolean call() throws Exception {
76-
return statefulCallback.lastSuccess != null &&
77-
id.equals(statefulCallback.lastSuccess.get("public_id"));
73+
public Boolean call() {
74+
return statefulCallback.hasResponse();
7875
}
7976
});
77+
78+
assertNotNull(statefulCallback.lastSuccess);
79+
assertEquals(id, statefulCallback.lastSuccess.get("public_id"));
8080
}
8181

8282
@Test

lib/src/androidTest/java/com/cloudinary/android/StatefulCallback.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public void onError(String requestId, ErrorInfo errorObject) {
3333
this.lastErrorObject = errorObject;
3434
}
3535

36+
public boolean hasResponse(){
37+
return lastErrorObject != null || lastSuccess != null;
38+
}
39+
3640
@Override
3741
public void onReschedule(String requestId, ErrorInfo error) {
3842
this.lastReschedule = error;

lib/src/androidTest/java/com/cloudinary/android/UploaderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ public void testRawConvertRequest() {
364364
try {
365365
cloudinary.uploader().upload(getAssetStream("docx.docx"), ObjectUtils.asMap("raw_convert", "illegal", "resource_type", "raw"));
366366
} catch (Exception e) {
367-
assertTrue(e.getMessage().matches(".*illegal is not a valid.*"));
367+
assertEquals("Raw convert is invalid", e.getMessage());
368368
}
369369
}
370370

sample/build.gradle

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion 27
5-
buildToolsVersion "27.0.2"
5+
buildToolsVersion "27.0.3"
66
defaultConfig {
77
applicationId "com.cloudinary.android.sample"
88
minSdkVersion 19
@@ -13,7 +13,7 @@ android {
1313
}
1414
buildTypes {
1515
release {
16-
minifyEnabled false
16+
minifyEnabled true
1717
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
1818
}
1919
}
@@ -31,19 +31,19 @@ android {
3131
}
3232

3333
dependencies {
34-
compile project(':lib')
35-
compile "com.android.support:appcompat-v7:${androidSupportVersion}"
36-
compile "com.android.support.constraint:constraint-layout:1.0.2"
37-
compile "com.android.support:recyclerview-v7:${androidSupportVersion}"
38-
compile "com.android.support:design:${androidSupportVersion}"
39-
compile "com.android.support:cardview-v7:${androidSupportVersion}"
40-
compile "com.squareup.picasso:picasso:2.5.2"
41-
compile "com.google.android.exoplayer:exoplayer:r2.4.4"
34+
implementation project(':lib')
35+
implementation "com.android.support:appcompat-v7:${androidSupportVersion}"
36+
implementation "com.android.support.constraint:constraint-layout:1.1.0"
37+
implementation "com.android.support:recyclerview-v7:${androidSupportVersion}"
38+
implementation "com.android.support:design:${androidSupportVersion}"
39+
implementation "com.android.support:cardview-v7:${androidSupportVersion}"
40+
implementation 'com.squareup.picasso:picasso:2.71828'
41+
implementation "com.google.android.exoplayer:exoplayer:r2.4.4"
4242

43-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
43+
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
4444
exclude group: 'com.android.support', module: 'support-annotations'
4545
exclude group: 'com.google.code.findbugs', module: 'jsr305'
4646
})
4747

48-
testCompile 'junit:junit:4.12'
48+
testImplementation 'junit:junit:4.12'
4949
}

sample/proguard-rules.pro

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,14 @@
1414
# If you keep the line number information, uncomment this to
1515
# hide the original source file name.
1616
#-renamesourcefileattribute SourceFile
17+
18+
# okhttp (for picasso):
19+
-dontwarn okhttp3.**
20+
-dontwarn okio.**
21+
-dontwarn javax.annotation.**
22+
-dontwarn org.conscrypt.**
23+
# A resource is loaded with a relative path so the package of this class must be preserved.
24+
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
25+
26+
# Cloudinary:
27+
-keep class com.cloudinary.android.*Strategy

0 commit comments

Comments
 (0)