-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
68 lines (57 loc) · 1.67 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
62
63
64
65
66
67
68
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.novoda:bintray-release:0.3.4'
}
}
allprojects {
repositories {
jcenter()
}
}
// Define versions in a single place
ext {
// Sdk and tools
minSdkVersion = 15
targetSdkVersion = 22
compileSdkVersion = 22
buildToolsVersion = '22.0.1'
// App dependencies
supportLibraryVersion = '22.2.0'
runnerVersion = '0.4.1'
rulesVersion = '0.4.1'
espressoVersion = '2.2'
// version code for Bintray
publishVersion = version()
}
task bumpMajor << {
ant.propertyfile(file: 'version.properties') {
entry(key: 'major', type: 'int', operation: '+', value: 1)
entry(key: 'minor', type: 'int', operation: '=', value: 0)
entry(key: 'patch', type: 'int', operation: '=', value: 0)
}
}
task bumpMinor << {
ant.propertyfile(file: 'version.properties') {
entry(key: 'minor', type: 'int', operation: '+', value: 1)
entry(key: 'patch', type: 'int', operation: '=', value: 0)
}
}
task bumpPatch << {
ant.propertyfile(file: 'version.properties') {
entry(key: 'patch', type: 'int', operation: '+', value: 1)
}
}
task version << {
println version()
}
def String version() {
def versionPropsFile = file('version.properties')
def Properties versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile))
return versionProps['major'] + "." + versionProps['minor'] + "." + versionProps['patch']
}