This repository has been archived by the owner on May 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdependencies.gradle
62 lines (56 loc) · 2.83 KB
/
dependencies.gradle
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
ext {
//Version
supportVersion = '26.1.0'
junitVersion = '4.12'
mockitoAndroidVersion = '2.10.0'
mockitoVersion = '2.13.0'
androidTestVersion = '1.0.1'
mockWebServerVersion = '3.8.1'
robolectricVersion = '4.3'
hamcrestVersion = '1.3'
gsonVersion = '2.4'
jacocoVersion = '0.8.0'
multiDexVersion = '1.0.2'
//Packages
supportPackage = 'com.android.support'
mockitoPackage = 'org.mockito'
junitPackage = 'junit'
androidTestPackage = 'com.android.support.test'
okHttpPackage = 'com.squareup.okhttp3'
robolectricPackage = 'org.robolectric'
hamcrestPackage = 'org.hamcrest'
gsonPackage = 'com.google.code.gson'
kinecosystem = 'com.github.kinecosystem'
kotlinPackage = 'org.jetbrains.kotlin'
//when building in jitpack, extract android-stellar-sdk commit we work on
if (System.env.JITPACK) {
//get current commit of kin-core
GIT_COMMIT = 'git rev-parse HEAD'.execute().text.trim()
currentGitHash = GIT_COMMIT
//extract current commit of android-stellar-sdk using current commit of kin-core
getSubModuleHash = 'git ls-tree ' + currentGitHash + ' android-stellar-sdk'
getSubModuleResult = getSubModuleHash.execute().text.trim()
stellarSDKVersion = getSubModuleResult.split()[2]
stellarSDK = buildDependency(kinecosystem, 'android-stellar-sdk', stellarSDKVersion)
}
supportDependencies = [
supportAnnotations: buildDependency(supportPackage, 'support-annotations', supportVersion)
]
testingDependencies = [
junit : buildDependency(junitPackage, 'junit', junitVersion),
mockitoAndroid : buildDependency(mockitoPackage, 'mockito-android', mockitoAndroidVersion),
mockito : buildDependency(mockitoPackage, 'mockito-core', mockitoVersion),
androidTestRunner: buildDependency(androidTestPackage, 'runner', androidTestVersion),
androidTestRules : buildDependency(androidTestPackage, 'rules', androidTestVersion),
mockWebServer : buildDependency(okHttpPackage, 'mockwebserver', mockWebServerVersion),
robolectric : buildDependency(robolectricPackage, 'robolectric', robolectricVersion),
hamcrest : buildDependency(hamcrestPackage, 'hamcrest-library', hamcrestVersion),
gson : buildDependency(gsonPackage, 'gson', gsonVersion),
multidex : buildDependency(supportPackage, 'multidex', multiDexVersion),
kotlin : buildDependency(kotlinPackage, 'kotlin-stdlib-jdk7', kotlin_version),
kotlinJUnitTest : buildDependency(kotlinPackage, 'kotlin-test-junit', kotlin_version)
]
}
static String buildDependency(String pack, String dependency, String version) {
return "${pack}:${dependency}:${version}"
}