Compare commits
3 commits
master
...
generic-au
Author | SHA1 | Date | |
---|---|---|---|
![]() |
72beda42ed | ||
![]() |
47966f5bf1 | ||
![]() |
0e512766d8 |
3 changed files with 93 additions and 70 deletions
|
@ -2,94 +2,35 @@
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
FROM mozillamobile/android-components:1.4
|
FROM mozillamobile/rust-component:buildtools-27.0.3-ndk-r17b-ndk-version-26-rust-stable-rust-beta
|
||||||
|
|
||||||
MAINTAINER Nick Alexander "nalexander@mozilla.com"
|
MAINTAINER Nick Alexander "nalexander@mozilla.com"
|
||||||
|
|
||||||
#----------------------------------------------------------------------------------------------------------------------
|
|
||||||
#-- Configuration -----------------------------------------------------------------------------------------------------
|
|
||||||
#----------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ENV ANDROID_NDK_VERSION "r17b"
|
|
||||||
ENV PROJECT_REPOSITORY "https://github.com/mozilla/mentat.git"
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------------------------------------------------
|
|
||||||
#-- System ------------------------------------------------------------------------------------------------------------
|
|
||||||
#----------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
RUN apt-get update -qq
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------------------------------------------------
|
|
||||||
#-- Android NDK (Android SDK comes from base `android-components` image) ----------------------------------------------
|
|
||||||
#----------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
RUN mkdir -p /build
|
|
||||||
WORKDIR /build
|
|
||||||
|
|
||||||
# ENV ANDROID_HOME /build/android-sdk
|
|
||||||
# ENV ANDROID_SDK_HOME /build/android-sdk
|
|
||||||
ENV ANDROID_NDK_HOME /build/android-ndk
|
|
||||||
# ENV PATH ${PATH}:${ANDROID_NDK_HOME}/tools:${ANDROID_SDK_HOME}/tools/bin:${ANDROID_SDK_HOME}/platform-tools:/opt/tools:${ANDROID_SDK_HOME}/build-tools/${ANDROID_BUILD_TOOLS}
|
|
||||||
|
|
||||||
RUN curl -L https://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip > ndk.zip \
|
|
||||||
&& unzip ndk.zip -d /build \
|
|
||||||
&& rm ndk.zip \
|
|
||||||
&& mv /build/android-ndk-${ANDROID_NDK_VERSION} ${ANDROID_NDK_HOME}
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------------------------------------------------
|
|
||||||
#-- Rust (cribbed from https://github.com/rust-lang-nursery/docker-rust/blob/ced83778ec6fea7f63091a484946f95eac0ee611/1.27.1/stretch/Dockerfile)
|
|
||||||
#-- Rust after the Android NDK since Rust rolls forward more frequently.
|
|
||||||
#----------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ENV RUSTUP_HOME=/usr/local/rustup \
|
|
||||||
CARGO_HOME=/usr/local/cargo \
|
|
||||||
PATH=/usr/local/cargo/bin:$PATH \
|
|
||||||
RUST_VERSION=1.27.1
|
|
||||||
|
|
||||||
RUN set -eux; \
|
|
||||||
rustArch='x86_64-unknown-linux-gnu'; rustupSha256='4d382e77fd6760282912d2d9beec5e260ec919efd3cb9bdb64fe1207e84b9d91'; \
|
|
||||||
url="https://static.rust-lang.org/rustup/archive/1.12.0/${rustArch}/rustup-init"; \
|
|
||||||
wget "$url"; \
|
|
||||||
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
|
|
||||||
chmod +x rustup-init; \
|
|
||||||
./rustup-init -y --no-modify-path --default-toolchain $RUST_VERSION; \
|
|
||||||
rm rustup-init; \
|
|
||||||
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
|
|
||||||
rustup --version; \
|
|
||||||
cargo --version; \
|
|
||||||
rustc --version; \
|
|
||||||
rustup target add i686-linux-android; \
|
|
||||||
rustup target add arm-linux-androideabi; \
|
|
||||||
rustup target add aarch64-linux-android
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------------------------------------------------
|
#----------------------------------------------------------------------------------------------------------------------
|
||||||
#-- Project -----------------------------------------------------------------------------------------------------------
|
#-- Project -----------------------------------------------------------------------------------------------------------
|
||||||
#----------------------------------------------------------------------------------------------------------------------
|
#----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
ENV PROJECT_REPOSITORY "https://github.com/mozilla/mentat.git"
|
||||||
|
|
||||||
RUN git clone $PROJECT_REPOSITORY
|
RUN git clone $PROJECT_REPOSITORY
|
||||||
|
|
||||||
WORKDIR /build/mentat
|
WORKDIR /build/mentat
|
||||||
|
|
||||||
# Temporary.
|
# Temporary.
|
||||||
RUN git fetch origin build-android-sdk && git checkout origin/build-android-sdk && git show-ref HEAD
|
RUN git fetch origin master && git checkout origin/generic-automation-images && git show-ref HEAD
|
||||||
|
|
||||||
# Populate dependencies.
|
# Populate dependencies.
|
||||||
RUN ./sdks/android/Mentat/gradlew --no-daemon -p sdks/android/Mentat tasks
|
RUN ./sdks/android/Mentat/gradlew --no-daemon -p sdks/android/Mentat tasks
|
||||||
|
|
||||||
# Cache toolchains.
|
|
||||||
RUN ./sdks/android/Mentat/gradlew --no-daemon -p sdks/android/Mentat generateToolchains
|
|
||||||
|
|
||||||
# Build Rust.
|
# Build Rust.
|
||||||
RUN ./sdks/android/Mentat/gradlew --no-daemon -p sdks/android/Mentat cargoBuild
|
RUN ./sdks/android/Mentat/gradlew --no-daemon -p sdks/android/Mentat cargoBuild
|
||||||
|
|
||||||
# Actually build. In the future, we might also test and lint (to cache additional dependencies).
|
# Actually build. In the future, we might also lint (to cache additional dependencies).
|
||||||
RUN ./sdks/android/Mentat/gradlew --no-daemon -p sdks/android/Mentat assemble
|
RUN ./sdks/android/Mentat/gradlew --no-daemon -p sdks/android/Mentat assemble test
|
||||||
|
|
||||||
# Drop built Rust artifacts.
|
|
||||||
RUN cargo clean
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------------------------------------------------
|
#----------------------------------------------------------------------------------------------------------------------
|
||||||
# -- Cleanup ----------------------------------------------------------------------------------------------------------
|
# -- Cleanup ----------------------------------------------------------------------------------------------------------
|
||||||
#----------------------------------------------------------------------------------------------------------------------
|
#----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
RUN apt-get clean
|
# Drop built Rust artifacts.
|
||||||
|
RUN cargo clean
|
||||||
|
|
81
automation/docker/generic/Dockerfile
Normal file
81
automation/docker/generic/Dockerfile
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
FROM mozillamobile/android-components:1.4
|
||||||
|
|
||||||
|
MAINTAINER Nick Alexander "nalexander@mozilla.com"
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------------------------------------------------
|
||||||
|
#-- Configuration -----------------------------------------------------------------------------------------------------
|
||||||
|
#----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
ENV ANDROID_NDK_VERSION "r17b"
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------------------------------------------------
|
||||||
|
#-- System ------------------------------------------------------------------------------------------------------------
|
||||||
|
#----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
RUN apt-get update -qq
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------------------------------------------------
|
||||||
|
#-- Android NDK (Android SDK comes from base `android-components` image) ----------------------------------------------
|
||||||
|
#----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
RUN mkdir -p /build
|
||||||
|
WORKDIR /build
|
||||||
|
|
||||||
|
ENV ANDROID_NDK_HOME /build/android-ndk
|
||||||
|
|
||||||
|
RUN curl -L https://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip > ndk.zip \
|
||||||
|
&& unzip ndk.zip -d /build \
|
||||||
|
&& rm ndk.zip \
|
||||||
|
&& mv /build/android-ndk-${ANDROID_NDK_VERSION} ${ANDROID_NDK_HOME}
|
||||||
|
|
||||||
|
ENV ANDROID_NDK_TOOLCHAIN_DIR /build/android-ndk-toolchain
|
||||||
|
ENV ANDROID_NDK_API_VERSION 26
|
||||||
|
|
||||||
|
RUN set -eux; \
|
||||||
|
python "$ANDROID_NDK_HOME/build/tools/make_standalone_toolchain.py" --arch="arm" --api="$ANDROID_NDK_API_VERSION" --install-dir="$ANDROID_NDK_TOOLCHAIN_DIR/arm-$ANDROID_NDK_API_VERSION" --force; \
|
||||||
|
python "$ANDROID_NDK_HOME/build/tools/make_standalone_toolchain.py" --arch="arm64" --api="$ANDROID_NDK_API_VERSION" --install-dir="$ANDROID_NDK_TOOLCHAIN_DIR/arm64-$ANDROID_NDK_API_VERSION" --force; \
|
||||||
|
python "$ANDROID_NDK_HOME/build/tools/make_standalone_toolchain.py" --arch="x86" --api="$ANDROID_NDK_API_VERSION" --install-dir="$ANDROID_NDK_TOOLCHAIN_DIR/x86-$ANDROID_NDK_API_VERSION" --force
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------------------------------------------------
|
||||||
|
#-- Rust (cribbed from https://github.com/rust-lang-nursery/docker-rust/blob/ced83778ec6fea7f63091a484946f95eac0ee611/1.27.1/stretch/Dockerfile)
|
||||||
|
#-- Rust is after the Android NDK since Rust rolls forward more frequently. Both stable and beta for advanced consumers.
|
||||||
|
#----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
ENV RUSTUP_HOME=/usr/local/rustup \
|
||||||
|
CARGO_HOME=/usr/local/cargo \
|
||||||
|
PATH=/usr/local/cargo/bin:$PATH \
|
||||||
|
RUST_VERSION=1.27.1
|
||||||
|
|
||||||
|
RUN set -eux; \
|
||||||
|
rustArch='x86_64-unknown-linux-gnu'; rustupSha256='4d382e77fd6760282912d2d9beec5e260ec919efd3cb9bdb64fe1207e84b9d91'; \
|
||||||
|
url="https://static.rust-lang.org/rustup/archive/1.12.0/${rustArch}/rustup-init"; \
|
||||||
|
wget "$url"; \
|
||||||
|
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
|
||||||
|
chmod +x rustup-init; \
|
||||||
|
./rustup-init -y --no-modify-path --default-toolchain $RUST_VERSION; \
|
||||||
|
rm rustup-init; \
|
||||||
|
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
|
||||||
|
rustup --version; \
|
||||||
|
cargo --version; \
|
||||||
|
rustc --version; \
|
||||||
|
rustup target add i686-linux-android; \
|
||||||
|
rustup target add armv7-linux-androideabi; \
|
||||||
|
rustup target add aarch64-linux-android
|
||||||
|
|
||||||
|
RUN set -eux; \
|
||||||
|
rustup install beta; \
|
||||||
|
rustup target add --toolchain beta i686-linux-android; \
|
||||||
|
rustup target add --toolchain beta armv7-linux-androideabi; \
|
||||||
|
rustup target add --toolchain beta aarch64-linux-android
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------------------------------------------------
|
||||||
|
# -- Cleanup ----------------------------------------------------------------------------------------------------------
|
||||||
|
#----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
WORKDIR /build
|
||||||
|
|
||||||
|
RUN apt-get clean
|
|
@ -29,13 +29,14 @@ buildscript {
|
||||||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
|
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
|
||||||
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
|
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
|
||||||
|
|
||||||
classpath 'gradle.plugin.org.mozilla.rust-android-gradle:plugin:0.1.0'
|
classpath 'gradle.plugin.org.mozilla.rust-android-gradle:plugin:0.2.0'
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
|
||||||
// in the individual module build.gradle files
|
|
||||||
|
|
||||||
// Yes, this is unusual. We want to access some host-specific
|
// Yes, this is unusual. We want to access some host-specific
|
||||||
// computation at build time.
|
// computation at build time.
|
||||||
classpath 'net.java.dev.jna:jna:4.5.2'
|
classpath 'net.java.dev.jna:jna:4.5.2'
|
||||||
|
|
||||||
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
// in the individual module build.gradle files
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue