Skip to content

Commit 33e8442

Browse files
authored
Merge pull request #434 from jruby-gradle/master
Release 2.1.0-alpha.3
2 parents 7bdd0ea + 4213f06 commit 33e8442

File tree

7 files changed

+41
-19
lines changed

7 files changed

+41
-19
lines changed

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ jobs:
6363
- name: UnitTest
6464
uses: eskatos/gradle-command-action@v1
6565
with:
66-
arguments: --console=plain --warning-mode=all --no-parallel test
66+
arguments: --console=plain --warning-mode=all --no-parallel test -i
6767
# Test
6868
- name: IntegrationTest
6969
uses: eskatos/gradle-command-action@v1
7070
with:
71-
arguments: --console=plain --warning-mode=all --no-parallel intTest
71+
arguments: --console=plain --warning-mode=all --no-parallel intTest -i
7272
# Test
7373
- name: CompatibilityTest
7474
uses: eskatos/gradle-command-action@v1

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

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ package com.github.jrubygradle
2525

2626
import com.github.jrubygradle.testhelper.IntegrationSpecification
2727
import org.gradle.testkit.runner.BuildResult
28+
import spock.lang.Ignore
2829
import spock.lang.IgnoreIf
2930
import spock.lang.Issue
3031

@@ -152,6 +153,7 @@ rubygems:tilt:2.0.9
152153
}
153154

154155
@Issue('https://github.com/jruby-gradle/jruby-gradle-plugin/issues/341')
156+
@Ignore
155157
void "Make an install-time gem dependency available"() {
156158
setup:
157159
withRubyGemsRepository()

base-plugin/src/main/groovy/com/github/jrubygradle/JRubyExec.groovy

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import org.gradle.api.tasks.LocalState
3838
import org.gradle.api.tasks.TaskContainer
3939
import org.gradle.process.JavaExecSpec
4040
import org.gradle.util.GradleVersion
41+
import org.ysb33r.grolifant.api.core.OperatingSystem
4142
import org.ysb33r.grolifant.api.core.ProjectOperations
4243

4344
import java.util.concurrent.Callable
@@ -106,6 +107,9 @@ class JRubyExec extends JavaExec implements JRubyAwareTask, JRubyExecSpec {
106107
}.curry(jruby, tasks) as Callable<File>
107108

108109
this.gemWorkDir = project.provider(resolveGemWorkDir)
110+
if (OperatingSystem.current().windows) {
111+
systemProperty('jdk.io.File.enableADS', 'true')
112+
}
109113
}
110114

