Skip to content

Commit

Permalink
Merge branch 'release/1.14.0' into nogorodnikov/merge-release-1.14.0-…
Browse files Browse the repository at this point in the history
…into-main
  • Loading branch information
0xnm committed May 30, 2024
2 parents 5c2bc6f + 7eccb03 commit 4e25637
Show file tree
Hide file tree
Showing 59 changed files with 2,463 additions and 1,484 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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.

[*.{kt,kts}]
ktlint_code_style = android_studio
ij_kotlin_allow_trailing_comma_on_call_site = false
ij_kotlin_allow_trailing_comma = false
ij_kotlin_imports_layout=*,java.**,javax.**,kotlin.**,^
max_line_length = 120

# SPDX License Names
[buildSrc/src/main/kotlin/com/datadog/gradle/plugin/checklicenses/SPDXLicense.kt]
ktlint_standard_enum-entry-name-case = disabled
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.4.2
with:
gradle-version: 8.6
gradle-version: 8.7

# Manually build the java bytecode
- name: Execute Gradle build
Expand Down
76 changes: 60 additions & 16 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ include:
# SETUP

variables:
CURRENT_CI_IMAGE: "5"
CURRENT_CI_IMAGE: "8"
CI_IMAGE_DOCKER: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/dd-sdk-android-gradle-plugin:$CURRENT_CI_IMAGE
GIT_DEPTH: 5

DD_AGENT_HOST: "$BUILDENV_HOST_IP"
DD_SERVICE: "dd-sdk-android-gradle-plugin"
DD_ENV_TESTS: "ci"
DD_INTEGRATION_JUNIT_5_ENABLED: "true"
DD_CIVISIBILITY_ENABLED: "true"
DD_INSIDE_CI: "true"
DD_COMMON_AGENT_CONFIG: "dd.env=ci,dd.trace.enabled=false,dd.jmx.fetch.enabled=false"

KUBERNETES_MEMORY_REQUEST: "8Gi"
KUBERNETES_MEMORY_LIMIT: "16Gi"

stages:
- ci-image
Expand All @@ -29,18 +32,17 @@ ci-image:
stage: ci-image
when: manual
except: [ tags, schedules ]
tags: [ "runner:docker" ]
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/docker:20.10.13
tags: [ "arch:amd64" ]
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/docker:24.0.4-gbi-focal
script:
- docker build --tag $CI_IMAGE_DOCKER -f Dockerfile.gitlab .
- docker push $CI_IMAGE_DOCKER
- docker buildx build --tag $CI_IMAGE_DOCKER -f Dockerfile.gitlab --push .

# SECURITY

create_key:
stage: security
when: manual
tags: [ "runner:docker" ]
tags: [ "arch:amd64" ]
variables:
PROJECT_NAME: "dd-sdk-android-gradle-plugin"
EXPORT_TO_KEYSERVER: "true"
Expand All @@ -59,11 +61,11 @@ static-analysis:
variables:
DETEKT_PUBLIC_API: "true"
trigger:
include: "https://gitlab-templates.ddbuild.io/mobile/v13284631-3b5f5110/static-analysis.yml"
include: "https://gitlab-templates.ddbuild.io/mobile/v25558398-8517309a/static-analysis.yml"
strategy: depend

analysis:licenses:
tags: [ "runner:main" ]
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: analysis
timeout: 30m
Expand All @@ -72,7 +74,7 @@ analysis:licenses:
- GRADLE_OPTS="-Xmx2560m" ./gradlew :dd-sdk-android-gradle-plugin:checkThirdPartyLicences --stacktrace --no-daemon

analysis:woke:
tags: [ "runner:main" ]
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: analysis
timeout: 30m
Expand All @@ -83,15 +85,16 @@ analysis:woke:
# TESTS

test:plugin:
tags: [ "runner:main" ]
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: test
timeout: 1h
script:
- git fetch --depth=1 origin main
- rm -rf ~/.gradle/daemon/
- CODECOV_TOKEN=$(aws ssm get-parameter --region us-east-1 --name ci.dd-sdk-android-gradle-plugin.codecov-token --with-decryption --query "Parameter.Value" --out text)
- GRADLE_OPTS="-Xmx2560m" ./gradlew :dd-sdk-android-gradle-plugin:test --stacktrace --no-daemon
- export DD_AGENT_HOST="$BUILDENV_HOST_IP"
- GRADLE_OPTS="-Xmx2560m" DD_TAGS="test.module:dd-sdk-android-gradle-plugin" ./gradlew :dd-sdk-android-gradle-plugin:test --stacktrace --no-daemon -Dorg.gradle.jvmargs=-javaagent:$(pwd)/libs/dd-java-agent-1.26.1.jar=$DD_COMMON_AGENT_CONFIG
- bash <(cat ./codecov.sh) -t $CODECOV_TOKEN
artifacts:
reports:
Expand All @@ -100,7 +103,7 @@ test:plugin:
# PUBLISH ARTIFACTS

