-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathbuild.gradle
119 lines (105 loc) · 3.13 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
buildscript {
repositories {
jcenter()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
apply plugin: 'com.android.application'
allprojects {
repositories {
jcenter()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
}
}
def isIde = { ->
def ide = false
def taskRequests = project.gradle.startParameter.taskRequests
if (taskRequests?.empty) {
ide = true
} else {
taskRequests[0].args.any {
if (it.endsWith('generateDebugSources') || it.endsWith('assembleDebug')) {
ide = true
return true
}
}
return ide
}
}
android {
compileSdkVersion 27
buildToolsVersion "27.0.0"
defaultConfig {
versionName new XmlSlurper().parse("AndroidManifest.xml").@'android:versionName'.text()
buildConfigField "boolean", "RELEASE", "false"
buildConfigField "String", "DONATE_ALIPAY", "null"
buildConfigField "String", "DONATE_PAYPAL", "null"
buildConfigField "String", "EMAIL", "null"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
if (isIde()) {
java.srcDirs = ['src', 'services/core/java', 'AndroidHiddenAPI']
} else {
java.srcDirs = ['src', 'services/core/java']
}
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
androidTest.setRoot('tests')
}
if (new File("ant.properties").exists()) {
Properties properties = new Properties()
properties.load(new FileInputStream(file("ant.properties")))
signingConfigs {
release {
storeFile file(properties['key.store'])
storePassword properties['key.store.password']
keyAlias properties['key.alias']
keyPassword properties['key.alias.password']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
debug {
signingConfig signingConfigs.release
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
}
}
dependencies {
if (!isIde()) {
compileOnly fileTree(dir: 'lib', include: ['*.jar'])
}
implementation "com.android.support:support-core-ui:27.0.2"
implementation "com.android.support:support-v13:27.0.2"
}
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation'
if (!isIde()) {
options.compilerArgs << '-Xbootclasspath/p:' + fileTree(dir: 'lib', include: ['*.jar']).asPath
}
}