language: ruby
sudo: false
bundler_args: --without development
script: rake spec
branches:
  only:
    - master
    - maintenance-1.1.13
    - /.*stable$/
    - /^test-.*$/
rvm:
  # NOTE: do not use jruby-19mode otherwise some specs might fail
  # @see ruby/rack/application_spec.rb for an explanation on this
  #- jruby-18mode
  #- jruby-19mode
  - jruby-1.7.16
  - jruby-head
jdk:
  - openjdk6
  - oraclejdk7
  - oraclejdk8
gemfile:
  - Gemfile
  - gemfiles/rails23.gemfile
  - gemfiles/rails30.gemfile
  - gemfiles/rails31.gemfile
  - gemfiles/rails32.gemfile
  - gemfiles/rails40.gemfile
  - gemfiles/rails41.gemfile
env:
  - JRUBY_OPTS="--1.8 $JRUBY_OPTS"
  - JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION" # for mvn's jruby plugins
before_script:
  - export JRUBY_OPTS="--server -Xcext.enabled=false -Xcompile.invokedynamic=false -J-XX:MaxPermSize=128m"
  - export JRUBY_VERSION="1.7.13"
  - jruby -S gem env || true
before_install:
  # NOTE: RubyGems 2.4.x fails us at application_spec's gem_install_rack_unless_installed !
  - (jruby --1.9 -S gem update --system 2.2.3) || true
  - ((jruby -v | grep 1.8.7) && jruby --1.9 -S gem update --system 2.1.11) || true
  - ((echo $BUNDLE_GEMFILE | grep rails23) && jruby --1.9 -S gem update --system 1.8.29) || true
matrix:
  allow_failures:
    #- gemfile: gemfiles/rails41.gemfile
  exclude:
    ## avoid jruby-head with JDK6 :
    - rvm: jruby-head
      gemfile: Gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: Gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails23.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails23.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails30.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails30.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails31.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails31.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails32.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails32.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails40.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails40.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails41.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails41.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: openjdk6
    ## rails 4.0 does not run on --1.8
    - rvm: jruby-1.7.16
      gemfile: gemfiles/rails40.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: openjdk6
    - rvm: jruby-1.7.16
      gemfile: gemfiles/rails40.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: oraclejdk7
    - rvm: jruby-1.7.16
      gemfile: gemfiles/rails40.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: oraclejdk8
    ## rails 4.1 won't run on --1.8
    - rvm: jruby-1.7.16
      gemfile: gemfiles/rails41.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: openjdk6
    - rvm: jruby-1.7.16
      gemfile: gemfiles/rails41.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: oraclejdk7
    - rvm: jruby-1.7.16
      gemfile: gemfiles/rails41.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: openjdk6
    - rvm: jruby-1.7.16
      gemfile: gemfiles/rails41.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: oraclejdk7
    - rvm: jruby-1.7.16
      gemfile: gemfiles/rails41.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: oraclejdk8
    ## rails 4.0 does not run on --1.8 (jruby-head)
    #- rvm: jruby-head
    #  gemfile: gemfiles/rails40.gemfile
    #  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
    #  jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails40.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: oraclejdk7
    - rvm: jruby-head
      gemfile: gemfiles/rails40.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: oraclejdk8
    ## rails 4.1 won't run on --1.8 (jruby-head)
    #- rvm: jruby-head
    #  gemfile: gemfiles/rails41.gemfile
    #  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
    #  jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails41.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: oraclejdk7
    - rvm: jruby-head
      gemfile: gemfiles/rails41.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: oraclejdk8
    ## rails 3.2 jruby-head won't support --1.8
    #- rvm: jruby-head
    #  gemfile: gemfiles/rails32.gemfile
    #  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
    #  jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails32.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: oraclejdk7
    - rvm: jruby-head
      gemfile: gemfiles/rails32.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: oraclejdk8
    ## jruby-head won't run on Java 6 :
    - rvm: jruby-head
      gemfile: gemfiles/rails23.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails23.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails30.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails30.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails31.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails31.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails32.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails32.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails40.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails40.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails41.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails41.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: openjdk6
    ## do not run with 2.3 (jruby-head) :
    #- rvm: jruby-head
    #  gemfile: gemfiles/rails23.gemfile
    #  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
    #  jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails23.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: oraclejdk7
    - rvm: jruby-head
      gemfile: gemfiles/rails23.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: oraclejdk8
    - rvm: jruby-head
      gemfile: gemfiles/rails23.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails23.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: oraclejdk7
    - rvm: jruby-head
      gemfile: gemfiles/rails23.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: oraclejdk8
    ## do not run with 3.0 (jruby-head) :
    #- rvm: jruby-head
    #  gemfile: gemfiles/rails30.gemfile
    #  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
    #  jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails30.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: oraclejdk7
    - rvm: jruby-head
      gemfile: gemfiles/rails30.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: oraclejdk8
    #- rvm: jruby-head
    #  gemfile: gemfiles/rails30.gemfile
    #  env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
    #  jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails30.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: oraclejdk7
    - rvm: jruby-head
      gemfile: gemfiles/rails30.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: oraclejdk8
    ## do not run with 3.1 (jruby-head) :
    #- rvm: jruby-head
    #  gemfile: gemfiles/rails31.gemfile
    #  env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
    #  jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails31.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: oraclejdk7
    - rvm: jruby-head
      gemfile: gemfiles/rails31.gemfile
      env: JRUBY_OPTS="--1.8 $JRUBY_OPTS"
      jdk: oraclejdk8
    #- rvm: jruby-head
    #  gemfile: gemfiles/rails31.gemfile
    #  env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
    #  jdk: openjdk6
    - rvm: jruby-head
      gemfile: gemfiles/rails31.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: oraclejdk7
    - rvm: jruby-head
      gemfile: gemfiles/rails31.gemfile
      env: JRUBY_OPTS="$JRUBY_OPTS" JAVA_OPTS="-Djruby.version=$JRUBY_VERSION"
      jdk: oraclejdk8