111115
/** Script to execute.

base-plugin/src/main/groovy/com/github/jrubygradle/JRubyPluginExtension.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ import static org.ysb33r.grolifant.api.v4.StringUtils.stringize
6161
*/
6262
@CompileStatic
6363
class JRubyPluginExtension extends AbstractCombinedProjectTaskExtension {
64-
public static final String DEFAULT_JRUBY_VERSION = '9.2.9.0'
64+
public static final String DEFAULT_JRUBY_VERSION = '9.3.4.0'
6565

6666
public static final String NAME = 'jruby'
6767

core-plugin/src/integTest/groovy/com/github/jrubygradle/api/core/IvyXmlProxyServerIntegrationSpec.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class IvyXmlProxyServerIntegrationSpec extends Specification {
219219
build()
220220

221221
then:
222-
findFiles ~/^jaro_winkler-1.5.\d+-java.gem$/
222+
findFiles ~/^jaro_winkler-1\.5\.\d+-java\.gem$/
223223
}
224224

225225
private List<File> findFiles(Pattern pat) {

core-plugin/src/main/groovy/com/github/jrubygradle/api/gems/GemUtils.groovy

+29-13
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
*/
2424
package com.github.jrubygradle.api.gems
2525

26+
import groovy.transform.CompileDynamic
2627
import groovy.transform.CompileStatic
2728
import groovy.util.logging.Slf4j
2829
import org.gradle.api.Action
@@ -33,6 +34,7 @@ import org.gradle.api.file.CopySpec
3334
import org.gradle.api.file.DuplicateFileCopyingException
3435
import org.gradle.api.file.FileCollection
3536
import org.gradle.process.JavaExecSpec
37+
import org.ysb33r.grolifant.api.core.LegacyLevel
3638
import org.ysb33r.grolifant.api.core.OperatingSystem
3739
import org.ysb33r.grolifant.api.core.ProjectOperations
3840

@@ -136,6 +138,7 @@ class GemUtils {
136138
*
137139
* @since 2.1.0
138140
*/
141+
@SuppressWarnings('DuplicateStringLiteral')
139142
static void extractGems(
140143
ProjectOperations project,
141144
File jRubyClasspath,
@@ -178,6 +181,7 @@ class GemUtils {
178181
log.info("Installing ${gemsToProcess*.name.join(',')}")
179182

180183
project.javaexec { JavaExecSpec spec ->
184+
applyMainClassName(spec, JRUBY_MAINCLASS)
181185
spec.with {
182186
// Setting these environment variables will ensure that
183187
// jbundler and/or jar-dependencies will not attempt to invoke
@@ -187,23 +191,26 @@ class GemUtils {
187191
JARS_SKIP: true,
188192
GEM_HOME: destDir.absolutePath,
189193
GEM_PATH: destDir.absolutePath
190-
main = JRUBY_MAINCLASS
191194
classpath jRubyClasspath
192195
args '-S', GEM, 'install'
193196

197+
if (OperatingSystem.current().windows) {
198+
systemProperty('jdk.io.File.enableADS', 'true')
199+
}
200+
194201
/*
195-
* NOTE: gemsToProcess is assumed to typically be sourced from
196-
* a FileCollection generated elsewhere in the code. The
197-
* FileCollection a flattened version of the dependency tree.
198-
*
199-
* In order to handle Rubygems which depend on their
200-
* dependencies at _installation time_, we need to reverse the
201-
* order to make sure that the .gem files for the
202-
* transitive/nested dependencies are installed first
203-
*
204-
* See:
205-
* https://gikhub.com/jruby-gradle/jruby-gradle-plugin/issues/341
206-
*/
202+
* NOTE: gemsToProcess is assumed to typically be sourced from
203+
* a FileCollection generated elsewhere in the code. The
204+
* FileCollection a flattened version of the dependency tree.
205+
*
206+
* In order to handle Rubygems which depend on their
207+
* dependencies at _installation time_, we need to reverse the
208+
* order to make sure that the .gem files for the
209+
* transitive/nested dependencies are installed first
210+
*
211+
* See:
212+
* https://github.com/jruby-gradle/jruby-gradle-plugin/issues/341
213+
*/
207214
gemsToProcess.toList().reverse().each { File gem ->
208215
args gem
209216
}
@@ -467,6 +474,15 @@ class GemUtils {
467474
}
468475
}
469476

477+
@CompileDynamic
478+
private static void applyMainClassName(JavaExecSpec spec, String mainClassName) {
479+
if (LegacyLevel.PRE_7_0) {
480+
spec.main = mainClassName
481+
} else {
482+
spec.mainClass = mainClassName
483+
}
484+
}
485+
470486
private static final String GEM = 'gem'
471487
private static final String GEM_EXTENSION = '.gem'
472488
private static final String EVERYTHING = '**'

gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ releaseBuild=false
1414
targetCompatibility=1.8
1515
sourceCompatibility=1.8
1616

17-
grolifantVersion=1.0.0-alpha.6
18-
jrubyVersion=9.2.9.0
17+
grolifantVersion=1.3.3
18+
jrubyVersion=9.3.4.0
1919
jettyVersion=9.2.12.v20150709
2020
bcprovVersion=1.46
2121
httpbuilderNgVersion=1.0.3

0 commit comments

Comments
 (0)