-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
77 lines (66 loc) · 2.57 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
// Kotlin
kotlin_version = '1.5.21'
// NDK
ndk_version = '21.3.6528147'
// Compile preferred ABIs, or by default, respectively for VM, Desktop, Pepper
abis = ((project.findProperty("ABIS") as String) ?: "x86;x86_64;armeabi-v7a;arm64-v8a").split(';')
println "Configuring project for ABIS: $abis"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.15.1'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.4.32'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1' // Crashlytics plugin
classpath 'com.google.firebase:perf-plugin:1.4.0' // Performance Monitoring plugin
}
}
allprojects {
repositories {
google()
mavenCentral()
}
plugins.withId("com.vanniktech.maven.publish") {
mavenPublish {
sonatypeHost = "S01"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
static def getGitCommitHash() {
'git rev-parse --verify --short HEAD'.execute().text.trim()
}
/**
* Gets a build option from the project's properties,
* or otherwise from an environment variable.
* @param optionName The name of the option to look for.
* @param defaultValue The default value to provide if the option is not found.
* @return The value of the option, or the default value otherwise.
*/
String getOption(String optionName, String defaultValue = "") {
return getOptionAlternate(optionName, optionName, defaultValue)
}
/**
* Gets a build option from the project's properties,
* or otherwise from an environment variable.
* @param optionName The name of the option to look for.
* @param alternateOptionName An alternate name of the option check environment variable.
* @param defaultValue The default value to provide if the option is not found.
* @return The value of the option, or the default value otherwise.
*/
String getOptionAlternate(String optionName, String alternateOptionName, String defaultValue = "") {
return project.findProperty(optionName)?.toString()
?: System.getenv(alternateOptionName)
?: defaultValue
}