-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
148 lines (125 loc) · 5.38 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
137
138
139
140
141
142
143
144
145
146
147
148
import io.embrace.gradle.Versions
plugins {
id "internal-embrace-plugin"
id("org.jetbrains.kotlinx.kover") version "0.7.1"
id "org.jetbrains.kotlin.kapt"
}
description = "Embrace Android SDK: Core"
apply plugin: "org.jetbrains.dokka"
def NO_NDK = "noNdk"
android {
useLibrary "android.test.runner"
useLibrary "android.test.base"
useLibrary "android.test.mock"
ndkVersion "${Versions.ndk}"
defaultConfig {
namespace = "io.embrace.android.embracesdk"
versionCode 53
versionName version
consumerProguardFiles "embrace-proguard.cfg"
// For library projects only, the BuildConfig.VERSION_NAME and BuildConfig.VERSION_CODE properties have been removed from the generated BuildConfig class
//
// https://developer.android.com/studio/releases/gradle-plugin#version_properties_removed_from_buildconfig_class_in_library_projects
buildConfigField "String", "VERSION_NAME", "\"${defaultConfig.versionName}\""
buildConfigField "String", "VERSION_CODE", "\"${defaultConfig.versionCode}\""
}
if (!project.hasProperty(NO_NDK)) {
externalNativeBuild {
cmake {
path file("CMakeLists.txt")
}
}
}
packagingOptions {
pickFirst "**/*.so"
}
sourceSets {
// Had to add a 'java' directory to store Java test files, as it doesn't get picked up as a test if I put it in
// the kotlin directory. If I've just screwed up somehow and this is actually possible, please consolidate.
test.java.srcDirs += "src/integrationTest/java"
test.kotlin.srcDirs += "src/integrationTest/kotlin"
}
buildFeatures {
buildConfig = true
}
}
// See: https://kotlin.github.io/kotlinx-kover/gradle-plugin/configuring#configuring-default-reports
koverReport {
filters {
excludes {
// exclusion rules - classes to exclude from report
classes("io.embrace.android.embracesdk.BuildConfig")
}
}
androidReports("release") {
filters {
// override report filters for all reports for `release` build variant
// all filters specified by the level above cease to work
}
xml { /* XML report config for `release` build variant */ }
html {
title = "Embrace Android SDK merged coverage report"
}
verify {
// FUTURE: we can specify a minimum bound of coverage for new code here.
}
}
}
dependencies {
implementation "androidx.lifecycle:lifecycle-common-java8:2.5.0"
implementation "androidx.lifecycle:lifecycle-extensions:2.0.0"
// json
implementation("com.squareup.moshi:moshi:${Versions.moshi}")
kapt("com.squareup.moshi:moshi-kotlin-codegen:${Versions.moshi}")
implementation "io.opentelemetry:opentelemetry-api:${Versions.openTelemetry}"
implementation "io.opentelemetry:opentelemetry-sdk:${Versions.openTelemetry}"
implementation "io.opentelemetry:opentelemetry-context:${Versions.openTelemetry}"
// ProfileInstaller 1.2.0 requires compileSdk 32. 1.1.0 requires compileSdk 31.
// Please, don"t update it until we update compileSdk.
implementation "androidx.profileinstaller:profileinstaller:1.0.0"
testImplementation "io.mockk:mockk:1.12.2"
testImplementation "androidx.test:core:1.4.0"
testImplementation "androidx.test.ext:junit:1.1.3"
testImplementation "org.robolectric:robolectric:4.10.3"
testImplementation project(path: ":embrace-android-sdk")
testImplementation "com.squareup.okhttp3:mockwebserver:4.9.3"
testImplementation("com.google.protobuf:protobuf-java:3.24.0")
testImplementation("com.google.protobuf:protobuf-java-util:3.24.0")
testImplementation "org.jetbrains.kotlin:kotlin-reflect:1.4.32"
dokkaHtmlPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:${Versions.dokka}")
dokkaHtmlPlugin("org.jetbrains.dokka:android-documentation-plugin:${Versions.dokka}")
// For the functional tests
androidTestImplementation "androidx.test:core:1.4.0"
androidTestImplementation "androidx.test:runner:1.4.0"
androidTestImplementation "androidx.test:rules:1.4.0"
androidTestImplementation "androidx.test.ext:junit:1.1.3"
androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0"
androidTestImplementation "androidx.appcompat:appcompat:1.1.0"
androidTestImplementation "com.squareup.okhttp3:mockwebserver:4.9.3"
androidTestImplementation "androidx.test.ext:junit:1.1.3"
androidTestImplementation "com.google.code.gson:gson:2.9.0"
androidTestImplementation project(path: ":embrace-android-sdk")
}
dokkaHtml {
outputDirectory.set(rootProject.file("docs"))
dokkaSourceSets {
configureEach {
perPackageOption {
skipDeprecated.set(false)
reportUndocumented.set(true) // Emit warnings about not documented members
includeNonPublic.set(false)
// Suppress files in the internal package
perPackageOption {
matchingRegex.set(".*.internal.*?")
suppress.set(true)
}
}
}
named("main") {
noAndroidSdkLink.set(false)
}
}
suppressObviousFunctions.set(true)
}
task publishLocal { dependsOn("publishMavenPublicationToMavenLocal") }
task publishQa { dependsOn("publishMavenPublicationToQaRepository") }