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

155 lines
5.0 KiB
Groovy

archivesBaseName = 'jruby-gradle-plugin'
apply from: "${rootProject.projectDir}/gradle/integration-tests.gradle"
apply plugin: 'maven-publish'
// --- Could be in a separate gradle file
configurations {
testJRubyPrepare
}
ext {
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
dependencies {
compile "org.eclipse.jetty:jetty-server:${jettyVersion}"
compile "org.eclipse.jetty:jetty-webapp:${jettyVersion}"
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'
}
integrationTestCompile (spockVersion) {
exclude module : 'groovy-all'
}
// NOTE: If you change this, you will also need to update JRubyPrepareGemsIntegrationSpec
integrationTestGems 'rubygems:slim:2.0.2'
// NOTE: If you change this, you will also need to update JRubyPrepareJarsIntegrationSpec
integrationTestGems 'rubygems:leafy-complete:0.4.0'
// NOTE: If you change this, you will also need to update JRubyExecIntegrationSpec & JRubyExecExtensionIntegrationSpec
integrationTestGems 'rubygems:credit_card_validator:1.1.0'
// NOTE: If you change this, you will also need to update JRubyExecIntegrationSpec
integrationTestGems 'rubygems:rspec:3.1.0'
// NOTE: Leave this at .11 as it must be an older version. if
// you change it here you will also need to update JRubyExecIntegrationSpec
integrationTestGems "org.jruby:jruby-complete:9.0.1.0"
// NOTE: older jruby versions needs this for exec to work properly
integrationTestGems "rubygems:jar-dependencies:0.1.15"
// NOTE: If you change this, you will also need to update JRubyExecExtensionIntegrationSpec
integrationTestGems 'org.bouncycastle:bcprov-jdk15on:1.46'
gradleTest"org.jruby:jruby-complete:${jrubyVersion}"
gradleTest 'rubygems:credit_card_validator:1.1.0'
gradleTest 'org.bouncycastle:bcprov-jdk15on:1.50'
}
test {
systemProperties TESTROOT : new File(buildDir,'tmp/test/unittests').absolutePath
systemProperties TEST_GEM_DIR : new File(projectDir,'src/integTest/resources/gems').absolutePath
systemProperties 'logback.configurationFile' : new File(projectDir,'src/test/resources/logback-test.xml').absolutePath
if (gradle.startParameter.isOffline()) {
systemProperties 'TESTS_ARE_OFFLINE' : '1'
}
}
task copyIntegrationTestJRuby (type:Copy) {
from ({configurations.testJRubyPrepare.files})
into new File(buildDir,'tmp/integrationTest/flatRepo')
}
integrationTest {
systemProperties TESTROOT : new File(buildDir,'tmp/integrationTest/root').absolutePath
systemProperties CACHEDIR : new File(buildDir,'tmp/integrationTest/cache').absolutePath
systemProperties FLATREPO : new File(buildDir,'tmp/integrationTest/flatRepo').absolutePath
systemProperties TEST_SCRIPT_DIR : new File(projectDir,'src/integTest/resources/scripts').absolutePath
systemProperties 'logback.configurationFile' : new File(projectDir,'src/integTest/resources/logback-test.xml').absolutePath
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') }
}
publishing {
publications {
maven(MavenPublication) {
groupId project.group
artifactId project.archivesBaseName
version project.version
artifact sourcesJar {
classifier "sources"
}
from components.java
}
}
}
bintray {
user = project.bintrayUser
key = project.bintrayKey
publish = true
dryRun = false
publications = ['maven']
pkg {
userOrg = 'jruby-gradle'
repo = 'plugins'
name = 'jruby-gradle-plugin'
labels = ['jruby']
version {
name = project.version
vcsTag = "v${project.version}"
attributes = ['gradle-plugin' : 'com.github.jruby-gradle.base:com.github.jruby-gradle:jruby-gradle-plugin']
desc = 'The purpose of plugin is to encapsulate useful Gradle functionality for JRuby projects.'
}
}
}
bintrayUpload.dependsOn assemble
gradleTest.mustRunAfter integrationTest
// vim: ft=groovy