blob: 6f0211724ba688914989c69741cb816c27f37f68 [file] [log] [blame]
Søren Gjesse09c3dd02021-06-17 08:21:51 +02001#!/bin/bash
2#
3# Copyright (c) 2021, the R8 project authors. Please see the AUTHORS file
4# for details. All rights reserved. Use of this source code is governed by a
5# BSD-style license that can be found in the LICENSE file.
6
7set -e
8set -x
9
10if [[ -z "$1" ]]; then
11 echo "No version argument supplied"
12 exit -1
13fi
14
15VERSION=$1
16
17RELEASES_ROOT=third_party/openjdk/desugar_jdk_libs_releases
18mkdir -p $RELEASES_ROOT
19RELEASED_VERSION_DIR=$RELEASES_ROOT/$VERSION
20if [[ -d $RELEASED_VERSION_DIR ]]; then
21 echo "$RELEASED_VERSION_DIR already exists"
22 exit -1
23fi
24
25MAVEN_REPO_DIR=/tmp/maven_repo_local
26rm -rf $MAVEN_REPO_DIR
27
28DOWNLOAD_DIR=/tmp/desugar_jdk_libs_download
29rm -rf $DOWNLOAD_DIR
30mkdir -p $DOWNLOAD_DIR
31
32mvn \
33 org.apache.maven.plugins:maven-dependency-plugin:2.4:get \
34 -Dmaven.repo.local=$MAVEN_REPO_DIR \
35 -DremoteRepositories=http://maven.google.com \
36 -Dartifact=com.android.tools:desugar_jdk_libs:$VERSION \
37 -Ddest=$DOWNLOAD_DIR/desugar_jdk_libs.jar
38
39mvn \
40 org.apache.maven.plugins:maven-dependency-plugin:2.4:get \
41 -Dmaven.repo.local=$MAVEN_REPO_DIR \
42 -DremoteRepositories=http://maven.google.com \
43 -Dartifact=com.android.tools:desugar_jdk_libs_configuration:$VERSION \
44 -Ddest=$DOWNLOAD_DIR/desugar_jdk_libs_configuration.jar
45
46 unzip $DOWNLOAD_DIR/desugar_jdk_libs_configuration.jar META-INF/desugar/d8/desugar.json -d $DOWNLOAD_DIR
47
48 mkdir $RELEASED_VERSION_DIR
49 cp $DOWNLOAD_DIR/desugar_jdk_libs.jar $RELEASED_VERSION_DIR
50 cp $DOWNLOAD_DIR/desugar_jdk_libs_configuration.jar $RELEASED_VERSION_DIR
51 cp $DOWNLOAD_DIR/META-INF/desugar/d8/desugar.json $RELEASED_VERSION_DIR/desugar.json
52 cp third_party/openjdk/desugar_jdk_libs/README.google $RELEASED_VERSION_DIR
53
54 (cd $RELEASES_ROOT && \
55 upload_to_google_storage.py -a --bucket r8-deps $VERSION && \
56 git add $VERSION.tar.gz.sha1)