Commit 21039f9d authored by beuc's avatar beuc

SDK-8.1.0: new build

parent 0fc5b244
wd/
\ No newline at end of file
FROM ubuntu:trusty-20181115
MAINTAINER Sylvain Beucler <beuc@beuc.net>
COPY dependencies.sh /usr/src/dependencies.sh
RUN /usr/src/dependencies.sh
RUN useradd android -m -s /bin/bash
USER android
RUN mkdir /home/android/wd/
WORKDIR /home/android/wd/
COPY repo.sh /home/android/repo.sh
RUN /home/android/repo.sh
CMD /bin/bash
.PHONY: all
all:
docker build -t android-rebuilds:sdk-8.1.0 .
if [ ! -e wd/ ]; then mkdir wd/; fi
chown 1000:1000 wd/
cp -a build.sh wd/
docker run -it -v "$$(pwd)/wd:/home/android/wd" android-rebuilds:sdk-8.1.0 /home/android/wd/build.sh
#!/bin/bash -ex
VERSION='8.1.0_r53'
BUILD_VARIANT='user'
~/bin/repo init --quiet -u https://android.googlesource.com/platform/manifest -b android-$VERSION
~/bin/repo sync --quiet --current-branch -j4
# Still needed?
export USER=$(whoami)
# https://android.googlesource.com/platform/sdk/+/master/docs/howto_build_SDK.txt
export BUILD_NUMBER="${BUILD_VARIANT}.${VERSION}"
# https://source.android.com/setup/build/building#initialize
. build/envsetup.sh
# https://source.android.com/setup/build/building#choose-a-target
lunch sdk-${BUILD_VARIANT}
# https://source.android.com/setup/build/building#build-the-code
# Can't build sdk and win_sdk on the same 'make':
# build/core/main.mk:392: *** The 'sdk' target may not be specified with any other targets. Stop.
# dist: https://groups.google.com/forum/?fromgroups=#!topic/android-building/Y0xduZPWtUs
make sdk -j$(nproc) showcommands dist
make win_sdk -j$(nproc) showcommands dist
ls -lh \
out/host/linux-x86/sdk/sdk/android-sdk_${BUILD_NUMBER}_linux-x86.zip \
out/dist/android-sdk_${BUILD_NUMBER}_linux-x86.zip \
out/host/windows/sdk/sdk/android-sdk_${BUILD_NUMBER}_windows.zip \
out/dist/android-sdk_${BUILD_NUMBER}_windows.zip
# useful?
# out/target/product/generic/sdk-symbols-eng.android.zip
#!/bin/bash -ex
# Configuration
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/00InstallRecommends
# clean-up non-free sources
# AFAICS we need to update the base image as of 2018-11-20 as it's already partially upgraded
cat <<EOF > /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ trusty main universe
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main universe
#deb http://security.ubuntu.com/ubuntu/ trusty-security main universe
#deb http://archive.ubuntu.com/ubuntu/ trusty-backports main universe
EOF
dpkg --add-architecture i386
apt-get update
echo 'dash dash/sh boolean false' | debconf-set-selections
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure --pri=high dash
# https://source.android.com/setup/build/initializing
export DEBIAN_FRONTEND=noninteractive
# OpenJDK 8 N/A
#apt-get -y install openjdk-8-jdk
apt-get -y install wget
wget --quiet http://old-releases.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre-headless_8u45-b14-1_amd64.deb
wget --quiet http://old-releases.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre_8u45-b14-1_amd64.deb
wget --quiet http://old-releases.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jdk_8u45-b14-1_amd64.deb
checksumfile=$(mktemp)
cat <<'EOF' > $checksumfile
0f5aba8db39088283b51e00054813063173a4d8809f70033976f83e214ab56c0 openjdk-8-jre-headless_8u45-b14-1_amd64.deb
SHA256 9ef76c4562d39432b69baf6c18f199707c5c56a5b4566847df908b7d74e15849 openjdk-8-jre_8u45-b14-1_amd64.deb
SHA256 6e47215cf6205aa829e6a0a64985075bd29d1f428a4006a80c9db371c2fc3c4c openjdk-8-jdk_8u45-b14-1_amd64.deb
EOF
sha256sum $checksumfile || exit "Incorrect checksums"
dpkg -i openjdk-8-jdk_8u45-b14-1_amd64.deb \
openjdk-8-jre-headless_8u45-b14-1_amd64.deb \
openjdk-8-jre_8u45-b14-1_amd64.deb || true
apt-get -y -f install
# https://source.android.com/setup/build/initializing
apt-get -y install git-core gnupg flex bison gperf build-essential zip \
curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev \
libgl1-mesa-dev libxml2-utils xsltproc unzip
# TODO: are hose still necessary?
apt-get -y install python-networkx
apt-get -y install zlib1g-dev:i386
# Windows dependencies
# https://sites.google.com/a/android.com/tools/build 2015-07-23
apt-get -y install mingw32 tofrodos
# Repo
apt-get install -y curl ca-certificates git python
#!/bin/bash -ex
#sudo apt-get install curl ca-certificates git python
mkdir ~/bin/
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
# avoid prompts and errors
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
git config --global color.ui true
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment