forked from rm3l/maoni
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
136 lines (117 loc) · 4.77 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*
* Copyright (c) 2016 Armel Soro
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Top-level build file where you can add configuration options common to all sub-projects/modules.
final homePath = System.properties['user.home']
buildscript {
ext.kotlin_version = '1.3.31'
ext.anko_version = '0.10.8'
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:gradle:3.4.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'com.github.triplet.gradle:play-publisher:1.2.0'
classpath 'com.uber:okbuck:0.47.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply plugin: 'com.uber.okbuck'
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
maven {
url 'https://maven.google.com'
}
google()
//To activate temporarily, when waiting for Bintray to approve packages submitted to JCenter
// maven { url 'https://dl.bintray.com/rm3l/maven'}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext.getPlayStoreConfig = {
return file(homePath.toString() + "/.droid/PlayStore.keys.json")
}
ext.getDebugSigningConfig = {
return ['androiddebugkey', new File("${rootDir}/debug.keystore"), 'android', 'android']
}
ext.getReleaseSigningInfo = {
android ->
def storeFile = null
def storePassword = null
def keyAlias = null
def keyPassword = null
//Attempt to read keystore.properties file, if any first
final propsFile = new File(homePath.toString() + "/.droid/", "maoni-keystore.properties")
final configName = 'release'
if (propsFile.exists() && android.signingConfigs.hasProperty(configName)) {
printf("Using properties file located at " + propsFile.absolutePath)
final props = new Properties()
props.load(new FileInputStream(propsFile))
storeFile = new File(props['keystore'].toString())
storePassword = props['storePassword']
keyAlias = props['keyAlias']
keyPassword = props['keyPassword']
} else if (System.console() != null) {
storeFile = System.console().readLine("\nPlease enter path to keystore file: ")
storeFile = new File(storeFile)
storePassword = System.console().readPassword("\nPlease enter the store password: ")
keyAlias = System.console().readLine("\nPlease enter the key alias: ")
keyPassword = System.console().readPassword("\nPlease enter the key password: ")
}
return [storeFile, storePassword, keyAlias, keyPassword]
}
subprojects { project ->
afterEvaluate {
if (project.plugins.hasPlugin("java")) {
addCommonConfigurationForJavaModules(project)
}
// else if (project.plugins.hasPlugin("com.android.application")
// || project.plugins.hasPlugin("com.android.library")) {
// addCommonConfigurationForAndroidModules(project)
// }
project.tasks.withType(Test) { Test task ->
task.jvmArgs << "-Djava.awt.headless=true"
}
}
}
static def addCommonConfigurationForJavaModules(Project project) {
project.sourceCompatibility = JavaVersion.VERSION_1_7
project.targetCompatibility = JavaVersion.VERSION_1_7
}
okbuck {
lint {
disabled = true
}
buildToolVersion = "28.0.3"
target = "android-28"
buckProjects = project.subprojects
}