blob: 14b3397e0d29f991de7349fd4f86b08afc5f051b [file] [log] [blame]
Jeff Gastonbbeda2d2020-05-26 13:14:15 -04001#!/bin/bash -ev
Jeff Gaston4731db32020-05-06 15:09:54 -04002
3# Updates prebuilts/jdk/jdk11 from build server.
4# Usage:
Jeff Gastonbbeda2d2020-05-26 13:14:15 -04005# $ cd <REPO>
Jeff Gaston4731db32020-05-06 15:09:54 -04006# $ repo start jdk11_update .
Jeff Gastonbbeda2d2020-05-26 13:14:15 -04007# $ prebuilts/jdk/jdk11/update-jdk11.sh <BUILD_NUMBER>
Jeff Gaston4731db32020-05-06 15:09:54 -04008# $ 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
Jeff Gastonbbeda2d2020-05-26 13:14:15 -040016cd "$(dirname $0)"
Jeff Gaston4731db32020-05-06 15:09:54 -040017
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
Colin Crossa7fdd4a2021-12-17 20:41:38 -080037# Copy the RBE toolchain inputs files from the previous version to the staging
38# directory.
39cp linux-x86/bin/*_remote_toolchain_inputs staging/linux-x86/bin
40
Jeff Gaston4731db32020-05-06 15:09:54 -040041version=$(staging/linux-x86/bin/java -version 2>&1 | grep "OpenJDK Runtime Environment" | sed -e 's/.*(\(.*\))/\1/')
42
43# Commit to staging
44git add staging
45git commit -m "Add JDK ${version} to staging
46
47Test: none"
48
49git rm -rf linux-x86 darwin-x86 manifest.xml
50git mv staging/* .
Jeff Gastonbbeda2d2020-05-26 13:14:15 -040051rmdir staging
Jeff Gaston4731db32020-05-06 15:09:54 -040052git commit -m "Switch to JDK $version" --edit