Skip to content

Commit ac75e67

Browse files
committed
Workaround Gradle exception when the project was apparently already evaluated
1 parent 9342a31 commit ac75e67

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/dependencies/DependenciesTracker.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import de.fayard.refreshVersions.core.internal.forNpm
1010
import de.fayard.refreshVersions.core.internal.withGlobalRepos
1111
import de.fayard.refreshVersions.core.internal.withPluginsRepos
1212
import okhttp3.OkHttpClient
13+
import org.gradle.api.InvalidUserCodeException
1314
import org.gradle.api.Project
1415
import org.gradle.api.artifacts.ConfigurationContainer
1516
import org.gradle.api.artifacts.Dependency
@@ -35,7 +36,11 @@ internal class DependenciesTracker {
3536
// and https://yarnpkg.com/getting-started/migration#update-your-configuration-to-the-new-settings
3637
// and also https://yarnpkg.com/configuration/yarnrc#npmRegistryServer
3738
rootProject.allprojects {
38-
afterEvaluate {
39+
try {
40+
afterEvaluate {
41+
recordBuildscriptAndRegularDependencies(npmRegistries)
42+
}
43+
} catch (e: InvalidUserCodeException) {
3944
recordBuildscriptAndRegularDependencies(npmRegistries)
4045
}
4146
}

0 commit comments

Comments
 (0)