publish:publish-sonatype:
tags: [ "runner:main" ]
tags: [ "arch:amd64" ]
only:
- tags
image: $CI_IMAGE_DOCKER
Expand All @@ -116,7 +119,7 @@ publish:publish-sonatype:
- ./gradlew :dd-sdk-android-gradle-plugin:publishPluginMavenPublicationToMavenRepository --stacktrace --no-daemon

publish:publish-gradle-portal:
tags: [ "runner:main" ]
tags: [ "arch:amd64" ]
only:
- tags
image: $CI_IMAGE_DOCKER
Expand All @@ -140,7 +143,7 @@ notify:release:
script:
- MAVEN_URL="https://search.maven.org/artifact/com.datadoghq/dd-sdk-android-gradle-plugin/$CI_COMMIT_TAG/aar"
- 'MESSAGE_TEXT=":package: $CI_PROJECT_NAME $CI_COMMIT_TAG published on :maven: $MAVEN_URL"'
- postmessage "#mobile-rum" "$MESSAGE_TEXT"
- postmessage "#mobile-sdk-ops" "$MESSAGE_TEXT"

notify:failure:
extends: .slack-notifier-base
Expand All @@ -151,4 +154,45 @@ 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-sdk-ops" "$MESSAGE_TEXT"

# DOGFOOD

notify:dogfood-app:
tags: [ "arch:amd64" ]
only:
- tags
image: $CI_IMAGE_DOCKER
stage: notify
when: on_success
script:
- pip3 install GitPython requests
# reuse service account
- 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 -t app

notify:dogfood-demo:
tags: [ "arch:amd64" ]
only:
- tags
image: $CI_IMAGE_DOCKER
stage: notify
when: on_success
script:
- pip3 install GitPython requests
# reuse service account
- 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 -t demo

notify:dogfood-gradle-plugin:
tags: [ "arch:amd64" ]
only:
- tags
image: $CI_IMAGE_DOCKER
stage: notify
when: on_success
script:
- pip3 install GitPython requests
# reuse service account
- 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 -t gradle-plugin
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# 1.14.0 / 2024-05-30

