From 5c7e362ae3695db3cfeeacc3bfc92fda3d91c1d0 Mon Sep 17 00:00:00 2001 From: Daz DeBoer Date: Tue, 17 Dec 2024 17:59:42 -0700 Subject: [PATCH] Remove deprecation warning from init-script (#491) --- ...github-dependency-graph-gradle-plugin-apply.groovy | 2 +- .../gradlebuildaction/TestDependencyGraph.groovy | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/sources/src/resources/init-scripts/gradle-actions.github-dependency-graph-gradle-plugin-apply.groovy b/sources/src/resources/init-scripts/gradle-actions.github-dependency-graph-gradle-plugin-apply.groovy index 268333e3..04921e6e 100644 --- a/sources/src/resources/init-scripts/gradle-actions.github-dependency-graph-gradle-plugin-apply.groovy +++ b/sources/src/resources/init-scripts/gradle-actions.github-dependency-graph-gradle-plugin-apply.groovy @@ -11,7 +11,7 @@ buildscript { logger.lifecycle("Resolving dependency graph plugin ${dependencyGraphPluginVersion} from plugin repository: ${pluginRepositoryUrl}") repositories { maven { - url pluginRepositoryUrl + url = pluginRepositoryUrl if (pluginRepositoryUsername && pluginRepositoryPassword) { logger.lifecycle("Applying credentials for plugin repository: ${pluginRepositoryUrl}") credentials { diff --git a/sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDependencyGraph.groovy b/sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDependencyGraph.groovy index b8181acb..8bd3324e 100644 --- a/sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDependencyGraph.groovy +++ b/sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDependencyGraph.groovy @@ -141,7 +141,7 @@ class TestDependencyGraph extends BaseInitScriptTest { // TODO:DAZ This props are set too late to control init-script plugin resolution // This makes the tests fail on Mac with Gradle < 6 def args = jvmArgs - args.add('-DGRADLE_PLUGIN_REPOSITORY_URL=https://plugins.grdev.net/m2') + args.add('-Dgradle.plugin-repository.url=https://plugins.grdev.net/m2') def result = run(['help', '--info'], initScript, testGradleVersion.gradleVersion, args, vars) then: @@ -160,12 +160,11 @@ class TestDependencyGraph extends BaseInitScriptTest { vars.put('GRADLE_PLUGIN_REPOSITORY_URL', 'https://plugins.grdev.net/m2') vars.put('GRADLE_PLUGIN_REPOSITORY_USERNAME', 'REPO_USER') vars.put('GRADLE_PLUGIN_REPOSITORY_PASSWORD', 'REPO_PASSWORD') - // TODO:DAZ This props are set too late to control init-script plugin resolution - // This makes the tests fail on Mac with Gradle < 6 + def args = jvmArgs - args.add('-DGRADLE_PLUGIN_REPOSITORY_URL=https://plugins.grdev.net/m2') - args.add('-DGRADLE_PLUGIN_REPOSITORY_USERNAME=REPO_USER') - args.add('-DGRADLE_PLUGIN_REPOSITORY_PASSWORD=REPO_PASSWORD') + args.add('-Dgradle.plugin-repository.url=https://plugins.grdev.net/m2') + args.add('-Dgradle.plugin-repository.username=REPO_USER') + args.add('-Dgradle.plugin-repository.password=REPO_PASSWORD') def result = run(['help', '--info'], initScript, testGradleVersion.gradleVersion, args, vars) then: