-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #412 from jruby-gradle/master
Release 2.1.0-alpha.1
- Loading branch information
Showing
98 changed files
with
1,235 additions
and
503 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2014-2019, R. Tyler Croy <[email protected]>, | ||
* Copyright (c) 2014-2020, R. Tyler Croy <[email protected]>, | ||
* Schalk Cronje <[email protected]>, Christian Meier, Lookout, Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
|
@@ -25,14 +25,16 @@ package com.github.jrubygradle | |
|
||
import com.github.jrubygradle.testhelper.IntegrationSpecification | ||
import org.gradle.testkit.runner.BuildResult | ||
import spock.lang.IgnoreIf | ||
|
||
/** | ||
* @author Schalk W. Cronjé | ||
*/ | ||
@IgnoreIf({System.getProperty('TESTS_ARE_OFFLINE')}) | ||
class JRubyExecExtensionIntegrationSpec extends IntegrationSpecification { | ||
|
||
static final String DEFAULT_TASK_NAME = 'inlineJRubyExec' | ||
static final String BCPROV_NAME = 'bcprov-jdk15on' | ||
public static final String DEFAULT_TASK_NAME = 'inlineJRubyExec' | ||
public static final String BCPROV_NAME = 'bcprov-jdk15on' | ||
|
||
void "Run a script with minimum parameters"() { | ||
setup: | ||
|
@@ -147,7 +149,7 @@ class JRubyExecExtensionIntegrationSpec extends IntegrationSpecification { | |
@SuppressWarnings('BuilderMethodWithSideEffects') | ||
private void createJRubyExecProject(String preamble, String jrubyexecConfig) { | ||
buildFile.text = """ | ||
${projectWithLocalRepo} | ||
${projectWithRubyGemsRepo} | ||
${preamble} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2014-2019, R. Tyler Croy <[email protected]>, | ||
* Copyright (c) 2014-2020, R. Tyler Croy <[email protected]>, | ||
* Schalk Cronje <[email protected]>, Christian Meier, Lookout, Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
|
@@ -151,6 +151,10 @@ class JRubyExecIntegrationSpec extends IntegrationSpecification { | |
script 'rspec' | ||
""" | ||
|
||
File specDir = new File(projectDir,'spec') | ||
specDir.mkdirs() | ||
new File(specDir,'sample.rb').text = '' | ||
|
||
when: | ||
BuildResult result = build() | ||
|
||
|
@@ -224,7 +228,7 @@ class JRubyExecIntegrationSpec extends IntegrationSpecification { | |
buildFile.text = """ | ||
import com.github.jrubygradle.JRubyExec | ||
${projectWithMavenRepo} | ||
${projectWithRubyGemsRepo} | ||
${preamble ?: ''} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2014-2019, R. Tyler Croy <[email protected]>, | ||
* Copyright (c) 2014-2020, R. Tyler Croy <[email protected]>, | ||
* Schalk Cronje <[email protected]>, Christian Meier, Lookout, Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
|
@@ -30,6 +30,7 @@ import spock.lang.IgnoreIf | |
/** | ||
* @author Schalk W. Cronjé | ||
*/ | ||
@IgnoreIf({System.getProperty('TESTS_ARE_OFFLINE')}) | ||
class JRubyGenerateGradleRbIntegrationSpec extends IntegrationSpecification { | ||
|
||
static final String DEFAULT_TASK_NAME = 'RubyWax' | ||
|
@@ -40,7 +41,7 @@ class JRubyGenerateGradleRbIntegrationSpec extends IntegrationSpecification { | |
buildFile.text = """ | ||
import com.github.jrubygradle.GenerateGradleRb | ||
${projectWithLocalRepo} | ||
${projectWithRubyGemsRepo} | ||
task ${DEFAULT_TASK_NAME} (type: GenerateGradleRb) { | ||
gemInstallDir 'build/gems' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2014-2019, R. Tyler Croy <[email protected]>, | ||
* Copyright (c) 2014-2020, R. Tyler Croy <[email protected]>, | ||
* Schalk Cronje <[email protected]>, Christian Meier, Lookout, Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
|
@@ -30,12 +30,14 @@ import spock.lang.Issue | |
|
||
/** | ||
* @author Schalk W. Cronjé. | ||
* @author Guillaume Grossetie | ||
*/ | ||
@IgnoreIf({ IntegrationSpecification.OFFLINE }) | ||
class JRubyPrepareGemsIntegrationSpec extends IntegrationSpecification { | ||
|
||
static final String DEFAULT_TASK_NAME = 'jrubyPrepare' | ||
|
||
String repoSetup = projectWithLocalRepo | ||
String repoSetup = projectWithRubyGemsRepo | ||
String preamble | ||
String dependenciesConfig | ||
|
||
|
@@ -53,7 +55,6 @@ class JRubyPrepareGemsIntegrationSpec extends IntegrationSpecification { | |
new File(projectDir, "gems/slim-${slimVersion}").exists() | ||
} | ||
|
||
@IgnoreIf({ IntegrationSpecification.OFFLINE }) | ||
void "Check if rack version gets resolved"() { | ||
setup: | ||
withPreamble """repositories.ruby.gems() | ||
|
@@ -72,10 +73,29 @@ class JRubyPrepareGemsIntegrationSpec extends IntegrationSpecification { | |
then: | ||
// since we need a version range in the setup the | ||
// resolved version here can vary over time | ||
new File(projectDir, "gems/rack-1.6.11").exists() | ||
new File(projectDir, "gems/rack-1.6.13").exists() | ||
} | ||
|
||
void "Check if selenium-webdriver version gets resolved"() { | ||
setup: | ||
withPreamble """repositories.ruby.gems() | ||
jrubyPrepare.outputDir = '${pathAsUriStr(projectDir)}'.toURI() | ||
""" | ||
|
||
withDependencies """ | ||
gems 'rubygems:selenium-webdriver:3.142.6' | ||
gems 'rubygems:webdrivers:4.1.3' | ||
""" | ||
|
||
when: | ||
build() | ||
|
||
then: | ||
// since we need a version range in the setup the | ||
// resolved version here can vary over time | ||
new File(projectDir, "gems/selenium-webdriver-3.142.6").exists() | ||
} | ||
|
||
@IgnoreIf({ IntegrationSpecification.OFFLINE }) | ||
void "Check that GEM dependencies are locked"() { | ||
setup: | ||
File lockFile = new File(projectDir, 'gradle/dependency-locks/gems.lockfile') | ||
|
@@ -117,7 +137,6 @@ rubygems:tilt:2.0.9 | |
new File(projectDir, "gems/rack-1.6.10").exists() | ||
} | ||
|
||
@IgnoreIf({ IntegrationSpecification.OFFLINE }) | ||
void "Check if prerelease gem gets resolved"() { | ||
setup: | ||
withDefaultRepositories() | ||
|
@@ -134,7 +153,6 @@ rubygems:tilt:2.0.9 | |
} | ||
|
||
@Issue('https://github.com/jruby-gradle/jruby-gradle-plugin/issues/341') | ||
@IgnoreIf({ IntegrationSpecification.OFFLINE }) | ||
void "Make an install-time gem dependency available"() { | ||
setup: | ||
withRubyGemsRepository() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2014-2019, R. Tyler Croy <[email protected]>, | ||
* Copyright (c) 2014-2020, R. Tyler Croy <[email protected]>, | ||
* Schalk Cronje <[email protected]>, Christian Meier, Lookout, Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
|
@@ -24,28 +24,35 @@ | |
package com.github.jrubygradle | ||
|
||
import com.github.jrubygradle.testhelper.IntegrationSpecification | ||
import spock.lang.IgnoreIf | ||
|
||
/** | ||
* @author Schalk W. Cronjé. | ||
* @author Christian Meier | ||
*/ | ||
@IgnoreIf({ IntegrationSpecification.OFFLINE }) | ||
class JRubyPrepareJarsIntegrationSpec extends IntegrationSpecification { | ||
|
||
def "Check that default 'jrubyPrepare' uses the correct directory for the jars"() { | ||
given: | ||
String testVer = testProperties.dropwizardMetricsCoreVersion | ||
buildFile.text = """ | ||
${projectWithLocalRepo} | ||
${projectWithRubyGemsRepo} | ||
dependencies { | ||
gems 'io.dropwizard.metrics:metrics-core:3.1.0' | ||
gems "io.dropwizard.metrics:metrics-core:${testVer}" | ||
} | ||
""" | ||
|
||
when: | ||
gradleRunner('jrubyPrepare', '-i').build() | ||
|
||
then: | ||
new File(projectDir, 'build/.gems/Jars.lock').text.trim() == 'io.dropwizard.metrics:metrics-core:3.1.0:runtime:' | ||
new File(projectDir, 'build/.gems/jars/io/dropwizard/metrics/metrics-core/3.1.0/metrics-core-3.1.0.jar').exists() | ||
new File(projectDir, 'build/.gems/Jars.lock').text.trim() == | ||
"io.dropwizard.metrics:metrics-core:${testProperties.dropwizardMetricsCoreVersion}:runtime:" | ||
new File( | ||
projectDir, | ||
"build/.gems/jars/io/dropwizard/metrics/metrics-core/${testVer}/metrics-core-${testVer}.jar" | ||
).exists() | ||
} | ||
} |
Oops, something went wrong.