-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
61 lines (51 loc) · 1.85 KB
/
build.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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.androidGradleVer = '3.1.0'
ext.gradleVersionsPluginVer = '0.17.0'
ext.kotlinVer = '1.2.31'
ext.isTravis = 'true' == System.getenv('TRAVIS')
ext.preDexEnabled = 'true' == System.getProperty('pre-dex', 'true')
repositories {
jcenter()
google()
// maven { url 'https://maven.fabric.io/public' }
// maven { url 'http://dl.bintray.com/kotlin/kotlin-eap-1.2' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath "com.github.ben-manes:gradle-versions-plugin:$gradleVersionsPluginVer"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVer"
// classpath 'io.fabric.tools:gradle:1.24.1'
}
}
allprojects {
apply plugin: 'com.github.ben-manes.versions'
repositories {
jcenter()
google()
// maven { url 'https://maven.fabric.io/public' }
//maven { url 'http://dl.bintray.com/kotlin/kotlin-eap-1.2' }
}
// dependencyUpdates: suggest only released artifacts
dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { selection.candidate.version ==~ /(?i).*[.-]${it}.*/ }
if (rejected)
selection.reject('Release candidate')
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
def gitSha() {
return 'git rev-parse --short HEAD'.execute([], rootDir).text.trim()
}
def gitTimestamp() {
return 'git log -n 1 --format=%aI'.execute([], rootDir).text.trim()
}
def gitVersionCode() {
return 'git rev-list --count HEAD'.execute([], rootDir).text.trim().toInteger()
}