Introduce a new configuration for unzipping things directly into the topology jar
This goes hand-in-hand with jruby-gradle/redstorm#12 and allows us to incorporate things like storm-kafka early on in the load time of a topology while still allowing most JRuby-originating jar dependencies to be packed "as per usual." (See fast-rsa-engine and others which pack jar files inside gem archives) Fixes #25
This commit is contained in:
parent
61794ed1d2
commit
26a8316f49
|
@ -112,5 +112,6 @@ bintray {
|
|||
}
|
||||
}
|
||||
bintrayUpload.dependsOn assemble
|
||||
install.dependsOn check, assemble
|
||||
|
||||
// vim: ft=groovy
|
||||
|
|
|
@ -12,7 +12,7 @@ class JRubyStormExtension {
|
|||
|
||||
@Incubating
|
||||
/** Default version of redstorm to use */
|
||||
String defaultRedstormVersion = '0.7.3'
|
||||
String defaultRedstormVersion = '0.9.0'
|
||||
|
||||
/** Set the Storm dependency version */
|
||||
void defaultVersion(Object stormVersion) {
|
||||
|
|
|
@ -8,6 +8,7 @@ import org.gradle.api.Project
|
|||
/**
|
||||
*/
|
||||
class JRubyStormPlugin implements Plugin<Project> {
|
||||
static final CLASSPATH_CONFIGURATION = 'jrubyStormClasspath'
|
||||
void apply(Project project) {
|
||||
project.apply plugin : 'com.github.jruby-gradle.base'
|
||||
project.apply plugin : 'com.github.jruby-gradle.jar'
|
||||
|
@ -15,6 +16,8 @@ class JRubyStormPlugin implements Plugin<Project> {
|
|||
project.extensions.create('storm', JRubyStormExtension)
|
||||
project.task('jrubyStorm', type: JRubyStorm)
|
||||
|
||||
project.configurations.maybeCreate(CLASSPATH_CONFIGURATION)
|
||||
|
||||
updateRepositories(project)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.github.jrubygradle.storm.internal
|
||||
|
||||
import com.github.jrubygradle.jar.JRubyJar
|
||||
import com.github.jrubygradle.storm.JRubyStormPlugin
|
||||
import groovy.transform.InheritConstructors
|
||||
|
||||
import com.github.jrubygradle.storm.JRubyStorm
|
||||
|
@ -31,6 +32,7 @@ class JRubyStormJar extends JRubyJar {
|
|||
project.afterEvaluate {
|
||||
this.includeRedstorm()
|
||||
this.includeTopology()
|
||||
this.includeClasspathDependencies()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,4 +50,12 @@ class JRubyStormJar extends JRubyJar {
|
|||
into('') { from parentTask.topology }
|
||||
}
|
||||
}
|
||||
|
||||
void includeClasspathDependencies() {
|
||||
project.configurations.findByName(JRubyStormPlugin.CLASSPATH_CONFIGURATION).files.each { File f ->
|
||||
if (f.name.endsWith(".jar")) {
|
||||
from { project.zipTree(f) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue