Explicitly set the jruby-complete up for the compile configuration

Fixes #12
This commit is contained in:
R. Tyler Croy 2014-10-12 13:28:46 -07:00
parent 8299994e5a
commit f3a5820612
2 changed files with 13 additions and 0 deletions

View File

@ -21,6 +21,7 @@ class JRubyJarPlugin implements Plugin<Project> {
project.apply plugin : 'com.github.jruby-gradle.base'
project.apply plugin : 'java-base'
project.configurations.maybeCreate('compile')
project.configurations.maybeCreate('jrubyEmbeds')
project.configurations.maybeCreate('jrubyJar')
@ -41,6 +42,14 @@ class JRubyJarPlugin implements Plugin<Project> {
stubTask
)
project.repositories {
jcenter()
}
project.dependencies {
compile group: 'org.jruby', name: 'jruby-complete', version: project.jruby.defaultVersion
}
project.configure(stubTask) {
group JRubyPlugin.TASK_GROUP_NAME
description 'Generates a JRuby Java bootstrap class'

View File

@ -1,6 +1,7 @@
package com.github.jrubygradle.jar
import org.gradle.api.Task
import org.gradle.api.artifacts.Dependency
import org.gradle.api.file.FileCollection
import org.gradle.api.tasks.bundling.Jar
import org.gradle.api.tasks.compile.JavaCompile
@ -96,6 +97,9 @@ class JRubyJarPluginSpec extends Specification {
then: "Then the attribute should be set to the default in the manifest"
jarTask.manifest.attributes.'Main-Class' == JRubyJarConfigurator.DEFAULT_BOOTSTRAP_CLASS
and: "Then jruby-complete should be added as a dependency"
project.configurations.getByName('compile').dependencies.matching { Dependency d -> d.name == 'jruby-complete' }
}
def "Adding all defaults"() {