Apply plugin repository credentials for dependency graph plugin

This commit is contained in:
daz
2024-03-12 15:49:28 +13:00
parent f58a414c4f
commit 7b589d9740
2 changed files with 53 additions and 2 deletions

View File

@@ -4,13 +4,29 @@ buildscript {
return System.getProperty(name) ?: System.getenv(envVarName)
}
def pluginRepositoryUrl = getInputParam('gradle.plugin-repository.url') ?: 'https://plugins.gradle.org/m2'
def pluginRepositoryUsername = getInputParam('gradle.plugin-repository.username')
def pluginRepositoryPassword = getInputParam('gradle.plugin-repository.password')
def dependencyGraphPluginVersion = getInputParam('dependency-graph-plugin.version') ?: '1.2.2'
logger.lifecycle("Resolving dependency graph plugin ${dependencyGraphPluginVersion} from plugin repository: ${pluginRepositoryUrl}")
repositories {
maven { url pluginRepositoryUrl }
maven {
url pluginRepositoryUrl
if (pluginRepositoryUsername && pluginRepositoryPassword) {
logger.lifecycle("Applying credentials for plugin repository: ${pluginRepositoryUrl}")
credentials {
username(pluginRepositoryUsername)
password(pluginRepositoryPassword)
}
authentication {
basic(BasicAuthentication)
}
}
}
}
dependencies {
classpath "org.gradle:github-dependency-graph-gradle-plugin:${dependencyGraphPluginVersion}"
}
}
apply plugin: org.gradle.github.GitHubDependencyGraphPlugin