blob: ae9590f66dda3a9e8a191c4a8464025b1bd3852b [file] [log] [blame]
Jeff Gaston4731db32020-05-06 15:09:54 -04001#!/bin/bash -v
2
3# Updates prebuilts/jdk/jdk11 from build server.
4# Usage:
5# $ cd <REPO>/prebuilts/jdk/jdk11
6# $ repo start jdk11_update .
7# $ update-jdk11.sh <BUILD_NUMBER>
8# $ repo upload --cbr .
9
10
11BUILD_NUMBER="${1:?Specify build number}"
12LINUX_ZIP=/tmp/$$.linux.zip
13DARWIN_ZIP=/tmp/$$.darwin.zip
14
15FETCH_ARTIFACT=/google/data/ro/projects/android/fetch_artifact
16cd "${ANDROID_BUILD_TOP:?ANDROID_BUILD_TOP must be set, run lunch first}"/prebuilts/jdk/jdk11
17
18rm -rf staging
19mkdir -p staging
20
21$FETCH_ARTIFACT --bid ${BUILD_NUMBER} --disable_progressbar --target linux_openjdk11 jdk.zip ${LINUX_ZIP}
22$FETCH_ARTIFACT --bid ${BUILD_NUMBER} --disable_progressbar --target darwin_mac_openjdk11 jdk.zip ${DARWIN_ZIP}
23$FETCH_ARTIFACT --bid ${BUILD_NUMBER} --disable_progressbar --target linux_openjdk11 manifest_${BUILD_NUMBER}.xml staging/manifest.xml
24
25rm -rf staging/linux-x86
26mkdir -p staging/linux-x86
27(cd staging/linux-x86; unzip -q ${LINUX_ZIP})
28touch staging/linux-x86/MODULE_LICENSE_GPL
29
30rm -rf staging/darwin-x86
31mkdir staging/darwin-x86
32(cd staging/darwin-x86; unzip -q ${DARWIN_ZIP})
33touch staging/darwin-x86/MODULE_LICENSE_GPL
34
35rm -f ${LINUX_ZIP} ${DARWIN_ZIP}
36
37version=$(staging/linux-x86/bin/java -version 2>&1 | grep "OpenJDK Runtime Environment" | sed -e 's/.*(\(.*\))/\1/')
38
39# Commit to staging
40git add staging
41git commit -m "Add JDK ${version} to staging
42
43Test: none"
44
45git rm -rf linux-x86 darwin-x86 manifest.xml
46git mv staging/* .
47git commit -m "Switch to JDK $version" --edit