Skip to content

Commit

Permalink
Update to 12.0.0_r13; Add user build
Browse files Browse the repository at this point in the history
  • Loading branch information
wchen342 committed Nov 10, 2021
1 parent 4332bb4 commit 6bece6a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ndk/docker-build.sh
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
10 changes: 7 additions & 3 deletions sdk/build.sh
Original file line number Diff line number Diff line change
@@ -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}"
Expand All @@ -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
Expand Down
25 changes: 20 additions & 5 deletions sdk/docker-build.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6bece6a

Please sign in to comment.