forked from openid/OpenYOLO-Android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
80 lines (70 loc) · 2.54 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
69
70
71
72
73
74
75
76
77
78
79
80
buildscript {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'org.ajoberstar:gradle-git:1.7.1'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.1'
classpath 'com.google.protobuf:protoc-gen-javalite:3.0.0'
}
}
try {
def grgit = org.ajoberstar.grgit.Grgit.open(dir: '.')
def lastCommit = grgit.head()
project.ext.versionNum = grgit.log(includes:['HEAD']).size()
project.ext.versionDate = lastCommit.getDate()
project.ext.versionName = grgit.describe()
def emptyValue = "\"\"";
if (project.ext.versionName == null) {
project.ext.versionName = "DEV"
project.ext.versionMajor = emptyValue
project.ext.versionMinor = emptyValue
project.ext.versionPatch = emptyValue
} else {
def parts = project.ext.versionName.split("[\\.-]")
project.ext.versionMajor = '\"' + ((parts.length > 0) ? parts[0] : emptyValue) + '\"';
project.ext.versionMinor = '\"' + ((parts.length > 1) ? parts[1] : emptyValue) + '\"';
project.ext.versionPatch = '\"' + ((parts.length > 2) ? parts[2] : emptyValue) + '\"';
}
} catch (Exception ex) {
logger.lifecycle(
"unable to infer version information from git - using defaults")
project.ext.versionNum = 0
project.ext.versionDate = new Date()
project.ext.versionName = 'DEV'
}
task showVersion {
doLast {
logger.lifecycle("Version ID: " + project.versionNum)
logger.lifecycle("Version Date: " + project.versionDate)
logger.lifecycle("Version Name: " + project.versionName)
}
}
project.ext.minSdkVersion = 15
project.ext.compileSdkVersion = 26
project.ext.buildToolsVersion = '26.0.2'
project.ext.supportLibVersion = '26.1.0'
project.ext.archRuntimeVersion = '1.0.3'
project.ext.archVersion = '1.0.0-rc1'
project.ext.glideVersion = '4.0.0'
project.ext.valid4jVersion = '0.5.0'
project.ext.hamcrestVersion = '1.3'
project.ext.guavaVersion = '23.0-android'
project.ext.sourceJavaVersion = JavaVersion.VERSION_1_7
project.ext.targetJavaVersion = JavaVersion.VERSION_1_7
subprojects {
repositories {
jcenter()
mavenCentral()
maven { url 'https://maven.google.com' }
}
group = "org.openyolo"
version = versionName
}
task wrapper(type: Wrapper) {
gradleVersion = '4.1'
}