Skip to content

Commit

Permalink
Merge branch 'master' into release/1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xgouchet committed Feb 5, 2021
2 parents dcb5a63 + 5678f98 commit b4d98b4
Show file tree
Hide file tree
Showing 161 changed files with 6,871 additions and 2,644 deletions.
25 changes: 11 additions & 14 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,19 +223,6 @@ publish:release-timber:
- git fetch --depth=1 origin master
- ./gradlew :dd-sdk-android-timber:bintrayUpload --stacktrace --no-daemon


publish:gradle-plugin:
tags: [ "runner:main", "size:large" ]
only:
- tags
image: $CI_IMAGE_DOCKER
stage: publish
timeout: 30m
script:
- aws ssm get-parameter --region us-east-1 --name ci.dd-sdk-android.gradle-properties --with-decryption --query "Parameter.Value" --out text >> ./gradle.properties
- git fetch --depth=1 origin master
- ./gradlew :dd-android-gradle-plugin:bintrayUpload --stacktrace --no-daemon

# SLACK NOTIFICATIONS

notify:release:
Expand All @@ -258,4 +245,14 @@ notify:failure:
script:
- BUILD_URL="$CI_PROJECT_URL/pipelines/$CI_PIPELINE_ID"
- 'MESSAGE_TEXT=":status_alert: $CI_PROJECT_NAME $CI_COMMIT_TAG publish pipeline <$BUILD_URL|$COMMIT_MESSAGE> failed."'
- postmessage "#mobile-rum" "$MESSAGE_TEXT"
- postmessage "#mobile-rum" "$MESSAGE_TEXT"

notify:dogfooding:
stage: notify
when: on_success
only:
- tags
script:
- pip3 install GitPython requests
- aws ssm get-parameter --region us-east-1 --name ci.dd-sdk-android.gh_token --with-decryption --query "Parameter.Value" --out text >> ./gh_token
- python3 dogfood.py -v $CI_COMMIT_TAG
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The whole project is covered by a set of static analysis tools, linters and test
Many great ideas for new features come from the community, and we'd be happy to
consider yours!

