-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
98 lines (85 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
// TODO 10-Aug-2018/vatam: remove as soon as butterknife 9 is out we use snapshot because
// of gradle plugin support is not there in earlier versions
maven {
name 'Sonatype SNAPSHOTs'
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id "org.sonarqube" version "2.6.2"
}
allprojects {
allprojects {
project.ext {
globalCompileSDK = 27
globalMinSDK = 21
globalTargetSDK = 27
}
repositories {
google()
jcenter()
// TODO 10-Aug-2018/vatam: remove as soon as butterknife 9 is out we use snapshot because
// of gradle plugin support is not there in earlier versions
maven {
name 'Sonatype SNAPSHOTs'
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
static def readVersion(project) {
def versionFile = new File(project.rootDir, 'version.properties')
def version = new Properties()
def stream
try {
stream = new FileInputStream(versionFile)
version.load(stream)
}
catch (FileNotFoundException e) {
println e
}
finally {
if (stream != null) stream.close()
}
return version
}
static def readVersionCode(project) {
def version = readVersion(project)
def build = version['versionCode'] as int
return build
}
static def readVersionName(project) {
def version = readVersion(project)
def versionName = "${version['versionName']}" + "." + readVersionCode(project)
return versionName
}
sonarqube {
androidVariant 'debug'
properties {
property "sonar.organization", "calebzor-github"
property "sonar.projectKey", "SunnyEats"
property "sonar.projectName", "SunnyEats"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.login", System.getenv("SONAR_LOGIN")
property "sonar.branch.name", System.getenv("CIRCLE_BRANCH") == null ? "master" : System.getenv("CIRCLE_BRANCH").replace("repo ", "")
property "sonar.sourceEncoding", "UTF-8"
property "sonar.projectVersion", readVersionName(project)
property "sonar.project.version", readVersionName(project)
property "sonar.exclusions", "**/*ApiObject.java"
}
}