java7 : {name : oraclejdk, version : "7",    platformspecific: true}
#java8 : {name : oraclejdk, version : "8u66", platformspecific: true}
java8 : {name : labsjdk, version : "8u92-jvmci-0.15", platformspecific: true}

common : {
  packages : {
    git : ">=1.8.3"
    mercurial : ">=2.2"
    "pip:astroid" : "==1.1.0"
    "pip:pylint" : "==1.1.0"
    make : ">=3.83"
    gcc-build-essentials : ">=4.9.1" # GCC 4.9.0 fails on cluster
    readline : "==6.3"
  }
  environment : {
  }
  logs : [
    "com.oracle.truffle.r.native/gnur/R-*/gnur_configure.log"
    "com.oracle.truffle.r.native/gnur/R-*/gnur_make.log"
    "com.oracle.truffle.r.native/gnur/R-*/Makeconf"
    "com.oracle.truffle.r.native/gnur/libiconv-*/iconv_configure.log"
    "com.oracle.truffle.r.native/gnur/libiconv-*/iconv_make.log"
  ]
  timelimit : "1:00:00"
}

gateCmd : ["mx", "--strict-compliance", "originalgate", "--strict-mode", "-t"]

java8Downloads : {
  downloads : {
    EXTRA_JAVA_HOMES : { pathlist :[
      ${java7}
    ]}
    JAVA_HOME : ${java8}
  }
}

gateTest : ${common} ${java8Downloads} {
  run : [
    ${gateCmd} ["Versions,JDKReleaseInfo,Pylint,Canonicalization Check,BuildJavaWithJavac,UnitTests: ExpectedTestOutput file check,UnitTests"]
  ]
}

gateStyle : ${common} {
  # need pyhocon fix
  downloads : {
    JAVA_HOME : ${java8Downloads.downloads.JAVA_HOME}
    EXTRA_JAVA_HOMES : ${java8Downloads.downloads.EXTRA_JAVA_HOMES}
    JDT : {name: ecj, version: "4.5.1", platformspecific: false}
    ECLIPSE : {name: eclipse, version: "4.5.2", platformspecific: true}
  }
  environment : ${common.environment} {
    ECLIPSE_EXE : "$ECLIPSE/eclipse"
  }
  run : [
    ${gateCmd} ["Versions,JDKReleaseInfo,Pylint,Canonicalization Check,BuildJavaWithJavac,IDEConfigCheck,CodeFormatCheck,Checkstyle,Copyright check"]
  ]
}

rbcheck : ${common} ${java8Downloads} {
  run : [
    ${gateCmd} ["Versions,JDKReleaseInfo,BuildJavaWithJavac"]
    ["mx", "rbcheck"]
    ["mx", "rbdiag", "-n", "-m"]
  ]  
}

# currently disabled gate commands: FindBugs,Checkheaders,Distribution Overlap Check,BuildJavaWithEcj

builds = [
  ${gateTest}       {capabilities : [linux, amd64, gate, post-merge],   name: "gate-test-linux-amd64"}
  ${gateStyle}      {capabilities : [linux, amd64, gate, post-merge],   name: "gate-style-linux-amd64"}
  ${rbcheck}        {capabilities : [linux, amd64, gate, post-merge],   name: "gate-rbcheck-linux-amd64"}
#  ${gateTest}      {capabilities : [linux, sparcv9, gate, post-merge], name: "gate-test-linux-sparcv9"}
]