To share your request, you can open an [issue](https://github.com/DataDog/dd-sdk-android/issues/new)
To share your request, you can open an [issue](https://github.com/DataDog/dd-sdk-android/issues/new?labels=enhancement&template=feature_request.md)
with the details about what you'd like to see. At a minimum, please provide:

- The goal of the new feature;
Expand All @@ -79,7 +79,7 @@ or UI, contact our support team via https://docs.datadoghq.com/help/ for direct,
faster assistance.

You may submit bug reports concerning the Datadog SDK for Android by
[opening a Github issue](https://github.com/DataDog/dd-sdk-android/issues/new).
[opening a Github issue](https://github.com/DataDog/dd-sdk-android/issues/new?labels=bug&template=bug_report.md).
At a minimum, please provide:

- A description of the problem;
Expand Down
5 changes: 0 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ tasks.register("checkAll") {

tasks.register("assembleAll") {
dependsOn(
":dd-android-gradle-plugin:assemble",
":dd-sdk-android:assemble",
":dd-sdk-android-coil:assemble",
":dd-sdk-android-fresco:assemble",
Expand Down Expand Up @@ -104,7 +103,6 @@ tasks.register("unitTestDebug") {

tasks.register("unitTestTools") {
dependsOn(
":dd-android-gradle-plugin:test",
":sample:java:assembleRelease",
":sample:kotlin:assembleRelease",
":tools:detekt:test",
Expand All @@ -122,7 +120,6 @@ tasks.register("unitTestAll") {

tasks.register("ktlintCheckAll") {
dependsOn(
":dd-android-gradle-plugin:ktlintCheck",
":dd-sdk-android:ktlintCheck",
":dd-sdk-android-coil:ktlintCheck",
":dd-sdk-android-fresco:ktlintCheck",
Expand Down Expand Up @@ -155,7 +152,6 @@ tasks.register("lintCheckAll") {

tasks.register("detektAll") {
dependsOn(
":dd-android-gradle-plugin:detekt",
":dd-sdk-android:detekt",
":dd-sdk-android-coil:detekt",
":dd-sdk-android-fresco:detekt",
Expand All @@ -173,7 +169,6 @@ tasks.register("detektAll") {

tasks.register("jacocoReportAll") {
dependsOn(
":dd-android-gradle-plugin:jacocoTestReport",
":dd-sdk-android:jacocoTestDebugUnitTestReport",
":dd-sdk-android:jacocoTestReleaseUnitTestReport",
":dd-sdk-android-coil:jacocoTestDebugUnitTestReport",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fun Project.ktLintConfig() {
additionalEditorconfigFile.set(file("${project.rootDir}/script/config/.editorconfig"))
filter {
exclude("**/generated/**")
exclude("**/com/datadog/android/rum/internal/domain/model/**")
exclude("**/com/datadog/android/rum/model/**")
include("**/kotlin/**")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ data class JsonDefinition(
@SerializedName("allOf") val allOf: List<JsonDefinition>?,
@SerializedName("properties") val properties: Map<String, JsonDefinition>?,
@SerializedName("definitions") val definitions: Map<String, JsonDefinition>?,
@SerializedName("readOnly") val readOnly: Boolean?
@SerializedName("readOnly") val readOnly: Boolean?,
@SerializedName("additionalProperties") val additionalProperties: JsonDefinition?
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2016-Present Datadog, Inc.
*/

package com.datadog.gradle.plugin.jsonschema

enum class JsonPrimitiveType {
STRING, BOOLEAN, INTEGER, DOUBLE
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,18 @@ class JsonSchemaReader(
val type = definition.type
return when (type) {
JsonType.NULL -> TypeDefinition.Null(definition.description.orEmpty())
JsonType.BOOLEAN,
JsonType.NUMBER,
JsonType.INTEGER,
JsonType.STRING -> transformPrimitive(definition, typeName)
JsonType.BOOLEAN -> transformPrimitive(definition, JsonPrimitiveType.BOOLEAN, typeName)
JsonType.NUMBER -> transformPrimitive(definition, JsonPrimitiveType.DOUBLE, typeName)
JsonType.INTEGER -> transformPrimitive(definition, JsonPrimitiveType.INTEGER, typeName)
JsonType.STRING -> transformPrimitive(definition, JsonPrimitiveType.STRING, typeName)
JsonType.ARRAY -> transformArray(definition, typeName)
JsonType.OBJECT, null -> transformType(definition, typeName)
}
}

private fun transformPrimitive(
definition: JsonDefinition,
primitiveType: JsonPrimitiveType,
typeName: String
): TypeDefinition {
return if (!definition.enum.isNullOrEmpty()) {
Expand All @@ -156,7 +157,7 @@ class JsonSchemaReader(
transformConstant(definition.type, definition.constant, definition.description)
} else {
TypeDefinition.Primitive(
type = definition.type ?: JsonType.NULL,
type = primitiveType,
description = definition.description.orEmpty()
)
}
Expand Down Expand Up @@ -209,7 +210,7 @@ class JsonSchemaReader(
transformEnum(typeName, definition.type, definition.enum, definition.description)
} else if (definition.constant != null) {
transformConstant(definition.type, definition.constant, definition.description)
} else if (!definition.properties.isNullOrEmpty()) {
} else if (!definition.properties.isNullOrEmpty() || definition.additionalProperties != null) {
generateDataClass(typeName, definition)
} else if (!definition.allOf.isNullOrEmpty()) {
generateTypeAllOf(typeName, definition.allOf)
Expand Down Expand Up @@ -255,11 +256,13 @@ class JsonSchemaReader(
)
properties.add(TypeProperty(name, propertyType, !required, readOnly))
}
val additional = definition.additionalProperties?.let { transform(it, "?") }

return TypeDefinition.Class(
name = typeName,
description = definition.description.orEmpty(),
properties = properties
properties = properties,
additionalProperties = additional
)
}

Expand Down
Loading

0 comments on commit b4d98b4

Please sign in to comment.