Use main/mainClass depending on Gradle version
This commit is contained in:
parent
0809b043ea
commit
9161a4354d
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
package com.github.jrubygradle.api.gems
|
||||
|
||||
import groovy.transform.CompileDynamic
|
||||
import groovy.transform.CompileStatic
|
||||
import groovy.util.logging.Slf4j
|
||||
import org.gradle.api.Action
|
||||
|
@ -33,6 +34,7 @@ import org.gradle.api.file.CopySpec
|
|||
import org.gradle.api.file.DuplicateFileCopyingException
|
||||
import org.gradle.api.file.FileCollection
|
||||
import org.gradle.process.JavaExecSpec
|
||||
import org.ysb33r.grolifant.api.core.LegacyLevel
|
||||
import org.ysb33r.grolifant.api.core.OperatingSystem
|
||||
import org.ysb33r.grolifant.api.core.ProjectOperations
|
||||
|
||||
|
@ -178,6 +180,7 @@ class GemUtils {
|
|||
log.info("Installing ${gemsToProcess*.name.join(',')}")
|
||||
|
||||
project.javaexec { JavaExecSpec spec ->
|
||||
setMainClass(spec, JRUBY_MAINCLASS)
|
||||
spec.with {
|
||||
// Setting these environment variables will ensure that
|
||||
// jbundler and/or jar-dependencies will not attempt to invoke
|
||||
|
@ -187,7 +190,6 @@ class GemUtils {
|
|||
JARS_SKIP: true,
|
||||
GEM_HOME: destDir.absolutePath,
|
||||
GEM_PATH: destDir.absolutePath
|
||||
mainClass = JRUBY_MAINCLASS
|
||||
classpath jRubyClasspath
|
||||
args '-S', GEM, 'install'
|
||||
|
||||
|
@ -467,6 +469,15 @@ class GemUtils {
|
|||
}
|
||||
}
|
||||
|
||||
@CompileDynamic
|
||||
private void setMainClass(JavaExecSpec spec, String mainClassName) {
|
||||
if(LegacyLevel.PRE_7_0) {
|
||||
spec.main = mainClassName
|
||||
} else {
|
||||
spec.mainClass = mainClassName
|
||||
}
|
||||
}
|
||||
|
||||
private static final String GEM = 'gem'
|
||||
private static final String GEM_EXTENSION = '.gem'
|
||||
private static final String EVERYTHING = '**'
|
||||
|
|
|
@ -14,7 +14,7 @@ releaseBuild=false
|
|||
targetCompatibility=1.8
|
||||
sourceCompatibility=1.8
|
||||
|
||||
grolifantVersion=1.0.0-alpha.6
|
||||
grolifantVersion=1.3.3
|
||||
jrubyVersion=9.2.9.0
|
||||
jettyVersion=9.2.12.v20150709
|
||||
bcprovVersion=1.46
|
||||
|
|
Loading…
Reference in New Issue