-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathbuild.gradle
More file actions
97 lines (83 loc) · 3.22 KB
/
Copy pathbuild.gradle
File metadata and controls
97 lines (83 loc) · 3.22 KB
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
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
namespace 'com.mparticle.testutils'
testNamespace 'com.mparticle.legacyTest'
compileSdk 33
compileOptions {
sourceCompatibility = JavaVersion.toVersion(JAVA_VERSION)
targetCompatibility = JavaVersion.toVersion(JAVA_VERSION)
}
kotlinOptions {
jvmTarget = JAVA_VERSION
}
defaultConfig {
//This is set to 21 to avoid slow multidex.
minSdk 21
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
if (legacyTest()) {
testInstrumentationRunnerArgument 'annotation', 'com.mparticle.LegacyOnly'
} else {
testInstrumentationRunnerArgument 'notAnnotation', 'com.mparticle.LegacyOnly'
}
file("../android-core/src/androidTest/res/raw").mkdir()
def jsSdkRawFile = file("../android-core/src/androidTest/res/raw/mparticle_js_sdk")
jsSdkRawFile.createNewFile()
if (project.hasProperty('js-sdk-file')) {
def jsSdkPath = project.property('js-sdk-file')
def jsSdkSourceFile = file(jsSdkPath)
if (jsSdkSourceFile.exists() && jsSdkSourceFile.isFile()) {
jsSdkRawFile.text = jsSdkSourceFile.text
buildConfigField 'boolean', 'JS_TEST_SDK', 'true'
} else {
logger.warn("js-sdk-file was provided but does not exist or is not a file: ${jsSdkPath}. Falling back to remote JS SDK fetch.")
buildConfigField 'boolean', 'JS_TEST_SDK', 'false'
}
} else {
buildConfigField 'boolean', 'JS_TEST_SDK', 'false'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
testOptions {
execution 'ANDROIDX_TEST_ORCHESTRATOR'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lint {
disable 'OutdatedLibrary'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compileOnly project(':android-core')
compileOnly project(':android-kit-base')
compileOnly 'org.mockito:mockito-android:4.9.0'
api 'androidx.annotation:annotation:1.10.0'
api 'androidx.test.ext:junit:1.1.4'
api 'androidx.test:rules:1.5.0'
androidTestCompileOnly project(':android-core')
if (legacyTest()) {
androidTestImplementation 'com.mparticle:android-core:4.17.1'
} else {
androidTestImplementation project(':android-core')
}
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'com.google.firebase:firebase-messaging:20.0.0'
androidTestUtil 'androidx.test:orchestrator:1.4.2'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_version"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlin_version"
}
boolean legacyTest() {
return project.hasProperty('legacy') ? project.property('legacy') : false
}