Skip to content

Commit

Permalink
Merge branch 'feature/sdkv2' into nogorodnikov/merge-sdkv2-into-devel…
Browse files Browse the repository at this point in the history
…op-251122
  • Loading branch information
0xnm committed Nov 25, 2022
2 parents f6e371d + 8d6e9c5 commit f2ef2be
Show file tree
Hide file tree
Showing 492 changed files with 36,187 additions and 10,251 deletions.
1 change: 0 additions & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ build,com.android.tools.build,Apache-2.0,Copyright (C) 2013 The Android Open Sou
build,com.android.tools.lint,Apache-2.0,Copyright (C) 2013 The Android Open Source Project
build,com.google.devtools.ksp,Apache-2.0,"Copyright 2020 Google LLC, Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors."
build,com.pinterest,MIT,"Copyright 2019 Pinterest Inc, Copyright 2016-2019 Stanley Shyiko"
build,com.pinterest.ktlint,MIT,"Copyright 2019 Pinterest Inc, Copyright 2016-2019 Stanley Shyiko"
build,io.github.microutils,Apache-2.0,Copyright (c) 2016-2018 Ohad Shai
build,io.gitlab.arturbosch.detekt,Apache-2.0,Copyright 2016-2019 the original author or authors
build,net.java.dev.jna,"Apache-2.0","Copyright (c) 2007 Timothy Wall, All Rights Reserved"
Expand Down
24 changes: 16 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ tasks.register("assembleAll") {
":dd-sdk-android-rx:assemble",
":dd-sdk-android-sqldelight:assemble",
":dd-sdk-android-timber:assemble",
":dd-sdk-android-tv:assemble"
":dd-sdk-android-tv:assemble",
":library:dd-sdk-android-session-replay:assemble"
)
}

Expand All @@ -95,7 +96,8 @@ tasks.register("unitTestRelease") {
":dd-sdk-android-rx:testReleaseUnitTest",
":dd-sdk-android-sqldelight:testReleaseUnitTest",
":dd-sdk-android-timber:testReleaseUnitTest",
":dd-sdk-android-tv:testReleaseUnitTest"
":dd-sdk-android-tv:testReleaseUnitTest",
":library:dd-sdk-android-session-replay:testReleaseUnitTest"
)
}

Expand All @@ -111,7 +113,8 @@ tasks.register("unitTestDebug") {
":dd-sdk-android-rx:testDebugUnitTest",
":dd-sdk-android-sqldelight:testDebugUnitTest",
":dd-sdk-android-timber:testDebugUnitTest",
":dd-sdk-android-tv:testDebugUnitTest"
":dd-sdk-android-tv:testDebugUnitTest",
":library:dd-sdk-android-session-replay:testDebugUnitTest"
)
}

Expand Down Expand Up @@ -143,7 +146,8 @@ tasks.register("lintCheckAll") {
":dd-sdk-android-rx:lintRelease",
":dd-sdk-android-sqldelight:lintRelease",
":dd-sdk-android-timber:lintRelease",
":dd-sdk-android-tv:lintRelease"
":dd-sdk-android-tv:lintRelease",
":library:dd-sdk-android-session-replay:lintRelease"
)
}

Expand All @@ -159,7 +163,8 @@ tasks.register("checkThirdPartyLicensesAll") {
":dd-sdk-android-rx:checkThirdPartyLicences",
":dd-sdk-android-sqldelight:checkThirdPartyLicences",
":dd-sdk-android-timber:checkThirdPartyLicences",
":dd-sdk-android-tv:checkThirdPartyLicences"
":dd-sdk-android-tv:checkThirdPartyLicences",
":library:dd-sdk-android-session-replay:checkThirdPartyLicences"
)
}

