From 6bece6a058e05a0e1951326e897e9d028bce4ef1 Mon Sep 17 00:00:00 2001 From: wchen342 Date: Tue, 9 Nov 2021 03:38:48 +0200 Subject: [PATCH] Update to 12.0.0_r13; Add user build --- ndk/docker-build.sh | 2 +- sdk/build.sh | 10 +++++++--- sdk/docker-build.sh | 25 ++++++++++++++++++++----- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/ndk/docker-build.sh b/ndk/docker-build.sh index 7c73872..5957ff3 100755 --- a/ndk/docker-build.sh +++ b/ndk/docker-build.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -eux -o pipefail -VERSION='r23' # temporarily before SDK 12 comes out formally +VERSION='r23' export USER=$(whoami) diff --git a/sdk/build.sh b/sdk/build.sh index fdb26bc..77fd8b3 100755 --- a/sdk/build.sh +++ b/sdk/build.sh @@ -1,10 +1,12 @@ #!/usr/bin/env bash set -eu -o pipefail +# Must be run in sdk folder +# Note: you need more than 16GB memory excluding swap, or build will fail. pushd ../base && source ./setup.sh && popd container_name="android-rebuilds-sdk" -VERSION='12.0.0_r2' +VERSION='12.0.0_r13' docker create --name ${container_name} --workdir /home/build/wd --entrypoint "tail" android-rebuilds:base "-f" "/dev/null" docker start "${container_name}" @@ -15,8 +17,10 @@ docker cp docker-build.sh "${container_name}":/home/build/wd/docker-build.sh docker exec --user build "${container_name}" bash -c "/home/build/wd/docker-build.sh" # copy output -docker cp "${container_name}":/home/build/wd/out/dist/android-sdk_eng.build_linux-x86.zip android-sdk_eng.${VERSION}_linux-x86.zip -docker cp "${container_name}":/home/build/wd/out/dist/android-sdk_eng.build_windows.zip android-sdk_eng.${VERSION}_windows.zip +docker cp "${container_name}":/home/build/wd/out/dist/android-sdk_user-${VERSION}_linux-x86.zip android-sdk_user-${VERSION}_linux-x86.zip +docker cp "${container_name}":/home/build/wd/out/dist/android-sdk_user-${VERSION}_windows.zip android-sdk_user-${VERSION}_windows.zip +docker cp "${container_name}":/home/build/wd/out/dist/android-sdk_eng-${VERSION}_linux-x86.zip android-sdk_eng-${VERSION}_linux-x86.zip +docker cp "${container_name}":/home/build/wd/out/dist/android-sdk_eng-${VERSION}_windows.zip android-sdk_eng-${VERSION}_windows.zip # shutdown and remove container if docker ps --format '{{.Names}}' | grep -w "${container_name}" &> /dev/null; then diff --git a/sdk/docker-build.sh b/sdk/docker-build.sh index b988871..5084eba 100755 --- a/sdk/docker-build.sh +++ b/sdk/docker-build.sh @@ -1,12 +1,14 @@ #!/usr/bin/env bash set -eux -o pipefail -VERSION='12.0.0_r2' # temporarily before SDK 12 comes out formally +VERSION='12.0.0_r13' # temporarily before SDK 12 comes out formally # https://source.android.com/setup/build/building#choose-a-target -TARGET='eng' # user, userdebug, eng +TARGET_USER='user' # user, userdebug, eng +TARGET_ENG='eng' # user, userdebug, eng + +export JAVA_TOOL_OPTIONS="-Xmx8g" # increase Java heap size export USER=$(whoami) -export BUILD_NUMBER="${TARGET}-${VERSION}" # Sync sources repo init -u https://android.googlesource.com/platform/manifest -b android-$VERSION --depth=1 @@ -16,10 +18,23 @@ repo sync -c -j4 pushd development && git apply ../development.patch && popd # Build -# build/envsetup.sh cannot be run with -u + +# build user +export BUILD_NUMBER="${TARGET_USER}-${VERSION}" +# build/envsetup.sh and lunch cannot be run with -u set +u source build/envsetup.sh -lunch sdk_arm64-${TARGET} +lunch sdk_arm64-${TARGET_USER} +set -u + +# win_sdk build linux SDK too +#make -j$(nproc) sdk dist sdk_repo +make -j$(nproc) win_sdk dist sdk_repo + +# build eng +export BUILD_NUMBER="${TARGET_ENG}-${VERSION}" +set +u +lunch sdk_arm64-${TARGET_ENG} set -u # win_sdk build linux SDK too