jruby-gradle-plugin/base-plugin/build.gradle

119 lines
3.6 KiB
Groovy

// --- Could be in a separate gradle file
configurations {
testJRubyPrepare
}
ext {
flatRepoDir = file("${buildDir}/tmp/integrationTest/flatRepo")
jrubyClassPathFromConfiguration = { Configuration cfg ->
def f = cfg.files.find { it.name.startsWith('jruby-complete-') }
return f?.absolutePath
}
}
project.afterEvaluate {
test {
systemProperties TEST_JRUBY_CLASSPATH: "${jrubyClassPathFromConfiguration(configurations.testJRubyPrepare)}"
}
}
// --- up to here
ext {
slimVersion = '2.0.2'
leafyVersion = '0.4.0'
}
dependencies {
compile project(':jruby-gradle-core-plugin')
runtime('de.saumya.mojo:rubygems:0.2.3@war') {
// we just want the war file on the classloader for the application
// to find it and use the war-file from filesystem
exclude group: 'org.sonatype.nexus.plugins', module: 'nexus-ruby-tools'
}
testJRubyPrepare "org.jruby:jruby-complete:${jrubyVersion}"
testCompile(spockVersion) {
exclude module: 'groovy-all'
exclude group: 'org.codehaus.groovy'
}
integrationTestCompile(spockVersion) {
exclude module: 'groovy-all'
exclude group: 'org.codehaus.groovy'
}
// NOTE: This should always be an older older version.
// It is used by JRubyExecIntegrationSpec
integrationTestGems "org.jruby:jruby-complete:${olderJRubyVersion}"
// This is used by JRubyExecExtensionIntegrationSpec
integrationTestGems "org.bouncycastle:bcprov-jdk15on:${bcprovVersion}"
// This is used by JRubyPrepareJarsIntegrationSpec
integrationTestGems "io.dropwizard.metrics:metrics-core:${dropwizardMetricsCoreVersion}"
gradleTest "org.jruby:jruby-complete:${jrubyVersion}"
gradleTest 'org.bouncycastle:bcprov-jdk15on:1.50'
// These are real GEMs which cannot currently be cached
// gradleTest 'rubygems:credit_card_validator:1.1.0'
// integrationTestGems "rubygems:slim:${slimVersion}"
// integrationTestGems "rubygems:leafy-complete:${leafyVersion}"
// integrationTestGems 'rubygems:credit_card_validator:1.1.0'
// integrationTestGems 'rubygems:rspec:3.1.0'
// integrationTestGems "rubygems:jar-dependencies:0.1.15"
}
generateTestConfig {
testProperties mavenrepo: file('src/integTest/mavenrepo').absolutePath,
flatrepo: flatRepoDir.absolutePath,
bcprovVersion: bcprovVersion,
olderJRubyVersion: olderJRubyVersion,
slimVersion: slimVersion,
leafyVersion: leafyVersion,
creditCardValidatorVersion : '1.1.0',
dropwizardMetricsCoreVersion : dropwizardMetricsCoreVersion,
rspecVersion : '3.1.0'
}
task copyIntegrationTestJRuby(type: Copy) {
from({ configurations.testJRubyPrepare.files })
into new File(buildDir, 'tmp/integrationTest/flatRepo')
}
integrationTest {
if (gradle.startParameter.isOffline()) {
systemProperties 'TESTS_ARE_OFFLINE': '1'
}
dependsOn copyIntegrationTestJRuby
}
task installGroovyDoc(type: Copy) {
from({ new File(buildDir, 'docs/groovydoc') }) {
include '**'
}
into { new File(project.properties.jrubyGradleWebsiteInstallDir, "docs/api/${archivesBaseName}/${version}") }
onlyIf { project.hasProperty('jrubyGradleWebsiteInstallDir') }
}
pluginBundle {
plugins {
gradlePlugin {
id = 'com.github.jruby-gradle.base'
displayName = 'JRuby/Gradle base plugin'
description = 'The purpose of plugin is to encapsulate useful Gradle functionality for JRuby projects'
tags = (['jruby'])
}
}
}
gradleTest.mustRunAfter integrationTest
// vim: ft=groovy