Expand All @@ -175,7 +180,8 @@ tasks.register("checkApiSurfaceChangesAll") {
":dd-sdk-android-rx:checkApiSurfaceChanges",
":dd-sdk-android-sqldelight:checkApiSurfaceChanges",
":dd-sdk-android-timber:checkApiSurfaceChanges",
":dd-sdk-android-tv:checkApiSurfaceChanges"
":dd-sdk-android-tv:checkApiSurfaceChanges",
":library:dd-sdk-android-session-replay:checkApiSurfaceChanges"
)
}

Expand All @@ -198,6 +204,7 @@ tasks.register("detektAll") {
":dd-sdk-android-tv:detektMain",
":instrumented:integration:detekt",
":instrumented:nightly-tests:detekt",
":library:dd-sdk-android-session-replay:detektMain",
":tools:unit:detekt"
)
}
Expand All @@ -214,7 +221,8 @@ tasks.register("koverReportAll") {
":dd-sdk-android-rx:koverXmlReport",
":dd-sdk-android-sqldelight:koverXmlReport",
":dd-sdk-android-timber:koverXmlReport",
":dd-sdk-android-tv:koverXmlReport"
":dd-sdk-android-tv:koverXmlReport",
":library:dd-sdk-android-session-replay:koverXmlReport"
)
}

Expand All @@ -238,7 +246,7 @@ tasks.register("buildNdkIntegrationTestsArtifacts") {
dependsOn(":instrumented:integration:assembleDebug")
}

