From 42dfa2492c279c8b9440930c56f978b46465c149 Mon Sep 17 00:00:00 2001 From: "Xavier F. Gouchet" Date: Mon, 9 Oct 2023 12:06:10 +0200 Subject: [PATCH] Disable warning as errors locally --- .../src/main/kotlin/com/datadog/gradle/config/KotlinConfig.kt | 3 ++- local_ci.sh | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/com/datadog/gradle/config/KotlinConfig.kt b/buildSrc/src/main/kotlin/com/datadog/gradle/config/KotlinConfig.kt index 8c72d799cd..d2655b6ee5 100644 --- a/buildSrc/src/main/kotlin/com/datadog/gradle/config/KotlinConfig.kt +++ b/buildSrc/src/main/kotlin/com/datadog/gradle/config/KotlinConfig.kt @@ -20,7 +20,8 @@ fun Project.kotlinConfig( taskConfig { compilerOptions { jvmTarget.set(jvmBytecodeTarget) - allWarningsAsErrors.set(evaluateWarningsAsErrors) + val isCI = System.getenv("CI").toBoolean() + allWarningsAsErrors.set(evaluateWarningsAsErrors && isCI) apiVersion.set(KotlinVersion.KOTLIN_1_7) languageVersion.set(KotlinVersion.KOTLIN_1_7) } diff --git a/local_ci.sh b/local_ci.sh index 72719534e7..75712a544e 100755 --- a/local_ci.sh +++ b/local_ci.sh @@ -9,6 +9,7 @@ ANALYSIS=0 COMPILE=0 TEST=0 UPDATE_SESSION_REPLAY_PAYLOAD=0 +export CI=true while [[ $# -gt 0 ]]; do case $1 in @@ -187,4 +188,5 @@ if [[ $UPDATE_SESSION_REPLAY_PAYLOAD == 1 ]]; then adb pull $PAYLOAD_INPUT_DIRECTORY_PATH $PAYLOAD_OUTPUT_DIRECTORY_PATH fi +unset CI echo "-- Done ✔︎"