-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
build.gradle.kts
127 lines (100 loc) · 3.61 KB
/
build.gradle.kts
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
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
*/
plugins {
id("com.android.library")
id("kotlin-android")
}
group = "com.facebook.android"
extra["name"] = "Facebook-Core-Android-SDK"
extra["artifactId"] = "facebook-core"
extra["description"] = "Facebook Core Android SDK"
extra["url"] = "https://github.com/facebook/facebook-android-sdk"
dependencies {
api(project(":facebook-bolts"))
// Support Dependencies
implementation(Libs.androidx_annotation)
implementation(Libs.androidx_legacy_support_core_utils)
implementation(Libs.android_installreferrer)
implementation(Libs.androidx_core_ktx)
implementation(Libs.kotlin_stdlib)
// Unit Tests
testImplementation(project(":facebook-testutil"))
testImplementation(Libs.junit)
testImplementation(Libs.robolectric)
testImplementation(Libs.androidx_test_core)
testImplementation(Libs.mockito_inline)
testImplementation(Libs.mockito_kotlin)
testImplementation(Libs.powermock_core)
testImplementation(Libs.powermock_api_mockito2)
testImplementation(Libs.powermock_junit4)
testImplementation(Libs.powermock_junit4_rule)
testImplementation(Libs.powermock_classloading_xstream)
testImplementation(Libs.assertj_core)
testImplementation(Libs.mockwebserver)
testImplementation(Libs.android_installreferrer)
testImplementation(Libs.kotlin_stdlib)
testImplementation(Libs.kotlin_test_junit)
testImplementation(Libs.play_services_gcm)
}
android {
compileSdkVersion(Config.compileSdk)
// The version of Jacoco used by the android gradle plugin
jacoco { version = "0.8.7" }
defaultConfig {
minSdkVersion(Config.minSdk)
targetSdkVersion(Config.targetSdk)
consumerProguardFiles("proguard-rules.pro")
multiDexEnabled = true
}
buildTypes {
getByName("debug") {
isDebuggable = true
isTestCoverageEnabled = true
}
}
lintOptions { isAbortOnError = false }
compileOptions {
sourceCompatibility(JavaVersion.VERSION_1_8)
targetCompatibility(JavaVersion.VERSION_1_8)
}
kotlinOptions { jvmTarget = "1.8" }
testOptions {
unitTests.all {
it.jvmArgs("-XX:MaxPermSize=1024m")
it.maxHeapSize = "4096m"
// CrashShieldHandlerDebugTest is only available on Sandcastle and Github Actions
// Because local compiling environment may recompile CrashShieldHandler multiple times
// and generate false signals
if (System.getenv("SANDCASTLE") != "1" && System.getenv("GITHUB_ACTIONS") != "1") {
it.exclude("com/facebook/internal/instrument/crashshield/CrashShieldHandlerDebugTest.class")
}
if (System.getenv("GITHUB_ACTIONS") == "1") {
it.exclude("com/facebook/appevents/ondeviceprocessing/OnDeviceProcessingManagerTest.class")
}
}
}
sourceSets { named("test") { java.srcDir("src/test/kotlin") } }
if (System.getenv("SANDCASTLE") == "1") {
testOptions {
unitTests.all {
it.systemProperty(
"robolectric.dependency.repo.url",
"https://maven.thefacebook.com/nexus/content/repositories/central/")
it.systemProperty("robolectric.dependency.repo.id", "central")
it.systemProperty("java.net.preferIPv6Addresses", "true")
it.systemProperty("java.net.preferIPv4Stack", "false")
}
}
}
}
if (file("${rootDir}/internal/safekit-build.gradle").exists()) {
project.apply(from = "${rootDir}/internal/safekit-build.gradle")
}
apply(from = "${rootDir}/jacoco.gradle.kts")
apply(from = "${rootDir}/maven.gradle")
repositories { mavenCentral() }