From 87e963afec64728b5a43c8dac7fc67139d4d5d1f Mon Sep 17 00:00:00 2001 From: Akash Yadav Date: Mon, 1 Jul 2024 17:04:59 +0530 Subject: [PATCH] tests(tooling/plugin): use download version for logsender artifacts in tests --- .../src/main/java/com/itsaky/androidide/gradle/common.kt | 2 +- .../src/test/java/com/itsaky/androidide/gradle/utils.kt | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tooling/plugin/src/main/java/com/itsaky/androidide/gradle/common.kt b/tooling/plugin/src/main/java/com/itsaky/androidide/gradle/common.kt index b9828da084..4d578dd229 100644 --- a/tooling/plugin/src/main/java/com/itsaky/androidide/gradle/common.kt +++ b/tooling/plugin/src/main/java/com/itsaky/androidide/gradle/common.kt @@ -38,7 +38,7 @@ internal val Project.isTestEnv: Boolean _PROPERTY_IS_TEST_ENV).toString().toBoolean() internal fun depVersion(testEnv: Boolean): String { - return if (testEnv ) { + return if (testEnv && !System.getenv("CI").toBoolean()) { BuildInfo.VERSION_NAME_SIMPLE } else { BuildInfo.VERSION_NAME_DOWNLOAD diff --git a/tooling/plugin/src/test/java/com/itsaky/androidide/gradle/utils.kt b/tooling/plugin/src/test/java/com/itsaky/androidide/gradle/utils.kt index a4cbebbfda..bb27a089e0 100644 --- a/tooling/plugin/src/test/java/com/itsaky/androidide/gradle/utils.kt +++ b/tooling/plugin/src/test/java/com/itsaky/androidide/gradle/utils.kt @@ -18,6 +18,8 @@ package com.itsaky.androidide.gradle import com.itsaky.androidide.buildinfo.BuildInfo +import com.itsaky.androidide.tooling.api.LogSenderConfig._PROPERTY_IS_TEST_ENV +import com.itsaky.androidide.tooling.api.LogSenderConfig._PROPERTY_MAVEN_LOCAL_REPOSITORY import com.itsaky.androidide.utils.FileProvider import org.gradle.testkit.runner.BuildResult import org.gradle.testkit.runner.GradleRunner @@ -55,8 +57,8 @@ internal fun buildProject( val args = mutableListOf( ":app:tasks", // run any task, as long as it applies the plugins "--init-script", initScript.pathString, - "-Pandroidide.plugins.internal.isTestEnv=true", // plugins should be published to maven local first - "-Pandroidide.plugins.internal.mavenLocalRepositories=$repositories", + "-P$_PROPERTY_IS_TEST_ENV=true", // plugins should be published to maven local first + "-P$_PROPERTY_MAVEN_LOCAL_REPOSITORY=$repositories", "--stacktrace" )