* [FEATURE] Add tasks for upload NDK symbol files to Datadog. See [#220](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/220)
* [FEATURE] Support new Variant API. See [#263](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/263)
* [IMPROVEMENT] Standardize architectures. See [#249](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/249)
* [IMPROVEMENT] Emulate upload network call for functional tests. See [#255](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/255)
* [IMPROVEMENT] Mark upload task as not compatible with configuration cache. See [#256](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/256)
* [IMPROVEMENT] Avoid BuildId task creation if there is no obfuscation or native build providers registered. See [#259](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/259)
* [IMPROVEMENT] Increase upload timeout to 120s to match EvP limits. See [#261](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/261)
* [IMPROVEMENT] Add test for the duplicate resources issue with AGP 8.4.x. See [#264](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/264)
* [IMPROVEMENT] Use mapping file provider in case of legacy Variant API. See [#265](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/265)
* [MAINTENANCE] Next dev iteration. See [#233](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/233)
* [MAINTENANCE] Update version of static analysis pipeline used. See [#234](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/234)
* [MAINTENANCE] Update Datadog SDK to version 2.8.0. See [#235](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/235)
* [MAINTENANCE] Merge `release/1.13.0` branch into `develop` branch. See [#236](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/236)
* [MAINTENANCE] Use Datadog Gradle Plugin 1.13.0 in samples. See [#238](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/238)
* [MAINTENANCE] Update AGP to 8.3.2. See [#239](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/239)
* [MAINTENANCE] Merge release `1.13.1` into `develop` branch. See [#244](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/244)
* [MAINTENANCE] Use Datadog Gradle Plugin 1.13.1 for samples. See [#245](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/245)
* [MAINTENANCE] Migrate to GBI images. See [#246](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/246)
* [MAINTENANCE] Add dogfood script. See [#247](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/247)
* [MAINTENANCE] Install NDK 25.1.8937393 in the Docker image. See [#248](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/248)
* [MAINTENANCE] Redirect slack notifications to `mobile-sdk-ops` channel. See [#250](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/250)
* [MAINTENANCE] Update Gradle to 8.7, AGP to 8.4.0. See [#253](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/253)
* [MAINTENANCE] Update Datadog SDK to version 2.9.0. See [#254](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/254)
* [MAINTENANCE] Update AGP version to 8.4.1. See [#260](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/260)
* [MAINTENANCE] Update Datadog SDK to version 2.10.0. See [#262](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/262)

# 1.13.1 / 2024-04-11

* [BUGFIX] Avoid eager fetching of Variant values. See [#240](https://github.com/DataDog/dd-sdk-android-gradle-plugin/pull/240)
Expand Down
3 changes: 0 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ The whole project is covered by a set of static analysis tools, linters and test
# launches the unit tests
./gradlew :dd-sdk-android-gradle-plugin:test

# launches the detekt static analysis
./gradlew :dd-sdk-android-gradle-plugin:detekt

# launches the ktlint check and formatter for all Kotlin files (the ktlint client needs to be installed on your machine)
ktlint -F "**/*.kt" "**/*.kts" '!**/build/generated/**' '!**/build/kspCaches/**'

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile.gitlab
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.ddbuild.io/images/mirror/ubuntu:20.04
FROM registry.ddbuild.io/images/docker:24.0.4-gbi-focal

ENV DEBIAN_FRONTEND=noninteractive

Expand All @@ -24,11 +24,11 @@ RUN set -x \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/*

ENV GRADLE_VERSION 8.6
ENV GRADLE_VERSION 8.7
ENV ANDROID_COMPILE_SDK 34
ENV ANDROID_BUILD_TOOLS 34.0.0
ENV ANDROID_SDK_TOOLS 11076708
ENV NDK_VERSION 21.3.6528147
ENV NDK_VERSION 26.1.10909125
ENV CMAKE_VERSION 3.22.1


Expand Down Expand Up @@ -70,7 +70,7 @@ RUN \
echo y | android-sdk-linux/cmdline-tools/latest/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null && \
echo y | android-sdk-linux/cmdline-tools/latest/bin/sdkmanager --install "ndk;${NDK_VERSION}" >/dev/null && \
echo y | android-sdk-linux/cmdline-tools/latest/bin/sdkmanager --install "cmake;${CMAKE_VERSION}" >/dev/null && \
yes | android-sdk-linux/cmdline-tools/latest/bin/sdkmanager --licenses
(yes || true) | android-sdk-linux/cmdline-tools/latest/bin/sdkmanager --licenses

RUN set -x \
&& curl -OL https://s3.amazonaws.com/dd-package-public/dd-package.deb && dpkg -i dd-package.deb && rm dd-package.deb \
Expand Down
1 change: 0 additions & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ dependencies {

// Dependencies used to configure the gradle plugins
implementation(embeddedKotlin("gradle-plugin"))
implementation(libs.detektPluginGradle)
implementation(libs.androidToolsPluginGradle)
implementation(libs.versionsPluginGradle)
implementation(libs.fuzzyWuzzy)
Expand Down
28 changes: 0 additions & 28 deletions buildSrc/src/main/kotlin/com/datadog/gradle/config/DetektConfig.kt

This file was deleted.

20 changes: 0 additions & 20 deletions buildSrc/src/main/kotlin/com/datadog/gradle/config/KotlinConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ package com.datadog.gradle.config

import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.api.tasks.testing.Test
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.File

fun Project.kotlinConfig() {
taskConfig<KotlinCompile> {
Expand All @@ -19,22 +17,4 @@ fun Project.kotlinConfig() {
jvmTarget = JavaVersion.VERSION_11.toString()
}
}

val moduleName = this@kotlinConfig.name
val javaAgentJar = File(File(rootDir, "libs"), "dd-java-agent-0.98.1.jar")
taskConfig<Test> {
if (environment["DD_INTEGRATION_JUNIT_5_ENABLED"] == "true") {
// set the `env` tag for the test spans
environment("DD_ENV", "ci")
// add custom tags based on the module and variant (debug/release, flavors, …)
environment("DD_TAGS", "test.module:$moduleName")

// disable other Datadog integrations that could interact with the Java Agent
environment("DD_INTEGRATIONS_ENABLED", "false")
// disable JMX integration
environment("DD_JMX_FETCH_ENABLED", "false")

jvmArgs("-javaagent:${javaAgentJar.absolutePath}")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@ import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.findByType
import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.named
import org.gradle.plugins.signing.SigningExtension
import java.net.URI

object MavenConfig {

val VERSION = Version(1, 13, 1, Version.Type.Release)
val VERSION = Version(1, 14, 0, Version.Type.Release)
const val GROUP_ID = "com.datadoghq"
const val PUBLICATION = "pluginMaven"
}

@Suppress("UnstableApiUsage")
fun Project.publishingConfig(projectDescription: String) {
val projectName = name
val signingExtension = extensions.findByType(SigningExtension::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

package com.datadog.gradle.plugin.checklicenses

@Suppress("ktlint:enum-entry-name-case", "EnumNaming")
@Suppress("ktlint:standard:enum-entry-name-case", "EnumNaming")
enum class SPDXLicense(val csvName: String) {
_0BSD("0BSD"),
AAL("AAL"),
Expand Down
4 changes: 0 additions & 4 deletions dd-sdk-android-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import com.datadog.gradle.config.MavenConfig
import com.datadog.gradle.config.dependencyUpdateConfig
import com.datadog.gradle.config.detektConfig
import com.datadog.gradle.config.jacocoConfig
import com.datadog.gradle.config.javadocConfig
import com.datadog.gradle.config.junitConfig
Expand All @@ -26,7 +25,6 @@ plugins {

// Analysis tools
id("com.github.ben-manes.versions")
id("io.gitlab.arturbosch.detekt")

// Tests
jacoco
Expand All @@ -48,11 +46,9 @@ dependencies {
testImplementation(libs.okHttpMock)
testImplementation(libs.androidToolsPluginGradle)
testImplementation(libs.kotlinPluginGradle)
detekt(libs.detektCli)
}

kotlinConfig()
detektConfig()
junitConfig()
jacocoConfig()
javadocConfig()
Expand Down
Loading

0 comments on commit 4e25637

Please sign in to comment.