Added gradleTest compatibility support

This commit is contained in:
Schalk W. Cronjé 2015-05-06 15:29:50 +01:00
parent 95b2c4fbe4
commit cff7734897
5 changed files with 70 additions and 5 deletions

View File

@ -1,7 +1,23 @@
language: java
language: groovy
install:
- ./gradlew clean
script:
- ./gradlew build gradleTest
jdk:
- oraclejdk8
- oraclejdk7
- oraclejdk7
- oraclejdk8
- openjdk7
- openjdk6
os:
- linux
- osx
env: TERM=dumb
cache:
directories:
- $HOME/.gradle

View File

@ -7,7 +7,7 @@ build_script:
- gradlew.bat assemble --info --no-daemon
test_script:
- gradlew.bat test check --info --no-daemon
- gradlew.bat test check gradleTest --info --no-daemon
branches:
only:

View File

@ -1,8 +1,14 @@
buildscript {
repositories { jcenter() }
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.5'
classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:1.12.+'
classpath 'org.ysb33r.gradle:gradletest:0.5.1'
}
}
@ -10,6 +16,7 @@ apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'provided-base'
apply plugin: 'org.ysb33r.gradletest'
apply from: 'gradle/integration-tests.gradle'
@ -90,6 +97,10 @@ dependencies {
// 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:1.7.11"
gradleTest "org.jruby:jruby-complete:${jrubyVersion}"
gradleTest 'rubygems:credit_card_validator:1.1.0'
gradleTest 'org.bouncycastle:bcprov-jdk15on:1.50'
}
test {
@ -170,4 +181,12 @@ bintray {
bintrayUpload.dependsOn assemble
gradleLocations {
// searchGvm = false
}
gradleTest {
versions '2.0','2.2','2.4'
}
// vim: ft=groovy

View File

@ -0,0 +1,25 @@
import com.github.jrubygradle.JRubyExec
buildscript {
dependencies {
classpath 'com.github.jruby-gradle:jruby-gradle-plugin:%%VERSION%%'
}
}
apply plugin : 'com.github.jruby-gradle.base'
dependencies {
jrubyExec ':credit_card_validator:1.1.0@gem'
}
jruby {
defaultRepositories = false
}
task runGradleTest {
dependsOn jrubyPrepareGems
}
task requiresGems( type : JRubyExec ) {
script "scripts/requiresGem.rb"
}

View File

@ -0,0 +1,5 @@
require 'credit_card_validator'
CreditCardValidator::Validator.options[:test_numbers_are_valid] = true
if !CreditCardValidator::Validator.valid?('1111 2222 3333 4444')
puts 'Not valid'
end