Remove Unused code in spring-security-dependencies.gradle
Issue gh-9541
This commit is contained in:
parent
19fd2f2ca7
commit
ad2bc7d92c
|
@ -1,12 +1,3 @@
|
|||
import com.github.benmanes.gradle.versions.reporter.result.DependencyOutdated
|
||||
import com.github.benmanes.gradle.versions.reporter.result.Result
|
||||
import org.gradle.wrapper.BootstrapMainStarter
|
||||
import org.gradle.wrapper.Download
|
||||
import org.gradle.wrapper.Install
|
||||
import org.gradle.wrapper.Logger
|
||||
import org.gradle.wrapper.PathAssembler
|
||||
import org.gradle.wrapper.WrapperExecutor
|
||||
|
||||
plugins {
|
||||
id 'java-platform'
|
||||
}
|
||||
|
@ -86,132 +77,3 @@ dependencies {
|
|||
}
|
||||
}
|
||||
|
||||
//def updateDepencencyInlineVersion(Project project, DependencyOutdated dependency) {
|
||||
// def originalDependency = "${dependency.group}:${dependency.name}:${dependency.version}"
|
||||
// def replacementDependency = "${dependency.group}:${dependency.name}:${dependency.available.release ?: dependency.available.milestone}"
|
||||
// def buildFileText = project.buildFile.text
|
||||
// project.buildFile.text = buildFileText.replace(originalDependency, replacementDependency)
|
||||
//}
|
||||
//
|
||||
//def updateDepencencyWithVersionVariable(Project project, DependencyOutdated dependency) {
|
||||
// java.io.File gradleProperties = project.getRootProject().file(Project.GRADLE_PROPERTIES)
|
||||
// def gradlePropertiesText = gradleProperties.text
|
||||
// if (!gradleProperties.exists()) {
|
||||
// return
|
||||
// }
|
||||
// def originalDependency = "\"${dependency.group}:${dependency.name}:\\\$\\{?([^'\"]+?)\\}?\""
|
||||
// java.util.regex.Pattern pattern = java.util.regex.Pattern.compile(originalDependency);
|
||||
// def buildFileText = project.buildFile.text
|
||||
// java.util.regex.Matcher matcher = pattern.matcher(buildFileText)
|
||||
// while (matcher.find()) {
|
||||
// def versionVariable = matcher.group(1)
|
||||
// gradlePropertiesText = gradlePropertiesText.replace("$versionVariable=${dependency.version}","$versionVariable=${dependency.available.release ?: dependency.available.milestone}")
|
||||
// }
|
||||
// gradleProperties.text = gradlePropertiesText
|
||||
//}
|
||||
//
|
||||
//tasks.dependencyUpdates.configure {
|
||||
// checkConstraints = true
|
||||
// outputFormatter = { Result result ->
|
||||
// def updatable = result.outdated.dependencies
|
||||
// if (!updatable.isEmpty()){
|
||||
// def groups = [:]
|
||||
// updatable.each { DependencyOutdated dependency ->
|
||||
// groups.get(dependency.group, []).add(dependency)
|
||||
// }
|
||||
// println groups.keySet()
|
||||
// groups.forEach { group, dependencies ->
|
||||
// dependencies.forEach { dependency ->
|
||||
// def originalDependency = "${dependency.group}:${dependency.name}:${dependency.version}"
|
||||
// def updatedDependency = "${dependency.group}:${dependency.name}:${dependency.available.release ?: dependency.available.milestone}"
|
||||
// println "Updating $originalDependency to $updatedDependency"
|
||||
// updateDepencencyInlineVersion(project, dependency)
|
||||
// updateDepencencyWithVersionVariable(project, dependency)
|
||||
// }
|
||||
// def version = dependencies[0].available.release ?: dependencies[0].available.milestone
|
||||
// def title = dependencies.size() == 1 ? "Update ${dependencies[0].name} to $version" : "Update $group to $version"
|
||||
// if (new ProcessBuilder().directory(project.rootDir).command("git", "checkout", "-b", "bot-"+title.replace(' ', '-').toLowerCase()).start()
|
||||
// .waitFor() != 0) {
|
||||
// throw new IllegalStateException("git branch failed");
|
||||
// }
|
||||
// if (new ProcessBuilder().directory(project.rootDir).command("git", "commit", "-am", title).start()
|
||||
// .waitFor() != 0) {
|
||||
// throw new IllegalStateException("git commit failed");
|
||||
// }
|
||||
// if (new ProcessBuilder().directory(project.rootDir).command("git", "checkout", "-").start()
|
||||
// .waitFor() != 0) {
|
||||
// throw new IllegalStateException("git checkout previous failed");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// def currentGradleVersion = result.gradle.current
|
||||
// def runningGradleVersion = result.gradle.running
|
||||
// if (currentGradleVersion > runningGradleVersion) {
|
||||
// def title = "Upgrade Gradle to $currentGradleVersion.version"
|
||||
// println title
|
||||
// GradleRunner.create()
|
||||
// .withGradleInstallation(project.getGradle().getGradleHomeDir())
|
||||
// .withProjectDir(project.rootDir)
|
||||
// .withArguments("wrapper", "--gradle-version", currentGradleVersion.version)
|
||||
// .forwardOutput()
|
||||
// .build()
|
||||
// if (new ProcessBuilder().directory(project.rootDir).command("git", "commit", "-am", title).start()
|
||||
// .waitFor() != 0) {
|
||||
// throw new IllegalStateException("git commit failed");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// resolutionStrategy {
|
||||
// componentSelection {
|
||||
// all { ComponentSelection selection ->
|
||||
// def candidateVersion = selection.candidate.version
|
||||
// if (candidateVersion ==~ /(?i).*?(alpha|beta|m\d+|rc\d+).*/) {
|
||||
// reject("$candidateVersion is not allowed because it is an alpha or beta version")
|
||||
// }
|
||||
// }
|
||||
// all { ComponentSelection selection ->
|
||||
// def candidateVersion = selection.candidate.version
|
||||
// if (candidateVersion ==~ /(?i).*?m\d+.*/) {
|
||||
// reject("$candidateVersion is not allowed because it is a milestone version")
|
||||
// }
|
||||
// }
|
||||
// all { ComponentSelection selection ->
|
||||
// def candidateVersion = selection.candidate.version
|
||||
// if (candidateVersion ==~ /(?i).*?rc\d+.*/) {
|
||||
// reject("$candidateVersion is not allowed because it is a release candidate version")
|
||||
// }
|
||||
// }
|
||||
// all { ComponentSelection selection ->
|
||||
// def currentVersion = selection.currentVersion
|
||||
// def separator = currentVersion.indexOf(".")
|
||||
// def major = separator > 0 ? currentVersion.substring(0,separator) : currentVersion
|
||||
// def candidateVersion = selection.candidate.version
|
||||
// if (candidateVersion !=~ /\d\d\d\d.*/ && !candidateVersion.startsWith(major)) {
|
||||
// reject("Cannot Upgrade to new Major Version")
|
||||
// }
|
||||
// }
|
||||
// all { ComponentSelection selection ->
|
||||
// def candidate = selection.candidate
|
||||
// if (candidate.group == "org.apache.directory.server" && candidate.version != selection.currentVersion) {
|
||||
// reject("org.apache.directory.server has breaking changes in newer versions")
|
||||
// }
|
||||
// }
|
||||
// withModule("javax.xml.bind:jaxb-api") { ComponentSelection selection ->
|
||||
// if (selection.candidate.version ==~ /.*?b\d+.*/) {
|
||||
// reject("Reject jaxb-api beta versions")
|
||||
// }
|
||||
// }
|
||||
// withModule("com.sun.xml.bind:jaxb-impl") { ComponentSelection selection ->
|
||||
// if (selection.candidate.version ==~ /.*?b\d+.*/) {
|
||||
// reject("Reject jaxb-api beta versions")
|
||||
// }
|
||||
// }
|
||||
// withModule("org.springframework.data:spring-data-releasetrain") { ComponentSelection selection ->
|
||||
// if (selection.candidate.version !=~ /\d\d\d\d.*/) {
|
||||
// reject("calver is latest version scheme")
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
|
Loading…
Reference in New Issue