Skip to content

Commit

Permalink
Substitute snakeyaml 1.30 -> 1.29
Browse files Browse the repository at this point in the history
  • Loading branch information
OdysseusLives committed Apr 13, 2022
1 parent f0c5948 commit 6749f2c
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package nebula.plugin.resolutionrules

import org.gradle.testkit.runner.BuildResult
import spock.lang.Unroll

class SubstituteSnakeyamlSpec extends RulesBaseSpecification {
def setup() {
def ruleFile = new File(getClass().getResource('/substitute-snakeyaml.json').toURI())
buildFile << """\
dependencies {
resolutionRules files('${ruleFile.absolutePath}')
}
""".stripIndent()
}

@Unroll
def 'substitute version from #snakeyamlVersion to 1.29'() {
given:
buildFile << """\
dependencies {
implementation "org.yaml:snakeyaml:${snakeyamlVersion}"
}
""".stripIndent()

when:
BuildResult result = runWithArgumentsSuccessfully('dependencies', '--configuration', 'compileClasspath')

then:
result.output.contains "org.yaml:snakeyaml:1.30 -> 1.29"

where:
snakeyamlVersion << ['1.30']
}

@Unroll
def 'do not substitute other versions'() {
given:
buildFile << """\
dependencies {
implementation "org.yaml:snakeyaml:${snakeyamlVersion}"
}
""".stripIndent()

when:
BuildResult result = runWithArgumentsSuccessfully('dependencies', '--configuration', 'compileClasspath')

then:
result.output.contains "org.yaml:snakeyaml:1.29"

where:
snakeyamlVersion << ['1.29']
}
}
16 changes: 16 additions & 0 deletions src/main/resources/substitute-snakeyaml.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"align": [],
"deny": [],
"exclude": [],
"reject": [],
"replace": [],
"substitute": [
{
"module": "org.yaml:snakeyaml:1.30",
"with": "org.yaml:snakeyaml:1.29",
"reason": "release 1.30 is missing 'android' (classifier) variant jar",
"author": "Aubrey Chipman",
"date": "2022-04-13"
}
]
}

0 comments on commit 6749f2c

Please sign in to comment.