From ac75e676e6ca11323ce47c0b5dbe9d592c03ccbb Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 27 Sep 2023 18:58:41 +0200 Subject: [PATCH] Workaround Gradle exception when the project was apparently already evaluated --- .../core/internal/dependencies/DependenciesTracker.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/dependencies/DependenciesTracker.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/dependencies/DependenciesTracker.kt index 13246f49c..9ebf85e2f 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/dependencies/DependenciesTracker.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/dependencies/DependenciesTracker.kt @@ -10,6 +10,7 @@ import de.fayard.refreshVersions.core.internal.forNpm import de.fayard.refreshVersions.core.internal.withGlobalRepos import de.fayard.refreshVersions.core.internal.withPluginsRepos import okhttp3.OkHttpClient +import org.gradle.api.InvalidUserCodeException import org.gradle.api.Project import org.gradle.api.artifacts.ConfigurationContainer import org.gradle.api.artifacts.Dependency @@ -35,7 +36,11 @@ internal class DependenciesTracker { // and https://yarnpkg.com/getting-started/migration#update-your-configuration-to-the-new-settings // and also https://yarnpkg.com/configuration/yarnrc#npmRegistryServer rootProject.allprojects { - afterEvaluate { + try { + afterEvaluate { + recordBuildscriptAndRegularDependencies(npmRegistries) + } + } catch (e: InvalidUserCodeException) { recordBuildscriptAndRegularDependencies(npmRegistries) } }