Skip to content

Commit 9866a0c

Browse files
author
Vladimir Kotal
committed
use OpenJDK 8
1 parent b2b9cf7 commit 9866a0c

File tree

4 files changed

+26
-19
lines changed

4 files changed

+26
-19
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ jobs:
5050
before_install: dev/before_install
5151
before_script: dev/before
5252
- stage: test
53-
name: Windows + Oracle JDK 8
53+
name: Windows + Open JDK 8
5454
# Use shell until Travis supports Java on Windows proper.
5555
language: shell
5656
os: windows
5757
install: true
5858
script: dev/main
59-
before_install: dev/before_install
59+
before_install: dev/before_install.windows openjdk8
6060
before_script: dev/before
6161
- stage: deploy
6262
name: Github Release

dev/before_install

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,4 @@ elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
7272
echo "cannot install Universal ctags"
7373
exit 1
7474
fi
75-
elif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
76-
choco install jdk8 -params 'installdir=c:\\jdk' -y
77-
export JAVA_HOME=${JAVA_HOME:-/c/jdk}
78-
export PATH=${JAVA_HOME}/bin:${PATH}
79-
80-
choco install maven
81-
82-
choco install universal-ctags
83-
export PATH=${PATH}:/c/ProgramData/chocolatey/lib/universal-ctags/tools
84-
85-
choco install svn
86-
export PATH=${PATH}:/c/Program\ Files\ \(x86\)/Subversion/bin
87-
88-
choco install python3
89-
# needs to be before the default Python 2
90-
export PATH=/c/Python38:${PATH}
9175
fi

dev/before_install.windows

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
[[ "$TRAVIS_OS_NAME" == "windows" ]] || exit 1
4+
5+
JDK="$1"
6+
7+
choco install $JDK -y
8+
9+
choco install maven
10+
11+
choco install universal-ctags
12+
export PATH=${PATH}:/c/ProgramData/chocolatey/lib/universal-ctags/tools
13+
14+
choco install svn
15+
export PATH=${PATH}:/c/Program\ Files\ \(x86\)/Subversion/bin
16+
17+
choco install python3
18+
# needs to be before the default Python 2
19+
export PATH=/c/Python38:${PATH}

dev/main

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,15 @@ if [ "x$TRAVIS_REPO_SLUG" == "xoracle/opengrok" ]; then
2424
fi
2525

2626
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
27-
export JAVA_HOME=${JAVA_HOME:-/c/jdk}
27+
JAVA_BASE="/c/Program Files/OpenJDK"
28+
JDK_DIR=$(find "$JAVA_BASE/" -type d -name 'openjdk*' -maxdepth 1 | head -1)
29+
export JAVA_HOME=${JAVA_HOME:-$JDK_DIR}
30+
echo "JAVA_HOME set to $JAVA_HOME"
2831
export PATH=${JAVA_HOME}/bin:${PATH}
2932

3033
export PATH=${PATH}:/c/ProgramData/chocolatey/lib/universal-ctags/tools
3134
export PATH=${PATH}:/c/Program\ Files\ \(x86\)/Subversion/bin
35+
export PATH=${PATH}:${JAVA_HOME}
3236

3337
# needs to be before the default Python 2
3438
export PATH=/c/Python38:${PATH}

0 commit comments

Comments
 (0)