blob: 72ef070cddd2bf1d0291cfa970ccbe65482ad929 [file] [log] [blame]
Jeff Gastonbbeda2d2020-05-26 13:14:15 -04001#!/bin/bash -ev
Jeff Gaston4731db32020-05-06 15:09:54 -04002
Rahul Ravikumar44f9ae42022-02-10 16:23:30 -08003# Updates prebuilts/jdk/jdk11 from build server. (ab/openjdk)
Jeff Gaston4731db32020-05-06 15:09:54 -04004# 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
Rahul Ravikumarf9a19212022-02-14 13:50:48 -080014DARWIN_ARM64_ZIP=/tmp/$$.darwin_arm64.zip
Jeff Gaston4731db32020-05-06 15:09:54 -040015
16FETCH_ARTIFACT=/google/data/ro/projects/android/fetch_artifact
Jeff Gastonbbeda2d2020-05-26 13:14:15 -040017cd "$(dirname $0)"
Jeff Gaston4731db32020-05-06 15:09:54 -040018
19rm -rf staging
20mkdir -p staging
21
22$FETCH_ARTIFACT --bid ${BUILD_NUMBER} --disable_progressbar --target linux_openjdk11 jdk.zip ${LINUX_ZIP}
23$FETCH_ARTIFACT --bid ${BUILD_NUMBER} --disable_progressbar --target darwin_mac_openjdk11 jdk.zip ${DARWIN_ZIP}
Rahul Ravikumarf9a19212022-02-14 13:50:48 -080024$FETCH_ARTIFACT --bid ${BUILD_NUMBER} --disable_progressbar --target darwin_aarch64_jetbrainsruntime jdk-bundle.zip ${DARWIN_ARM64_ZIP}
Jeff Gaston4731db32020-05-06 15:09:54 -040025$FETCH_ARTIFACT --bid ${BUILD_NUMBER} --disable_progressbar --target linux_openjdk11 manifest_${BUILD_NUMBER}.xml staging/manifest.xml
26
27rm -rf staging/linux-x86
28mkdir -p staging/linux-x86
29(cd staging/linux-x86; unzip -q ${LINUX_ZIP})
30touch staging/linux-x86/MODULE_LICENSE_GPL
31
32rm -rf staging/darwin-x86
33mkdir staging/darwin-x86
34(cd staging/darwin-x86; unzip -q ${DARWIN_ZIP})
35touch staging/darwin-x86/MODULE_LICENSE_GPL
36
Rahul Ravikumarf9a19212022-02-14 13:50:48 -080037rm -rf staging/darwin-arm64
38mkdir staging/darwin-arm64
39(cd staging/darwin-arm64; unzip -q ${DARWIN_ARM64_ZIP})
40# Copy contents of the JDK
41(cp -r staging/darwin-arm64/jdk-11.0.13.jdk/Contents/Home/* staging/darwin-arm64; rm -rf staging/darwin-arm64/jdk-11.0.13.jdk)
Rahul Ravikumar44f9ae42022-02-10 16:23:30 -080042touch staging/darwin-x86/MODULE_LICENSE_GPL
43
Rahul Ravikumarf9a19212022-02-14 13:50:48 -080044rm -f ${LINUX_ZIP} ${DARWIN_ZIP} ${DARWIN_ARM64_ZIP}
Jeff Gaston4731db32020-05-06 15:09:54 -040045
Colin Crossa7fdd4a2021-12-17 20:41:38 -080046# Copy the RBE toolchain inputs files from the previous version to the staging
47# directory.
48cp linux-x86/bin/*_remote_toolchain_inputs staging/linux-x86/bin
49
Jeff Gaston4731db32020-05-06 15:09:54 -040050version=$(staging/linux-x86/bin/java -version 2>&1 | grep "OpenJDK Runtime Environment" | sed -e 's/.*(\(.*\))/\1/')
51
52# Commit to staging
53git add staging
54git commit -m "Add JDK ${version} to staging
55
56Test: none"
57
58git rm -rf linux-x86 darwin-x86 manifest.xml
59git mv staging/* .
Jeff Gastonbbeda2d2020-05-26 13:14:15 -040060rmdir staging
Jeff Gaston4731db32020-05-06 15:09:54 -040061git commit -m "Switch to JDK $version" --edit