@ohos-ports/datadog-mobile-react-native-session-replay 0.0.0-stage → 3.5.3-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DatadogSDKReactNativeSessionReplay.podspec +69 -0
- package/LICENSE +201 -0
- package/README.md +157 -2
- package/android/build.gradle +278 -0
- package/android/consumer-proguard-rules.pro +3 -0
- package/android/detekt.yml +721 -0
- package/android/gradle.properties +6 -0
- package/android/src/main/AndroidManifest.xml +11 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplayImplementation.kt +93 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/ReactNativeInternalCallback.kt +144 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/ReactNativeSessionReplayExtensionSupport.kt +54 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/SessionReplayPrivacySettings.kt +90 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/SessionReplaySDKWrapper.kt +41 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/SessionReplayWrapper.kt +34 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/TextPropertiesResolver.kt +20 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/extensions/ReactDrawablesExt.kt +190 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/mappers/DefaultMapper.kt +65 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/mappers/ReactEditTextMapper.kt +127 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/mappers/ReactNativeImageViewMapper.kt +106 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/mappers/ReactTextMapper.kt +47 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/mappers/ReactViewGroupMapper.kt +18 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/mappers/ReactViewModalMapper.kt +16 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/mappers/SvgViewMapper.kt +163 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/resources/ReactDrawableCopier.kt +34 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/utils/ColorUtils.kt +22 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/utils/DrawableUtils.kt +22 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/utils/ReflectionUtils.kt +30 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/utils/text/FabricTextViewUtils.kt +74 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/utils/text/LegacyTextViewUtils.kt +133 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/utils/text/TextViewUtils.kt +163 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/views/DdPrivacyView.kt +69 -0
- package/android/src/main/res/values/ids.xml +12 -0
- package/android/src/newarch/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplay.kt +68 -0
- package/android/src/newarch/kotlin/com/datadog/reactnative/sessionreplay/views/DdPrivacyViewManager.kt +63 -0
- package/android/src/oldarch/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplay.kt +77 -0
- package/android/src/oldarch/kotlin/com/datadog/reactnative/sessionreplay/views/DdPrivacyViewManager.kt +56 -0
- package/android/src/rn69/kotlin/com.datadog.reactnative.sessionreplay/utils/ReactViewBackgroundDrawableUtils.kt +86 -0
- package/android/src/rn75/kotlin/com/datadog/reactnative/sessionreplay/extensions/LengthPercentageExt.kt +12 -0
- package/android/src/rn75/kotlin/com/datadog/reactnative/sessionreplay/utils/ReactViewBackgroundDrawableUtils.kt +98 -0
- package/android/src/rn76/kotlin/com/datadog/reactnative/sessionreplay/extensions/LengthPercentageExt.kt +13 -0
- package/android/src/rn76/kotlin/com/datadog/reactnative/sessionreplay/utils/ReactViewBackgroundDrawableUtils.kt +98 -0
- package/android/src/rn79/kotlin/com/datadog/reactnative/sessionreplay/extensions/LengthPercentageExt.kt +13 -0
- package/android/src/rn79/kotlin/com/datadog/reactnative/sessionreplay/utils/ReactViewBackgroundDrawableUtils.kt +111 -0
- package/android/src/rn80/kotlin/com/datadog/reactnative/sessionreplay/extensions/ComputedBorderRadiusExt.kt +27 -0
- package/android/src/rn80/kotlin/com/datadog/reactnative/sessionreplay/utils/ReactViewBackgroundDrawableUtils.kt +157 -0
- package/android/src/rn83/kotlin/com/datadog/reactnative/sessionreplay/extensions/ComputedBorderRadiusExt.kt +27 -0
- package/android/src/rn83/kotlin/com/datadog/reactnative/sessionreplay/utils/ReactViewBackgroundDrawableUtils.kt +103 -0
- package/android/src/rnlegacy/kotlin/com.datadog.reactnative.sessionreplay/utils/ReactViewBackgroundDrawableUtils.kt +106 -0
- package/android/src/rnpost74/kotlin/com/datadog/reactnative/sessionreplay/DdSDKReactNativeSessionReplayPackage.kt +54 -0
- package/android/src/rnpre74/kotlin/com/datadog/reactnative/sessionreplay/DdSDKReactNativeSessionReplayPackage.kt +31 -0
- package/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplayImplementationTest.kt +181 -0
- package/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/ReactNativeSessionReplayExtensionSupportTest.kt +99 -0
- package/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/mappers/ReactViewGroupMapperTest.kt +132 -0
- package/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/mappers/SvgViewMapperTest.kt +189 -0
- package/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/utils/ColorUtilsTest.kt +42 -0
- package/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/utils/DrawableUtilsTest.kt +102 -0
- package/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/utils/text/TextViewUtilsTest.kt +470 -0
- package/android/src/test/kotlin/com/datadog/reactnative/tools/unit/GenericAssert.kt +69 -0
- package/android/src/test/kotlin/com/datadog/reactnative/tools/unit/MapExt.kt +29 -0
- package/android/src/test/kotlin/com/datadog/reactnative/tools/unit/ReflectUtils.kt +266 -0
- package/android/src/test/kotlin/com/datadog/reactnative/tools/unit/forge/BaseConfigurator.kt +24 -0
- package/android/src/test/kotlin/com/datadog/reactnative/tools/unit/forge/ForgeConfigurator.kt +24 -0
- package/android/src/test/kotlin/com/datadog/reactnative/tools/unit/forge/TextWireframeForgeryFactory.kt +64 -0
- package/android/src/test/kotlin/com/datadog/reactnative/tools/unit/forge/Throwable.kt +31 -0
- package/android/src/test/kotlin/com/datadog/reactnative/tools/unit/forge/ThrowableForgeryFactory.kt +21 -0
- package/android/src/test/kotlin/com/datadog/reactnative/tools/unit/forge/WireframeClipForgeryFactory.kt +25 -0
- package/android/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker +1 -0
- package/assets/assets.bin +0 -0
- package/assets/assets.json +1 -0
- package/ios/DatadogSDKReactNativeSessionReplay.xcodeproj/project.pbxproj +272 -0
- package/ios/DatadogSDKReactNativeSessionReplay.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
- package/ios/Sources/DatadogSDKReactNativeSessionReplay.h +8 -0
- package/ios/Sources/DdPrivacyOverrider.swift +71 -0
- package/ios/Sources/DdPrivacyViewFabric.h +28 -0
- package/ios/Sources/DdPrivacyViewFabric.mm +78 -0
- package/ios/Sources/DdPrivacyViewPaper.m +86 -0
- package/ios/Sources/DdSessionReplay.h +24 -0
- package/ios/Sources/DdSessionReplay.mm +100 -0
- package/ios/Sources/DdSessionReplayImplementation.swift +180 -0
- package/ios/Sources/RCTFabricWrapper.h +13 -0
- package/ios/Sources/RCTFabricWrapper.mm +113 -0
- package/ios/Sources/RCTTextExtractor.h +18 -0
- package/ios/Sources/RCTTextExtractor.mm +131 -0
- package/ios/Sources/RCTTextPropertiesWrapper.h +23 -0
- package/ios/Sources/RCTTextPropertiesWrapper.mm +28 -0
- package/ios/Sources/RCTTextViewRecorder.swift +135 -0
- package/ios/Sources/RCTVersion.h +8 -0
- package/ios/Sources/SvgViewRecorder.swift +236 -0
- package/ios/Sources/Utils/Bundle+SessionReplay.swift +21 -0
- package/metro.js +7 -0
- package/package.json +84 -5
- package/scripts/build-assets.js +31 -0
- package/scripts/set-ios-rn-version.js +47 -0
- package/src/SessionReplay.ts +225 -0
- package/src/components/SessionReplayView/HideView.tsx +25 -0
- package/src/components/SessionReplayView/MaskAllView.tsx +53 -0
- package/src/components/SessionReplayView/MaskNoneView.tsx +40 -0
- package/src/components/SessionReplayView/PrivacyView.tsx +78 -0
- package/src/components/SessionReplayView/index.ts +34 -0
- package/src/index.ts +27 -0
- package/src/metro/index.ts +89 -0
- package/src/metro/processing.ts +119 -0
- package/src/metro/utils.ts +17 -0
- package/src/nativeModulesTypes.ts +55 -0
- package/src/specs/DdPrivacyView.ts +17 -0
- package/src/specs/DdPrivacyViewNativeComponent.ts +28 -0
- package/src/specs/DdPrivacyViewPaper.ts +15 -0
- package/src/specs/NativeDdSessionReplay.ts +50 -0
- package/src/types/DdPrivacyView.ts +23 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import java.nio.file.Paths
|
|
2
|
+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
3
|
+
|
|
4
|
+
apply plugin: "io.gitlab.arturbosch.detekt"
|
|
5
|
+
|
|
6
|
+
buildscript {
|
|
7
|
+
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
8
|
+
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['DatadogSDKReactNativeSessionReplay_kotlinVersion']
|
|
9
|
+
|
|
10
|
+
repositories {
|
|
11
|
+
mavenCentral()
|
|
12
|
+
google()
|
|
13
|
+
gradlePluginPortal()
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
dependencies {
|
|
17
|
+
classpath 'com.android.tools.build:gradle:7.3.1'
|
|
18
|
+
// noinspection DifferentKotlinGradleVersion
|
|
19
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
20
|
+
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.5.1"
|
|
21
|
+
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.8"
|
|
22
|
+
classpath 'com.github.bjoernq:unmockplugin:0.7.9'
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
apply plugin: 'de.mobilej.unmock'
|
|
28
|
+
|
|
29
|
+
def isNewArchitectureEnabled() {
|
|
30
|
+
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
apply plugin: 'com.android.library'
|
|
34
|
+
if (isNewArchitectureEnabled()) {
|
|
35
|
+
apply plugin: 'com.facebook.react'
|
|
36
|
+
}
|
|
37
|
+
apply plugin: 'kotlin-android'
|
|
38
|
+
apply plugin: 'org.jlleitschuh.gradle.ktlint'
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Finds the path of the installed npm package with the given name using Node's
|
|
42
|
+
* module resolution algorithm, which searches "node_modules" directories up to
|
|
43
|
+
* the file system root.
|
|
44
|
+
* This enables us to handle monorepos without requiring the node executable.
|
|
45
|
+
*
|
|
46
|
+
* The search begins at the given base directory (a File object). The returned
|
|
47
|
+
* path is a string.
|
|
48
|
+
*/
|
|
49
|
+
static def findNodeModulePath(baseDir, packageName) {
|
|
50
|
+
def basePath = baseDir.toPath().normalize()
|
|
51
|
+
// Node's module resolution algorithm searches up to the root directory,
|
|
52
|
+
// after which the base path will be null
|
|
53
|
+
while (basePath) {
|
|
54
|
+
def candidatePath = Paths.get(basePath.toString(), "node_modules", packageName)
|
|
55
|
+
if (candidatePath.toFile().exists()) {
|
|
56
|
+
return candidatePath.toString()
|
|
57
|
+
}
|
|
58
|
+
basePath = basePath.getParent()
|
|
59
|
+
}
|
|
60
|
+
return null
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
def resolveReactNativeDirectory() {
|
|
64
|
+
def reactNativeLocation = rootProject.hasProperty("reactNativeDir") ? rootProject.getProperty("reactNativeDir") : null
|
|
65
|
+
|
|
66
|
+
if (reactNativeLocation != null) {
|
|
67
|
+
return file(reactNativeLocation)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
def reactNativePath = findNodeModulePath(projectDir, "react-native")
|
|
71
|
+
|
|
72
|
+
if (reactNativePath != null) {
|
|
73
|
+
return file(reactNativePath)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
throw new Exception(
|
|
77
|
+
"${project.name}: Failed to resolve 'react-native' in the project. " +
|
|
78
|
+
"Altenatively, you can specify 'reactNativeDir' with the path to 'react-native' in your 'gradle.properties' file."
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
def reactNativeRootDir = resolveReactNativeDirectory()
|
|
83
|
+
def reactProperties = new Properties()
|
|
84
|
+
file("$reactNativeRootDir/ReactAndroid/gradle.properties").withInputStream { reactProperties.load(it) }
|
|
85
|
+
|
|
86
|
+
def reactNativeVersion = reactProperties.getProperty("VERSION_NAME")
|
|
87
|
+
def (reactNativeMajorVersion, reactNativeMinorVersion) = reactNativeVersion.split("\\.").collect { it.isInteger() ? it.toInteger() : it }
|
|
88
|
+
|
|
89
|
+
def getExtOrDefault(name) {
|
|
90
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['DatadogSDKReactNativeSessionReplay_' + name]
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
def getExtOrIntegerDefault(name) {
|
|
94
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['DatadogSDKReactNativeSessionReplay_' + name]).toInteger()
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
android {
|
|
98
|
+
compileSdk getExtOrIntegerDefault('compileSdkVersion')
|
|
99
|
+
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
|
|
100
|
+
buildToolsVersion getExtOrDefault('buildToolsVersion')
|
|
101
|
+
|
|
102
|
+
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
|
|
103
|
+
|
|
104
|
+
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
|
|
105
|
+
namespace = "com.datadog.reactnative.sessionreplay"
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (agpVersion.tokenize('.')[0].toInteger() >= 8) {
|
|
109
|
+
buildFeatures {
|
|
110
|
+
buildConfig = true
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (agpVersion.tokenize('.')[0].toInteger() < 8) {
|
|
115
|
+
compileOptions {
|
|
116
|
+
sourceCompatibility JavaVersion.VERSION_11
|
|
117
|
+
targetCompatibility JavaVersion.VERSION_11
|
|
118
|
+
}
|
|
119
|
+
kotlinOptions {
|
|
120
|
+
jvmTarget = JavaVersion.VERSION_11.majorVersion
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
defaultConfig {
|
|
125
|
+
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
|
|
126
|
+
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
127
|
+
versionCode 1
|
|
128
|
+
versionName "1.0"
|
|
129
|
+
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString())
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
sourceSets {
|
|
133
|
+
main {
|
|
134
|
+
if (isNewArchitectureEnabled()) {
|
|
135
|
+
java.srcDirs += ['src/newarch/kotlin']
|
|
136
|
+
} else {
|
|
137
|
+
java.srcDirs += ['src/oldarch/kotlin']
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (reactNativeMinorVersion >= 83) {
|
|
141
|
+
java.srcDirs += ['src/rn83/kotlin']
|
|
142
|
+
} else if (reactNativeMinorVersion >= 80) {
|
|
143
|
+
java.srcDirs += ['src/rn80/kotlin']
|
|
144
|
+
} else if (reactNativeMinorVersion >= 79) {
|
|
145
|
+
java.srcDirs += ['src/rn79/kotlin']
|
|
146
|
+
} else if (reactNativeMinorVersion >= 76) {
|
|
147
|
+
java.srcDirs += ['src/rn76/kotlin']
|
|
148
|
+
} else if (reactNativeMinorVersion >= 75) {
|
|
149
|
+
java.srcDirs += ['src/rn75/kotlin']
|
|
150
|
+
} else if (reactNativeMinorVersion >= 69) {
|
|
151
|
+
java.srcDirs += ['src/rn69/kotlin']
|
|
152
|
+
} else {
|
|
153
|
+
java.srcDirs += ['src/rnlegacy/kotlin']
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
if (reactNativeMinorVersion >= 74) {
|
|
158
|
+
java.srcDirs += ['src/rnpost74/kotlin']
|
|
159
|
+
} else {
|
|
160
|
+
java.srcDirs += ['src/rnpre74/kotlin']
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
assets.srcDirs += ['../assets']
|
|
164
|
+
}
|
|
165
|
+
test {
|
|
166
|
+
java.srcDir("src/test/kotlin")
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
testOptions {
|
|
171
|
+
unitTests {
|
|
172
|
+
returnDefaultValues = true
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
buildTypes {
|
|
177
|
+
release {
|
|
178
|
+
minifyEnabled false
|
|
179
|
+
consumerProguardFiles 'consumer-proguard-rules.pro'
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
lintOptions {
|
|
183
|
+
disable 'GradleCompatible'
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
repositories {
|
|
188
|
+
mavenCentral()
|
|
189
|
+
google()
|
|
190
|
+
maven { url "https://jitpack.io" }
|
|
191
|
+
mavenLocal()
|
|
192
|
+
|
|
193
|
+
if (reactNativeMajorVersion == 0 && reactNativeMinorVersion < 71) {
|
|
194
|
+
def androidSourcesDir = file("$reactNativeRootDir/android")
|
|
195
|
+
def androidSourcesName = "React Native sources"
|
|
196
|
+
|
|
197
|
+
if (androidSourcesDir.exists()) {
|
|
198
|
+
maven {
|
|
199
|
+
url androidSourcesDir.toString()
|
|
200
|
+
name androidSourcesName
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
def kotlin_version = getExtOrDefault('kotlinVersion')
|
|
207
|
+
|
|
208
|
+
dependencies {
|
|
209
|
+
if (reactNativeMajorVersion == 0 && reactNativeMinorVersion < 71) {
|
|
210
|
+
// noinspection GradleDynamicVersion
|
|
211
|
+
api 'com.facebook.react:react-native:+'
|
|
212
|
+
} else {
|
|
213
|
+
// We specify the $reactNativeVersion, like it's done on the react-native-gradle-plugin, as the plugin is not applied in tests.
|
|
214
|
+
// There is no impact for apps as we apply the same logic:
|
|
215
|
+
// https://github.com/facebook/react-native/blob/e1a1e6aa8030bf11d691c3dcf7abd13b25175027/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/DependencyUtils.kt
|
|
216
|
+
api "com.facebook.react:react-android:$reactNativeVersion"
|
|
217
|
+
}
|
|
218
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
219
|
+
implementation "com.datadoghq:dd-sdk-android-session-replay:3.10.0"
|
|
220
|
+
implementation "com.datadoghq:dd-sdk-android-internal:3.10.0"
|
|
221
|
+
implementation project(path: ':datadog_mobile-react-native')
|
|
222
|
+
|
|
223
|
+
testImplementation "org.junit.platform:junit-platform-launcher:1.6.2"
|
|
224
|
+
testImplementation "org.junit.jupiter:junit-jupiter-api:5.6.2"
|
|
225
|
+
testImplementation "org.junit.jupiter:junit-jupiter-engine:5.6.2"
|
|
226
|
+
testImplementation "org.junit.jupiter:junit-jupiter-params:5.6.2"
|
|
227
|
+
testImplementation "org.mockito:mockito-junit-jupiter:3.4.6"
|
|
228
|
+
testImplementation "org.assertj:assertj-core:3.18.1"
|
|
229
|
+
testImplementation "com.github.xgouchet.Elmyr:core:1.3.1"
|
|
230
|
+
testImplementation "com.github.xgouchet.Elmyr:inject:1.3.1"
|
|
231
|
+
testImplementation "com.github.xgouchet.Elmyr:junit5:1.3.1"
|
|
232
|
+
testImplementation "com.github.xgouchet.Elmyr:jvm:1.3.1"
|
|
233
|
+
testImplementation "org.mockito.kotlin:mockito-kotlin:5.1.0"
|
|
234
|
+
testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
|
235
|
+
|
|
236
|
+
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:1.23.8"
|
|
237
|
+
detektPlugins "io.gitlab.arturbosch.detekt:detekt-rules-libraries:1.23.8"
|
|
238
|
+
|
|
239
|
+
unmock 'org.robolectric:android-all:4.4_r1-robolectric-r2'
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
tasks.withType(Test) {
|
|
243
|
+
useJUnitPlatform {
|
|
244
|
+
includeEngines("spek", "junit-jupiter", "junit-vintage")
|
|
245
|
+
}
|
|
246
|
+
reports {
|
|
247
|
+
junitXml.required.set(true)
|
|
248
|
+
html.required.set(true)
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
tasks.named("check") {
|
|
253
|
+
dependsOn("ktlintCheck")
|
|
254
|
+
dependsOn("detekt")
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
ktlint {
|
|
258
|
+
debug.set(false)
|
|
259
|
+
android.set(true)
|
|
260
|
+
outputToConsole.set(true)
|
|
261
|
+
ignoreFailures.set(false)
|
|
262
|
+
enableExperimentalRules.set(false)
|
|
263
|
+
filter {
|
|
264
|
+
exclude("**/generated/**")
|
|
265
|
+
include("**/kotlin/**")
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
detekt {
|
|
270
|
+
input = files("$projectDir/src/main/kotlin")
|
|
271
|
+
config = files("$projectDir/detekt.yml")
|
|
272
|
+
reports {
|
|
273
|
+
xml {
|
|
274
|
+
enabled = true
|
|
275
|
+
destination = file("build/reports/detekt.xml")
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|