Open amiracam opened 7 years ago
Any comment here? I've got the same question. I have files in src/main/ruby
and src/main/resources
that I want to include in the resulting JAR file, but I want them to be included at the root of the JAR, not in one of the included directories (e.g. jars
, bin
).
I just implemented this as a post-build step:
task copyResourcesToTmp(type: Copy) {
from "src/main/resources/"
into "${buildDir}/tmp/other-resources"
from "src/main/ruby/"
into "${buildDir}/tmp/other-resources"
}
task updateJarWithResources(type: Exec) {
def jarFile = "${buildDir}/libs/${project.name}-jruby.jar"
def isWindows = System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')
def command = isWindows ? 'cmd' : 'sh'
def commandSwitch = isWindows ? '/c' : '-c'
workingDir "${buildDir}/tmp/other-resources"
commandLine command, commandSwitch, "jar uf ${jarFile} ./*"
}
updateJarWithResources.dependsOn copyResourcesToTmp
jrubyJar.finalizedBy(updateJarWithResources)
I have a directory structure as such
and of course I could have multiple directories under src as well other source files
I would like to capture all of my source not just the entrypoint.rb i.e. the initScript, ideally I would like to precompile my ruby such as one can with Warbler , I could not find any references in the docs.
I then tried using "include" within the jrubyJar spec which did not fail to build but failed to provide the desired results.
and variations of , all which failed
Please advise , thanks