Skip to content

Commit 3ddd6e3

Browse files
committed
Verify that Gradle 5x. dependency locking works with GEMs (#372)
Added at hack.commit.push 2019 with @ixschelruiz.
1 parent 79941dc commit 3ddd6e3

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

base-plugin/src/integTest/groovy/com/github/jrubygradle/JRubyPrepareGemsIntegrationSpec.groovy

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class JRubyPrepareGemsIntegrationSpec extends IntegrationSpecification {
3636
withPreamble """repositories.ruby.gems()
3737
jrubyPrepare.outputDir = '${pathAsUriStr(projectDir)}'.toURI()
3838
"""
39+
3940
withDependencies """
4041
gems "rubygems:sinatra:1.4.5"
4142
gems "rubygems:rack:[0,)"
@@ -51,6 +52,48 @@ class JRubyPrepareGemsIntegrationSpec extends IntegrationSpecification {
5152
new File(projectDir, "gems/rack-1.6.11").exists()
5253
}
5354

55+
@IgnoreIf({ IntegrationSpecification.OFFLINE })
56+
void "Check that GEM dependencies are locked"() {
57+
setup:
58+
File lockFile = new File(projectDir, 'gradle/dependency-locks/gems.lockfile')
59+
withPreamble """repositories.ruby.gems()
60+
jrubyPrepare.outputDir = '${pathAsUriStr(projectDir)}'.toURI()
61+
62+
dependencyLocking {
63+
lockAllConfigurations()
64+
}
65+
66+
67+
"""
68+
withDependencies """
69+
gems "rubygems:sinatra:1.4.5"
70+
gems "rubygems:rack:[0,)"
71+
gems "rubygems:lookout-rack-utils:5.0.0.49"
72+
"""
73+
74+
lockFile.parentFile.mkdirs()
75+
lockFile.text = '''
76+
rubygems:concurrent-ruby:1.1.5
77+
rubygems:configatron:4.5.1
78+
rubygems:i18n:1.6.0
79+
rubygems:log4r:1.1.10
80+
rubygems:lookout-rack-utils:5.0.0.49
81+
rubygems:lookout-statsd:3.2.0
82+
rubygems:rack-graphite:1.6.0
83+
rubygems:rack-protection:1.5.5
84+
rubygems:rack:1.6.10
85+
rubygems:sinatra:1.4.5
86+
rubygems:tilt:2.0.9
87+
'''
88+
when:
89+
build()
90+
91+
then:
92+
// since we need a version range in the setup the
93+
// resolved version here can vary over time
94+
new File(projectDir, "gems/rack-1.6.10").exists()
95+
}
96+
5497
@IgnoreIf({ IntegrationSpecification.OFFLINE })
5598
void "Check if prerelease gem gets resolved"() {
5699
setup:

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ buildScan {
1515
allprojects {
1616
apply plugin: 'idea'
1717

18-
1918
if (!releaseBuild) {
2019
version = "${version}-SNAPSHOT"
2120
}

0 commit comments

Comments
 (0)