Commit 40b8a247 authored by beuc's avatar beuc

WIP sdk_tools

studio-3.2.1 -> studio-3.4.0 but still generates tools-26.1.1
compilation of Studio itself fails with missing Java lib
parent 26ec3388
wd/
\ No newline at end of file
FROM ubuntu:trusty-20191217
MAINTAINER Sylvain Beucler <[email protected]>
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
VERSION=x
all:
docker build -t android-rebuilds:sdk_tools-$(VERSION) .
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_tools-$(VERSION) /home/android/wd/build.sh
#!/bin/bash -ex
# https://android.googlesource.com/platform/tools/base/+/studio-master-dev/source.md
# As of 2020-05, studio-3.4 still generates tools-26.1.1, like studio-3.2.1
~/bin/repo init --quiet -u https://android.googlesource.com/platform/manifest -b studio-3.4.0
~/bin/repo sync --quiet --current-branch -j4
# Needed?
export USER=$(whoami)
#tools/base/bazel/bazel version
# SDK tools
# https://sites.google.com/a/android.com/tools/build/#TOC-Building-the-Linux-and-MacOS-SDK
mkdir -p out/dist
# Install required android.jar -- move to dl.sh and https://android-rebuilds.beuc.net/dl/prebuilts/sdk/ when available
wget -c https://android-rebuilds.beuc.net/dl/repository/sdk-repo-linux-platforms-userdebug.8.1.0_r61.zip
unzip sdk-repo-linux-platforms-userdebug.8.1.0_r61.zip android-8.1.0/android.jar
mkdir -p prebuilts/studio/sdk/linux/platforms/android-27/
mv android-8.1.0/android.jar prebuilts/studio/sdk/linux/platforms/android-27/android.jar
# build_tools.sh wants to create this directory
rm -rf out/dist/host-test-reports/
# Build
bash -x tools/buildSrc/servers/build_tools.sh `pwd`/out `pwd`/out/dist 0
# Android Studio
# https://android.googlesource.com/platform/tools/base/+/studio-master-dev/studio.md
(
cd tools/idea/
bash -x ./build_studio.sh
)
# Gradle plugin
# https://android.googlesource.com/platform/tools/base/+/studio-master-dev/build-system/README.md
# http://tools.android.com/build/gradleplugin
(
cd tools/
./gradlew assemble
# TODO: this asks for a SDK, plus with more recent buildtools than we just compiled
./gradlew publishLocal || true
)
# buildscript {
# repositories {
# jcenter()
# maven { url '.../out/repo' }
# }
# dependencies {
# classpath 'com.android.tools.build:gradle:3.2.0-dev'
# The resulting repo lacks packages:
# com.android.tools.build:bundletool:0.5.0 com.android.tools.build.jetifier:jetifier-core:1.0.0-alpha10 com.android.tools.build.jetifier:jetifier-processor:1.0.0-alpha10
# which are present in the prebuilts
cat tools/base/files/tools_source.properties # + sdk-repo-linux-tools-0.zip/tools/source.properties
ls -lh out/dist/ # SDK tools
ls -lh tools/idea/out/studio/dist/ # Android Studio
ls -lh out/repo/ # Android Gradle plugin
#!/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/older-versions#for-ubuntu-14-04
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
9ef76c4562d39432b69baf6c18f199707c5c56a5b4566847df908b7d74e15849 openjdk-8-jre_8u45-b14-1_amd64.deb
6e47215cf6205aa829e6a0a64985075bd29d1f428a4006a80c9db371c2fc3c4c openjdk-8-jdk_8u45-b14-1_amd64.deb
EOF
sha256sum -c $checksumfile || exit 1
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
# Compiles 32-bit C++ programs
# 'emugen' compiled and run as 32-bit
apt-get -y install make binutils patch
apt-get -y install g++-multilib
apt-get -y install zip unzip libxml2-utils # zip/unzip/zip + xmllint
# 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 "[email protected]"
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