nightlyTestsCoverageConfig(threshold = 0.92f)
nightlyTestsCoverageConfig(threshold = 0.87f)
kover {
isDisabled = false
disabledProjects = setOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ fun configureFlavorForSampleApp(flavor: ApplicationProductFlavor, rootDir: File)
"DD_OVERRIDE_RUM_URL",
"\"${config.rumEndpoint}\""
)
flavor.buildConfigField(
"String",
"DD_OVERRIDE_SESSION_REPLAY_URL",
"\"${config.sessionReplayEndpoint}\""
)
flavor.buildConfigField(
"String",
"DD_RUM_APPLICATION_ID",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ data class SampleAppConfig(
val logsEndpoint: String = "",
val tracesEndpoint: String = "",
val rumEndpoint: String = "",
val sessionReplayEndpoint: String = "",
val token: String = "",
val rumApplicationId: String = "",
val apiKey: String = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,11 @@ class KotlinFileVisitor {
val functionType = firstChildNode("functionType")

val receiver = functionType.firstChildNodeOrNull("receiverType")?.typeName()
val params = functionType.firstChildNode("functionTypeParameters")
.childrenNodes("type")
.joinToString(", ") { it.typeName() }
val functionTypeParamsNode = functionType.firstChildNode("functionTypeParameters")
val params =
(functionTypeParamsNode.firstChildNodeOrNull("parameter") ?: functionTypeParamsNode)
.childrenNodes("type")
.joinToString(", ") { it.typeName() }
val returns = functionType.firstChildNode("type").typeName()

return if (receiver == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,21 @@ open class GenerateJsonSchemaTask : DefaultTask() {
// region Input/Output

/**
* The [InputFiles] (E.g.: all the json files in `resources/json`).
* The [InputFiles] (E.g.: all the json files in `resources/json`). Note, that it will get all
* files recursively in order to keep Gradle build cache state in a proper way, but only
* top-level files are used for the model generation (they can be just a reference to the
* deeper files, so they may receive no changes making Gradle build cache to have
* a wrong caching decision when deeper files actually change).
*/
@PathSensitive(PathSensitivity.RELATIVE)
@InputFiles
fun getInputFiles(): List<File> {
return getInputDir().listFiles().orEmpty().toList()
.filter { it.extension == "json" }
return getInputDir()
.walkBottomUp()
.filter {
it.isFile && it.extension == "json"
}
.toList()
}

/**
Expand Down Expand Up @@ -95,7 +103,10 @@ open class GenerateJsonSchemaTask : DefaultTask() {
fun performTask() {
val inputDir = getInputDir()
val outputDir = getOutputDir()
val files = getInputFiles().filter { it.name !in ignoredFiles }
val files = getInputFiles()
.filter {
it.name !in ignoredFiles && it.parentFile == inputDir
}

logger.info("Found ${files.size} files in input dir: $inputDir")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ class JsonSchemaReader(
fun readSchema(schemaFile: File): TypeDefinition {
logger.info("Reading schema ${schemaFile.name}")
val schema = loadSchema(schemaFile)
require(schema.type == JsonType.OBJECT) {
"Top level schema with type ${schema.type} is not supported."
}
currentFile = schemaFile
val customName = nameMapping[schemaFile.name]
val fileName = schemaFile.nameWithoutExtension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ internal class KotlinFileVisitorTest {
fun unit(block : (String) -> Unit) {}
fun nullable(block : (String) -> Any?) {}
fun withReceiver(block : String.() -> Int) {}
fun withNamedArgumentOfLambda(block : (name: String) -> Unit) {}
}
""".trimIndent()
)
Expand All @@ -605,7 +606,8 @@ internal class KotlinFileVisitorTest {
" fun withInputs((String, Char) -> Int)\n" +
" fun unit((String) -> Unit)\n" +
" fun nullable((String) -> Any?)\n" +
" fun withReceiver(String.() -> Int)\n",
" fun withReceiver(String.() -> Int)\n" +
" fun withNamedArgumentOfLambda((String) -> Unit)\n",
testedVisitor.description.toString()
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ class JsonSchemaReaderTest(
arrayOf("all_of", User),
arrayOf("all_of_merged", UserMerged),
arrayOf("constant_number", Version),
arrayOf("sets", Video)
arrayOf("sets", Video),
arrayOf("root_schema_with_no_type", Country)
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,15 @@ val User = TypeDefinition.Class(
)
)

val Country = TypeDefinition.Class(
name = "Country",
properties = listOf(
TypeProperty("name", TypeDefinition.Primitive(JsonPrimitiveType.STRING), true),
TypeProperty("continent", TypeDefinition.Primitive(JsonPrimitiveType.STRING), true),
TypeProperty("population", TypeDefinition.Primitive(JsonPrimitiveType.INTEGER), true)
)
)

val UserMerged = TypeDefinition.Class(
name = "UserMerged",
properties = listOf(
Expand Down
17 changes: 17 additions & 0 deletions buildSrc/src/test/resources/input/root_schema_reference.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"$id": "root-schema-reference",
"title": "Country",
"properties": {
"name": {
"type": "string"
},
"continent": {
"type": "string"
},
"population": {
"type": "integer"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "root-schema-with-no-type",
"$ref": "root_schema_reference.json"
}
2 changes: 1 addition & 1 deletion dd-sdk-android-coil/transitiveDependencies
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Dependencies List

androidx.annotation:annotation:1.2.0 : 28 Kb
androidx.lifecycle:lifecycle-common-java8:2.2.0 : 1015 b
androidx.lifecycle:lifecycle-common:2.2.0 : 21 Kb
androidx.lifecycle:lifecycle-common:2.3.1 : 22 Kb
com.squareup.okhttp3:okhttp:3.12.13 : 417 Kb
com.squareup.okio:okio:2.9.0 : 247 Kb
io.coil-kt:coil-base:1.0.0 : 395 Kb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ fun NavigationViewTrackingEffect(
navController
)

@Suppress("ThreadSafety") // TODO RUMM-2214 check composable threading rules
lifecycleOwner.lifecycle.addObserver(observer)

onDispose {
@Suppress("ThreadSafety") // TODO RUMM-2214 check composable threading rules
lifecycleOwner.lifecycle.removeObserver(observer)
observer.onDispose()
}
Expand Down
31 changes: 10 additions & 21 deletions dd-sdk-android-glide/transitiveDependencies
Original file line number Diff line number Diff line change
@@ -1,37 +1,26 @@
Dependencies List

androidx.activity:activity:1.1.0 : 13 Kb
androidx.activity:activity:1.2.3 : 65 Kb
androidx.annotation:annotation-experimental:1.1.0 : 16 Kb
androidx.annotation:annotation:1.2.0 : 28 Kb
androidx.arch.core:core-common:2.1.0 : 10 Kb
androidx.arch.core:core-runtime:2.1.0 : 5 Kb
androidx.asynclayoutinflater:asynclayoutinflater:1.0.0 : 7 Kb
androidx.collection:collection:1.1.0 : 41 Kb
androidx.coordinatorlayout:coordinatorlayout:1.0.0 : 43 Kb
androidx.core:core:1.6.0 : 905 Kb
androidx.cursoradapter:cursoradapter:1.0.0 : 10 Kb
androidx.customview:customview:1.0.0 : 32 Kb
androidx.documentfile:documentfile:1.0.0 : 10 Kb
androidx.drawerlayout:drawerlayout:1.0.0 : 31 Kb
androidx.exifinterface:exifinterface:1.0.0 : 44 Kb
androidx.fragment:fragment:1.2.4 : 221 Kb
androidx.fragment:fragment:1.3.4 : 291 Kb
androidx.interpolator:interpolator:1.0.0 : 7 Kb
androidx.legacy:legacy-support-core-ui:1.0.0 : 11 Kb
androidx.legacy:legacy-support-core-utils:1.0.0 : 4 Kb
androidx.lifecycle:lifecycle-common:2.2.0 : 21 Kb
androidx.lifecycle:lifecycle-livedata-core:2.2.0 : 8 Kb
androidx.lifecycle:lifecycle-common:2.3.1 : 22 Kb
androidx.lifecycle:lifecycle-livedata-core:2.3.1 : 8 Kb
androidx.lifecycle:lifecycle-livedata:2.1.0 : 10 Kb
androidx.lifecycle:lifecycle-runtime:2.2.0 : 10 Kb
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.2.0 : 13 Kb
androidx.lifecycle:lifecycle-viewmodel:2.2.0 : 9 Kb
androidx.lifecycle:lifecycle-runtime:2.3.1 : 10 Kb
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1 : 15 Kb
androidx.lifecycle:lifecycle-viewmodel:2.3.1 : 10 Kb
androidx.loader:loader:1.0.0 : 32 Kb
androidx.localbroadcastmanager:localbroadcastmanager:1.0.0 : 6 Kb
androidx.print:print:1.0.0 : 15 Kb
androidx.savedstate:savedstate:1.0.0 : 9 Kb
androidx.slidingpanelayout:slidingpanelayout:1.0.0 : 22 Kb
androidx.swiperefreshlayout:swiperefreshlayout:1.0.0 : 32 Kb
androidx.vectordrawable:vectordrawable-animated:1.0.0 : 33 Kb
androidx.vectordrawable:vectordrawable:1.0.0 : 31 Kb
androidx.savedstate:savedstate:1.1.0 : 10 Kb
androidx.vectordrawable:vectordrawable-animated:1.1.0 : 33 Kb
androidx.vectordrawable:vectordrawable:1.1.0 : 32 Kb
androidx.versionedparcelable:versionedparcelable:1.1.1 : 30 Kb
androidx.viewpager:viewpager:1.0.0 : 52 Kb
com.github.bumptech.glide:annotations:4.11.0 : 3 Kb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class NdkCrashReportsPlugin : DatadogPlugin {
return
}
val ndkCrashesDirs = File(
config.context.cacheDir,
config.storageDir,
NDK_CRASH_REPORTS_FOLDER
)
try {
Expand Down
11 changes: 4 additions & 7 deletions dd-sdk-android-ndk/src/test/kotlin/NdkCrashReportsPluginTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import com.datadog.android.plugin.DatadogPluginConfig
import com.datadog.android.privacy.TrackingConsent
import com.datadog.tools.unit.setFieldValue
import com.nhaarman.mockitokotlin2.mock
import com.nhaarman.mockitokotlin2.whenever
import fr.xgouchet.elmyr.Forge
import fr.xgouchet.elmyr.junit5.ForgeExtension
import org.assertj.core.api.Assertions.assertThat
Expand Down Expand Up @@ -71,11 +70,10 @@ internal class NdkCrashReportsPluginTest {
forge: Forge
) {
// GIVEN
val mockedContext: Context = mock {
whenever(it.cacheDir).thenReturn(tempDir)
}
val mockedContext: Context = mock()
val config = DatadogPluginConfig(
mockedContext,
tempDir,
forge.anAlphabeticalString(),
forge.anAlphabeticalString(),
trackingConsent
Expand All @@ -101,11 +99,10 @@ internal class NdkCrashReportsPluginTest {
forge: Forge
) {
// GIVEN
val mockedContext: Context = mock {
whenever(it.cacheDir).thenReturn(tempDir)
}
val mockedContext: Context = mock()
val config = DatadogPluginConfig(
mockedContext,
tempDir,
forge.anAlphabeticalString(),
forge.anAlphabeticalString(),
trackingConsent
Expand Down
16 changes: 8 additions & 8 deletions dd-sdk-android-tv/transitiveDependencies
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Dependencies List

androidx.activity:activity:1.1.0 : 13 Kb
androidx.activity:activity:1.2.3 : 65 Kb
androidx.annotation:annotation-experimental:1.1.0 : 16 Kb
androidx.annotation:annotation:1.2.0 : 28 Kb
androidx.arch.core:core-common:2.1.0 : 10 Kb
Expand All @@ -13,23 +13,23 @@ androidx.cursoradapter:cursoradapter:1.0.0 : 10 Kb
androidx.customview:customview:1.0.0 : 32 Kb
androidx.documentfile:documentfile:1.0.0 : 10 Kb
androidx.drawerlayout:drawerlayout:1.0.0 : 31 Kb
androidx.fragment:fragment:1.2.4 : 221 Kb
androidx.fragment:fragment:1.3.4 : 291 Kb
androidx.interpolator:interpolator:1.0.0 : 7 Kb
androidx.leanback:leanback:1.0.0 : 1329 Kb
androidx.legacy:legacy-support-core-ui:1.0.0 : 11 Kb
androidx.legacy:legacy-support-core-utils:1.0.0 : 4 Kb
androidx.lifecycle:lifecycle-common:2.2.0 : 21 Kb
androidx.lifecycle:lifecycle-livedata-core:2.2.0 : 8 Kb
androidx.lifecycle:lifecycle-common:2.3.1 : 22 Kb
androidx.lifecycle:lifecycle-livedata-core:2.3.1 : 8 Kb
androidx.lifecycle:lifecycle-livedata:2.1.0 : 10 Kb
androidx.lifecycle:lifecycle-runtime:2.2.0 : 10 Kb
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.2.0 : 13 Kb
androidx.lifecycle:lifecycle-viewmodel:2.2.0 : 9 Kb
androidx.lifecycle:lifecycle-runtime:2.3.1 : 10 Kb
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1 : 15 Kb
androidx.lifecycle:lifecycle-viewmodel:2.3.1 : 10 Kb
androidx.loader:loader:1.0.0 : 32 Kb
androidx.localbroadcastmanager:localbroadcastmanager:1.0.0 : 6 Kb
androidx.media:media:1.0.0 : 330 Kb
androidx.print:print:1.0.0 : 15 Kb
androidx.recyclerview:recyclerview:1.1.0 : 349 Kb
androidx.savedstate:savedstate:1.0.0 : 9 Kb
androidx.savedstate:savedstate:1.1.0 : 10 Kb
androidx.slidingpanelayout:slidingpanelayout:1.0.0 : 22 Kb
androidx.swiperefreshlayout:swiperefreshlayout:1.0.0 : 32 Kb
androidx.versionedparcelable:versionedparcelable:1.1.1 : 30 Kb
Expand Down
Loading

0 comments on commit f2ef2be

Please sign in to comment.