Executing the jrubyStorm task should also execute its assemble task

Fixes #14
This commit is contained in:
R. Tyler Croy 2015-08-17 16:10:00 -07:00
parent 2934164708
commit 2046c89c29
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
2 changed files with 16 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package com.github.jrubygradle.storm
import com.github.jrubygradle.JRubyPlugin
import org.gradle.api.DefaultTask
import org.gradle.api.Incubating
import org.gradle.api.Task
import org.gradle.api.artifacts.Configuration
import org.gradle.api.file.CopySpec
@ -29,6 +30,12 @@ class JRubyStorm extends DefaultTask {
/** Configuration which has all of our dependencies */
protected Configuration configuration
/** Grab the {@code org.gradle.api.tasks.bundling.AbstractArchiveTask} that this depends on to build the jar */
@Incubating
Task getAssembleTask() {
return assembleTask
}
/** Path (absolute or relative) to the Ruby file containing the topology */
@Input
String topology
@ -81,6 +88,7 @@ class JRubyStorm extends DefaultTask {
this.group JRubyPlugin.TASK_GROUP_NAME
this.runTask = JRubyStormInternal.createRunTask(this.project, this)
this.assembleTask = JRubyStormInternal.createAssembleTask(this.project, this)
this.dependsOn assembleTask
project.afterEvaluate { this.updateDependencies() }
}

View File

@ -61,6 +61,14 @@ class JRubyStormSpec extends Specification {
runTask.topology == 'spock.rb'
}
def "JRubyStorm task should depend on its assembleTask"() {
given:
Task task = project.task('spock', type: JRubyStorm)
expect:
task.dependsOn.find { it == task.assembleTask }
}
def "getStormVersion() should return the storm.defaultStormVersion by default"() {
given:
JRubyStorm task = project.task('spock', type: JRubyStorm)