-
Notifications
You must be signed in to change notification settings - Fork 5
WIP create executable jar using jruby-main artifact #38
Conversation
depends on jruby-gradle/jruby-gradle-plugin#110 still work to be done |
needs: jruby/jruby-mains#1 |
some remarks:
|
@@ -24,15 +24,6 @@ class JRubyJarConfigurator { | |||
configure() | |||
} | |||
|
|||
@PackageScope |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether I am happy with dropping shadowJar support completely. What I do think is to definitely remove it from a fixed dependency in build.gradle
. It might still be worthwhile for someone who want to use that instead to go that way bu explicitly including it in their buildscript and applying the plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, sounds fair to treat jar
and shadowJar
alike. will put it back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on second thought: I moved back the shadowJar option for jruby-gradle-jar-plugin BUT things will not really work when you use it since all those embedded jars are gone and jruby-main will look for them and not find them.
We can just force this to say that as from v0.1.4, jruby 1.7.19 is a requirement. We could print a warning at least in the code.
Will extractingMain clean up the temporary files afterwards? |
@ysb33r this works more or less. if you have more or better ideas please speak up - especially on windows things are bit stricter. |
Now that I've created the 0.1.16 base plugin, should this be updated? |
fac5e43
to
b94549e
Compare
} | ||
project.tasks.withType(Jar) { task -> | ||
if (task.name == 'jar') { | ||
finalizedBy( 'jrubyJar' ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this finalizeBy is a hack - any suggestions on how to do it better are welcome.
but the idea is 'jar' tasks collects all resources and on the fly gnerates those .jrubydir files for this resourecs
after this 'jrubyJar' takes the first jar and all jrubyJars and packs the fat-jar
At first blush this looks ifne to me, I'll wait for @ysb33r to take a peek before I merge it. |
testRepo ('org.jruby:jruby-complete:1.7.19') { | ||
transitive = false | ||
} | ||
testRepo ('de.saumya.mojo:jruby-mains:0.1.0') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be 0.2.0
@@ -116,8 +69,51 @@ class JRubyJarPlugin implements Plugin<Project> { | |||
project.afterEvaluate { | |||
project.dependencies { | |||
jrubyJar group: 'org.jruby', name: 'jruby-complete', version: project.jruby.defaultVersion | |||
// TODO remove hardcoded version to config | |||
jrubyJar group: 'de.saumya.mojo', name: 'jruby-mains', version: '0.2.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to fix this after merge and before release.
transitive = false | ||
} | ||
testRepo ("org.spockframework:spock-core:0.7-groovy-2.0") { | ||
transitive = false | ||
} | ||
|
||
testRepo 'com.github.jengelman.gradle.plugins:shadow:1.1.2' | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the removal of this final closing }
ius causing the build to fail in Travis
* pack all jar-dependencies into root of the jar using a maven repository layout * use either main which runs completely from the jar or an extracting main which first extracts the jar into a temporary directory * shades both jruby-complete and jruby-mains into the executable jar using gradle zipTree, i.e. all shadowJar is gone * remove compat version and let jruby-mains pick .jrubyrc from the jar-file which can set the compat version when needed. (pending feature on jruby-mains) * init script support needs jruby-mains-0.1.1.jar released * generate .jrubydir files on resources added to jar Sponsored by Lookout Inc.
WIP create executable jar using jruby-main artifact
first extracts the jar into a temporary directory
gradle zipTree, i.e. all shadowJar is gone
which can set the compat version when needed
Sponsored by Lookout Inc.