-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathbuild.gradle
More file actions
74 lines (62 loc) · 2.6 KB
/
build.gradle
File metadata and controls
74 lines (62 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
apply plugin: 'com.android.library'
android {
namespace 'com.cloudinary.android.core'
testNamespace 'com.cloudinary.android.test'
compileSdk 34
defaultConfig {
minSdkVersion 21
targetSdkVersion 34
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// filter in the api credentials before building but without changing original source
// files - to make sure the credentials are not checked into source control.
// The url is taken from a property or environment variable:
manifestPlaceholders = [cloudinaryUrl: getCloudinaryUrl() ?: ""]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
consumerProguardFiles 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}
task verifyCloudinaryCredentials {
doFirst {
if (!getCloudinaryUrl()) {
throw new GradleException("Missing credentials: please set CLOUDINARY_URL environment variable or cloudianryUrl property.")
}
}
}
// Force cloudinary credentials when running unit tests and connected device tests
tasks.matching { it.name.startsWith("connected") || it.name.startsWith("test")}.all { task ->
task.dependsOn verifyCloudinaryCredentials
}
dependencies {
api "com.cloudinary:cloudinary-core:${cloudinaryLibsVersion}"
implementation 'androidx.core:core:1.7.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.work:work-runtime:2.7.1'
testImplementation 'androidx.test.ext:junit:1.1.3'
testImplementation "com.cloudinary:cloudinary-test-common:${cloudinaryLibsVersion}"
androidTestImplementation 'org.awaitility:awaitility:3.1.6'
androidTestImplementation('androidx.test.espresso:espresso-core:3.4.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestImplementation 'androidx.annotation:annotation:1.2.0'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation "org.hamcrest:hamcrest-library:2.2"
}
ext {
publishArtifactId = 'cloudinary-android-core'
publishArtifactName = 'Cloudinary Android Core Library'
jarFileName = "core"
}
apply from: '../publish.gradle'