aboutsummaryrefslogtreecommitdiff
path: root/jtreg-build.yaml
blob: 0a9fa267d12e1404ec819c396b84696c4b496999 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
- job:
    name: jtreg-build
    project-type: freestyle
    defaults: global
    description: |
        * Build JDK Regression Test Harness (jtreg).
    logrotate:
        numToKeep: 10
        artifactNumToKeep: 1
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
    disabled: false
    node: aarch64-06
    display-name: 'OpenJDK - Build JDK Regression Test Harness (jtreg)'
    scm:
        - hg:
            url: http://hg.openjdk.java.net/code-tools/jtreg/
            clean: true
            browser: hgweb
            browser-url: http://hg.openjdk.java.net/code-tools/jtreg/
    triggers:
        - pollscm: 'H/5 * * * *'
    wrappers:
        - timestamps
    builders:
        - shell: |
            #!/bin/bash

            set -eu

            if [ ! -d jh2.0 ]; then
              # no longer available from http://download.java.net/javadesktop/javahelp/javahelp2_0_05.zip
              # 7bd68b82a1d5d8714856f661bd4d71a3 https://github.com/glub/secureftp/raw/master/contrib/javahelp2_0_05.zip
              wget http://ftp.internat.freebsd.org/pub/FreeBSD/distfiles/javahelp2_0_05.zip
              unzip -o javahelp2_0_05.zip
            fi

            if [ ! -d jtharness ]; then
              wget http://download.java.net/jtharness/4.4.1/Rel/jtharness-4_4_1-MR1-bin-b13-20_dec_2011.zip
              mkdir jtharness
              cd jtharness
              unzip -o ../jtharness-4_4_1-MR1-bin-b13-20_dec_2011.zip
              cd ..
            fi

            if [ ! -d junit ]; then
              mkdir junit
              wget http://repo1.maven.org/maven2/junit/junit/4.8.2/junit-4.8.2.jar -O junit/junit.jar
            fi

            if [ ! -d testng ]; then
              mkdir testng
              wget http://repo1.maven.org/maven2/org/testng/testng/6.8.5/testng-6.8.5.jar -O testng/testng.jar
            fi

            if [ ! -d jcommander ]; then
              mkdir jcommander
              wget http://repo1.maven.org/maven2/com/beust/jcommander/1.7/jcommander-1.7.jar -O jcommander/jcommander.jar
            fi

            ls -lash

            rm -fr build
            rm -fr dist

            which java
            java -version

            # syntax of the -target and -source command have changed with jdk9
            sed -i 's|1.8|8|g' make/build.xml

            ant -v -f make/build.xml \
                -Djunit.jar=./junit/junit.jar \
                -Dtestng.jar=./testng/testng.jar \
                -Djavatest.home=./jh2.0 \
                -Djavatest.home=./jtharness \
                -Djavatest.jar=./jtharness/lib/javatest.jar \
                -Djavahelp.home=./jh2.0 \
                -Djhall.jar=./jh2.0/javahelp/lib/jhall.jar \
                -Djh.jar=./jh2.0/javahelp/lib/jh.jar \
                -Dbuild.version=4.2 \
                -Dbuild.number=b02

            rm -f *.zip
            rm -f *.tar.gz

            cp -r ./dist/jtreg .
            cp jcommander/jcommander.jar ./dist/jtreg/lib
            chmod u+x ./dist/jtreg/bin/*

            ls -lash

            : ${MAJOR:=4}
            : ${MINOR:=2}
            : ${MICRO:=0}
            : ${VERSION_SUFFIX:=SNAPSHOT}
            : ${JOB_NAME:=jtreg}
            : ${ZIP_TYPE:=xz}

            artifact=${JOB_NAME}-${MAJOR}.${MINOR}.${MICRO}-${VERSION_SUFFIX}

            cd ./dist
            tar afcv $artifact.tar.${ZIP_TYPE} jtreg
            mv $artifact.tar.${ZIP_TYPE} ..
            cd ..
            rm -fr ${artifact}
    publishers:
        - archive:
            artifacts: 'jtreg-build-4.2.0-SNAPSHOT.tar.xz'
        - email:
            recipients: 'stuart.monteith@linaro.org fathi.boudra@linaro.org'