-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Expand file tree
/
Copy pathbuild.gradle
More file actions
90 lines (81 loc) · 2.64 KB
/
build.gradle
File metadata and controls
90 lines (81 loc) · 2.64 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
plugins {
id "com.android.application"
id "kotlin-android"
}
apply plugin: "kotlin-android"
android {
compileSdk 33
defaultConfig {
applicationId "com.example.android.testing.nativesample"
minSdk 18
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
arguments "-DANDROID_STL=c++_shared", "-DENABLE_NATIVE_TEST=OFF"
}
}
}
flavorDimensions = ["default"]
productFlavors {
core {
dimension "default"
applicationId = defaultConfig.applicationId
}
nativeTest {
dimension "default"
externalNativeBuild {
cmake {
arguments "-DENABLE_NATIVE_TEST=ON"
}
}
}
}
externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
}
}
buildFeatures {
prefab true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
testOptions {
managedDevices {
devices {
// run with ../gradlew nexusOneApi30CoreDebugAndroidTest without native tests
// or ../gradlew nexusOneApi30NativeTestDebugAndroidTest with native tests
nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {
// A lower resolution device is used here for better emulator performance
device = "Nexus One"
apiLevel = 30
// Also use the AOSP ATD image for better emulator performance
systemImageSource = "aosp-atd"
}
}
}
}
namespace "com.example.android.testing.nativesample"
}
dependencies {
nativeTestImplementation "androidx.test.ext:junit-gtest:$rootProject.junitGtestVersion"
nativeTestImplementation "com.android.ndk.thirdparty:googletest:$rootProject.googletestVersion"
androidTestImplementation "androidx.test:runner:$rootProject.runnerVersion"
androidTestImplementation "androidx.test.ext:junit-ktx:$extJUnitVersion"
androidTestImplementation "com.google.truth:truth:rootProject.truthVersion"
androidTestImplementation "junit:junit:$rootProject.junitVersion"
}