- job:
    name: jcstress-build
    project-type: freestyle
    defaults: global
    description: |
        * Polls upstream for changes and builds jcstress.jar.
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            openjdk-members:
                - job-build
                - job-cancel
        - build-discarder:
            num-to-keep: 10
            artifact-num-to-keep: 1
    parameters:
        - string:
            name: MAVEN_URL
            default: 'http://www.us.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz'
    disabled: true
    node: aarch64-06
    display-name: 'DELETE ME'
    scm:
        - hg:
            url: http://hg.openjdk.java.net/code-tools/jcstress/
            clean: true
            browser: hgweb
            browser-url: http://hg.openjdk.java.net/code-tools/jcstress/
    triggers:
        - pollscm:
            cron: 'H 20 * * *'
    wrappers:
        - timestamps
    builders:
        - shell: |
            #!/bin/bash

            set -exu
            CACHE_FILES=$HOME/srv/jdk-cache

            rm -rf apache-maven-*

            wget --progress=dot -e dotbytes=2M ${MAVEN_URL}
            tar -zxf apache-maven-*.tar.gz

            export JAVA_HOME=$CACHE_FILES/jdk11

            cd ${WORKSPACE}/apache-maven-*
            export M3_HOME=${PWD}

            # JDK 9 is needed to compile all the tests (tests-all).
            export PATH=${JAVA_HOME}/bin:${M3_HOME}/bin:${PATH}
            which java
            java -version
            mvn -version

            cd ${WORKSPACE}
            mvn -B clean install -pl tests-all,tests-custom -am
    publishers:
        - archive:
            artifacts: 'tests-*/target/jcstress.jar'
        - email:
            recipients: 'stuart.monteith@linaro.org fathi.boudra@linaro.org'
