Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
fix(gradle-plugin): mark 'gradle-plugin' dependency as not-changing (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
itsaky committed Feb 19, 2024
1 parent a9195f0 commit 6895576
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ abstract class GenerateInitScriptTask : DefaultTask() {
}
dependencies {
classpath '${mavenGroupId.get()}:gradle-plugin:${downloadVersion.get()}'
classpath('${mavenGroupId.get()}:gradle-plugin:${downloadVersion.get()}') {
setChanging(false)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import com.itsaky.androidide.tooling.api.LogSenderConfig._PROPERTY_IS_TEST_ENV
import com.itsaky.androidide.tooling.api.LogSenderConfig._PROPERTY_MAVEN_LOCAL_REPOSITORY
import org.gradle.StartParameter
import org.gradle.api.Plugin
import org.gradle.api.artifacts.ExternalModuleDependency
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.initialization.Settings
import org.gradle.api.invocation.Gradle
Expand Down Expand Up @@ -50,7 +51,13 @@ class AndroidIDEInitScriptPlugin : Plugin<Gradle> {
target.rootProject { rootProject ->
rootProject.buildscript.apply {
dependencies.apply {
add("classpath", rootProject.ideDependency("gradle-plugin"))
val gradlePluginDep = rootProject.ideDependency("gradle-plugin")
if (gradlePluginDep is ExternalModuleDependency) {
// SNAPSHOT versions of gradle-plugin do not change
gradlePluginDep.isChanging = false
}

add("classpath", gradlePluginDep)
}

repositories.addDependencyRepositories(rootProject.gradle.startParameter)
Expand Down

0 comments on commit 6895576

Please sign in to comment.