This repository has been archived by the owner on May 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 332
/
build.gradle
81 lines (73 loc) · 2.97 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
import com.android.ddmlib.DdmPreferences
allprojects {
repositories {
// The order in which you list these repositories matter.
google()
mavenCentral()
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
maven { url "https://appboy.github.io/appboy-android-sdk/sdk" }
maven { url "https://appboy.github.io/appboy-segment-android/sdk" }
maven { url "https://pkgs.dev.azure.com/MicrosoftDeviceSDK/DuoSDK-Public/_packaging/Duo-SDK-Feed/maven/v1" }
}
project.apply from: "${rootDir}/constants.gradle"
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
project.apply from: "${rootDir}/constants.gradle"
repositories {
google()
mavenCentral() // This is the Maven Central repo
}
dependencies {
classpath "com.android.tools.build:gradle:$GRADLE_PLUGIN_VERSION"
classpath "com.google.gms:google-services:$gms_google_services"
// Add the dependency for the Performance Monitoring plugin
classpath "com.google.firebase:perf-plugin:1.4.2" // Performance Monitoring plugin
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
// Firebase Crashlytics Gradle plugin.
classpath "com.google.firebase:firebase-crashlytics-gradle:2.9.7"
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
classpath "org.jacoco:org.jacoco.core:0.8.8"
}
}
// task that creates "artifacts" directory
task createBuildArtifactsDirectory { task ->
doLast {
def hashPipe = new ByteArrayOutputStream()
task.project.exec {
commandLine = ["git", "rev-parse", "--verify", "HEAD"]
standardOutput = hashPipe
}
def destDir = "artifacts"
task.project.exec {
commandLine = ["mkdir", "-p", destDir]
}
}
}
// Copies unit test reports to the "artifacts" directory
task copyUnitTestBuildArtifacts { task ->
doLast {
// copy unit test reports
def srcPath = "OpenEdXMobile/build/reports"
task.project.exec {
commandLine = ["cp", "-R", srcPath, "artifacts"]
}
}
}
copyUnitTestBuildArtifacts.dependsOn createBuildArtifactsDirectory
// Copies lint report to the "artifacts" directory
task copyLintBuildArtifacts(type: Copy) {
from "OpenEdXMobile/build/outputs"
into "artifacts"
include "lint-results*"
include "lint-results*/**"
}
copyLintBuildArtifacts.dependsOn createBuildArtifactsDirectory
// Disables preDex which reduces the amount of memory required to build an APK. This is important
// for CI where there is a memory limit. PreDex is also not useful in CI where a new build is
// desired on every run.
project.ext.preDexLibs = !project.hasProperty("disablePreDex")
// Increases adb timeout for installing an apk. This tweak is need for slow adb installs on an
// emulator for CI.
DdmPreferences.setTimeOut(600000)