From c3cc4f41a50c1932ce6ff86520464145bc966010 Mon Sep 17 00:00:00 2001 From: Vyacheslav Rusakov Date: Fri, 27 Dec 2024 13:00:26 +0700 Subject: [PATCH] fix standalone examples tests --- .../android-simple/settings.gradle.kts | 4 ++-- .../settings.gradle.kts | 16 ++++++++-------- .../settings.gradle.kts | 4 ++-- .../settings.gradle.kts | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/standalone/android-simple/settings.gradle.kts b/examples/standalone/android-simple/settings.gradle.kts index 17e8478..3924a3e 100644 --- a/examples/standalone/android-simple/settings.gradle.kts +++ b/examples/standalone/android-simple/settings.gradle.kts @@ -14,8 +14,8 @@ pluginManagement { maven { url = uri("https://maven.pkg.github.com/xvik/gradle-animalsniffer-plugin") credentials { - username = extra["gpr.user"]?.toString() ?: System.getenv("USERNAME") - password = extra["gpr.key"]?.toString() ?: System.getenv("TOKEN") + username = extra.has("gpr.user").let { if (it) extra["gpr.user"] as String else System.getenv("USERNAME")} + password = extra.has("gpr.key").let { if (it) extra["gpr.key"] as String else System.getenv("TOKEN")} } } } diff --git a/examples/standalone/kotlin-multi-android-desktop-server/settings.gradle.kts b/examples/standalone/kotlin-multi-android-desktop-server/settings.gradle.kts index 354d481..d25df4a 100644 --- a/examples/standalone/kotlin-multi-android-desktop-server/settings.gradle.kts +++ b/examples/standalone/kotlin-multi-android-desktop-server/settings.gradle.kts @@ -13,6 +13,14 @@ pluginManagement { } mavenCentral() gradlePluginPortal() + // for github package (used on CI) + maven { + url = uri("https://maven.pkg.github.com/xvik/gradle-animalsniffer-plugin") + credentials { + username = extra.has("gpr.user").let { if (it) extra["gpr.user"] as String else System.getenv("USERNAME")} + password = extra.has("gpr.key").let { if (it) extra["gpr.key"] as String else System.getenv("TOKEN")} + } + } } } @@ -27,14 +35,6 @@ dependencyResolutionManagement { } } mavenCentral() - // for github package (used on CI) - maven { - url = uri("https://maven.pkg.github.com/xvik/gradle-animalsniffer-plugin") - credentials { - username = extra["gpr.user"]?.toString() ?: System.getenv("USERNAME") - password = extra["gpr.key"]?.toString() ?: System.getenv("TOKEN") - } - } } } diff --git a/examples/standalone/kotlin-multi-android-only/settings.gradle.kts b/examples/standalone/kotlin-multi-android-only/settings.gradle.kts index fbaf23e..0f7a8e2 100644 --- a/examples/standalone/kotlin-multi-android-only/settings.gradle.kts +++ b/examples/standalone/kotlin-multi-android-only/settings.gradle.kts @@ -17,8 +17,8 @@ pluginManagement { maven { url = uri("https://maven.pkg.github.com/xvik/gradle-animalsniffer-plugin") credentials { - username = extra["gpr.user"]?.toString() ?: System.getenv("USERNAME") - password = extra["gpr.key"]?.toString() ?: System.getenv("TOKEN") + username = extra.has("gpr.user").let { if (it) extra["gpr.user"] as String else System.getenv("USERNAME")} + password = extra.has("gpr.key").let { if (it) extra["gpr.key"] as String else System.getenv("TOKEN")} } } } diff --git a/examples/standalone/kotlin-multi-desktop-server/settings.gradle.kts b/examples/standalone/kotlin-multi-desktop-server/settings.gradle.kts index aa9b615..e65df9f 100644 --- a/examples/standalone/kotlin-multi-desktop-server/settings.gradle.kts +++ b/examples/standalone/kotlin-multi-desktop-server/settings.gradle.kts @@ -17,8 +17,8 @@ pluginManagement { maven { url = uri("https://maven.pkg.github.com/xvik/gradle-animalsniffer-plugin") credentials { - username = extra["gpr.user"]?.toString() ?: System.getenv("USERNAME") - password = extra["gpr.key"]?.toString() ?: System.getenv("TOKEN") + username = extra.has("gpr.user").let { if (it) extra["gpr.user"] as String else System.getenv("USERNAME")} + password = extra.has("gpr.key").let { if (it) extra["gpr.key"] as String else System.getenv("TOKEN")} } } }