Skip to content

Commit

Permalink
Merge branch 'release/1.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
abeimler committed Jan 5, 2023
2 parents 98d667d + 13d074e commit c76a871
Show file tree
Hide file tree
Showing 51 changed files with 1,037 additions and 653 deletions.
24 changes: 14 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,30 @@ ENV CXX "g++"
ENV CMAKE "cmake"
ENV MAKE "make"

# install vcpkg
ENV VCPKG_DISABLE_METRICS 1
RUN git clone --depth 1 https://github.com/Microsoft/vcpkg.git /home/project/vcpkg
RUN /home/project/vcpkg/bootstrap-vcpkg.sh -disableMetrics
ENV VCPKG_ROOT "/home/project/vcpkg"

ENV VCPKG_TOOLCHAIN_FILE "$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
ENV TOOLCHAIN_FILE "$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"


# build script settings
ENV TARGET "all"
ENV BUILD_TYPE "Release"
ENV CMAKE_GENERATOR "Ninja"
ENV CMAKE_ARGS ""


# setup project env
WORKDIR /home/project
COPY ./scripts/docker-build.sh ./docker-build.sh
COPY ./scripts/docker-test.sh ./docker-test.sh
COPY ./scripts/docker-test-coverage.sh ./docker-test-coverage.sh
COPY ./taskfiles/*.yml /home/taskfiles/
COPY ./taskfiles/TaskfileDefault.yml /home/taskfiles/Taskfile.yml

# install vcpkg
ENV VCPKG_DISABLE_METRICS 1
RUN git clone --depth 1 https://github.com/Microsoft/vcpkg.git /home/project/vcpkg
RUN /home/project/vcpkg/bootstrap-vcpkg.sh -disableMetrics
ENV VCPKG_ROOT "/home/project/vcpkg"

ENV VCPKG_TOOLCHAIN_FILE "$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
ENV TOOLCHAIN_FILE "$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"

ENV PROJECT_DIR /home/project
WORKDIR /home/project
RUN mkdir build
69 changes: 43 additions & 26 deletions Dockerfile.android
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,30 @@ RUN pacman-db-upgrade && \
# install android stuff
RUN runuser -l yay -c \
"yay -Syu --noconfirm && yay -S --noconfirm \
jdk-openjdk android-platform android-sdk-build-tools \
android-pkg-config android-cmake android-environment" && \
jdk-openjdk android-platform android-sdk-build-tools android-sdk-cmdline-tools-latest \
android-pkg-config android-cmake android-environment android-ndk" && \
runuser -l yay -c "yay -Scc --noconfirm" && \
rm -rf /home/yay/.cache/* && \
ln -s /opt/android-ndk /opt/android-sdk/ndk-bundle

# setup project env
WORKDIR /home/project
COPY ./scripts/docker-build.android.sh ./docker-build.sh

# install vcpkg
## https://github.com/microsoft/vcpkg/blob/master/docs/users/android.md
ENV VCPKG_DEFAULT_HOST_TRIPLET $vcpkg_host_triplet
ENV VCPKG_DEFAULT_TRIPLET $vcpkg_target_triplet
ENV VCPKG_DISABLE_METRICS 1
RUN git clone --depth 1 https://github.com/Microsoft/vcpkg.git
RUN ./vcpkg/bootstrap-vcpkg.sh -disableMetrics
ENV VCPKG_ROOT "/home/project/vcpkg"
ENV ANDROID_HOME "/opt/android-sdk"
ENV ANDROID_NDK "/opt/android-ndk"
ENV ANDROID_NDK_HOME "/opt/android-ndk"
ENV ANDROID_SDK_ROOT "/opt/android-sdk"
ENV ANDROID_TOOLCHAIN "${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64"
ENV ANDROID_PLATFORM_TOOLS "${ANDROID_HOME}/platform-tools"
ENV ANDROID_BUILD_TOOLS "${ANDROID_HOME}/build-tools/${ANDROID_BUILD_TOOLS_REVISION}"
ENV PATH="${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${PATH}"

ARG setup_env_script="android-env"
ARG setup_env_script_args="$android_abi"
ENV SETUP_ENV_SCRIPT $setup_env_script
ENV SETUP_ENV_SCRIPT_ARGS $setup_env_script_args
RUN echo 'source "$SETUP_ENV_SCRIPT $SETUP_ENV_SCRIPT_ARGS"' >> /root/.bash_profile
RUN . $setup_env_script $setup_env_script_args
RUN . /etc/profile.d/android-ndk.sh


# cross compiler settings
ENV CC $cc
Expand All @@ -54,29 +60,40 @@ ENV ANDROID_ABI $android_abi
ENV TARGET_TRIPLET $vcpkg_target_triplet
ENV CROSS_CMAKE $cmake
ENV CROSS_MAKE $make
ENV ANDROID_HOME "/opt/android-sdk"
ENV ANDROID_NDK_HOME "/opt/android-ndk"
ENV ANDROID_TOOLCHAIN "${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64"
ENV ANDROID_TOOLCHAIN_FILE "${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake"
ENV ANDROID_PLATFORM_TOOLS "${ANDROID_HOME}/platform-tools"
ARG cmake_toolchain_file="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake"
ENV CROSS_TOOLCHAIN "${ANDROID_TOOLCHAIN_FILE}"
ENV ANDROID_BUILD_TOOLS "${ANDROID_HOME}/build-tools/$ANDROID_BUILD_TOOLS_REVISION"

ARG setup_env_script="android-env $android_abi"
ENV SETUP_ENV_SCRIPT $setup_env_script
RUN . $setup_env_script

ENV CMAKE $CROSS_CMAKE
ENV MAKE $CROSS_MAKE

# install vcpkg
## https://github.com/microsoft/vcpkg/blob/master/docs/users/android.md
ENV VCPKG_DEFAULT_HOST_TRIPLET $vcpkg_host_triplet
ENV VCPKG_DEFAULT_TRIPLET $vcpkg_target_triplet
ENV VCPKG_DISABLE_METRICS 1
RUN git clone --depth 1 https://github.com/Microsoft/vcpkg.git
RUN ./vcpkg/bootstrap-vcpkg.sh -disableMetrics
ENV VCPKG_ROOT "/home/project/vcpkg"

ENV ANDROID_TOOLCHAIN_FILE "${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake"
ARG cmake_toolchain_file="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake"
ENV CROSS_TOOLCHAIN "${cmake_toolchain_file}"


# build script settings
ENV TARGET "all"
ENV BUILD_TYPE "Release"
ENV CMAKE_GENERATOR $cmake_generator
ENV VCPKG_TOOLCHAIN_FILE "/home/project/vcpkg/scripts/buildsystems/vcpkg.cmake"
ENV TOOLCHAIN_FILE "/home/project/vcpkg/scripts/buildsystems/vcpkg.cmake"
ENV CHAINLOAD_TOOLCHAIN_FILE $cmake_toolchain_file
ENV CHAINLOAD_TOOLCHAIN_FILE $CROSS_TOOLCHAIN
ENV CROSS_CMAKE_ARGS -DANDROID_ABI="$ANDROID_ABI"
ENV CMAKE_ARGS ""

# setup project env
WORKDIR /home/project
COPY ./scripts/docker-build.android.sh ./docker-build.sh
COPY ./taskfiles/*.yml /home/taskfiles/
COPY ./taskfiles/TaskfileCross.yml /home/taskfiles/Taskfile.yml

ENV PROJECT_DIR /home/project
WORKDIR /home/project
RUN mkdir build
62 changes: 38 additions & 24 deletions Dockerfile.android-v
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ARG processor="x86_64"
ARG vcpkg_target_triplet="arm-android"
ARG android_abi="armeabi-v7a"
ARG android_target="30"
ARG android_ndk_version=""

ARG cmake="android-${android_abi}-cmake"
ARG cmake_generator="Ninja"
Expand All @@ -34,54 +35,67 @@ RUN pacman-db-upgrade && \
RUN runuser -l yay -c \
"yay -Syu --noconfirm && yay -S --noconfirm \
jdk-openjdk android-platform-${android_target} android-sdk-build-tools-${android_target} \
android-pkg-config android-cmake android-environment" && \
android-pkg-config android-cmake android-environment android-ndk${android_ndk_version}" && \
runuser -l yay -c "yay -Scc --noconfirm" && \
rm -rf /home/yay/.cache/*

# setup project env
WORKDIR /home/project
COPY ./scripts/docker-build.android.sh ./docker-build.sh

# install vcpkg
## https://github.com/microsoft/vcpkg/blob/master/docs/users/android.md
ENV VCPKG_DEFAULT_HOST_TRIPLET $vcpkg_host_triplet
ENV VCPKG_DEFAULT_TRIPLET $vcpkg_target_triplet
ENV VCPKG_DISABLE_METRICS 1
RUN git clone --depth 1 https://github.com/Microsoft/vcpkg.git
RUN ./vcpkg/bootstrap-vcpkg.sh -disableMetrics
ENV VCPKG_ROOT "/home/project/vcpkg"

# cross compiler settings
ENV CC $cc
ENV CXX $cxx
ENV PROCESSOR $processor
ENV ANDROID_ABI $android_abi
ENV TARGET_TRIPLET $vcpkg_target_triplet
ENV CROSS_CMAKE $cmake
ENV CROSS_MAKE $make
ENV ANDROID_HOME "/opt/android-sdk"
ENV ANDROID_NDK "/opt/android-ndk"
ENV ANDROID_NDK_HOME "/opt/android-ndk"
ENV ANDROID_SDK_ROOT "/opt/android-sdk"
ENV ANDROID_TOOLCHAIN "${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64"
ENV ANDROID_TOOLCHAIN_FILE "${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake"
ENV ANDROID_PLATFORM_TOOLS "${ANDROID_HOME}/platform-tools"
ARG cmake_toolchain_file="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake"
ENV CROSS_TOOLCHAIN "${ANDROID_TOOLCHAIN_FILE}"

ARG setup_env_script="android-env $android_abi"
ARG setup_env_script="android-env"
ARG setup_env_script_args="$android_abi"
ENV SETUP_ENV_SCRIPT $setup_env_script
RUN . $setup_env_script
ENV SETUP_ENV_SCRIPT_ARGS $setup_env_script_args
RUN echo 'source "$SETUP_ENV_SCRIPT $SETUP_ENV_SCRIPT_ARGS"' >> /root/.bash_profile
RUN . $setup_env_script $setup_env_script_args
RUN . /etc/profile.d/android-ndk.sh

# cross compiler settings
ENV CC $cc
ENV CXX $cxx
ENV PROCESSOR $processor
ENV ANDROID_ABI $android_abi
ENV TARGET_TRIPLET $vcpkg_target_triplet
ENV CROSS_CMAKE $cmake
ENV CROSS_MAKE $make

ENV CMAKE $CROSS_CMAKE
ENV MAKE $CROSS_MAKE

# install vcpkg
## https://github.com/microsoft/vcpkg/blob/master/docs/users/android.md
ENV VCPKG_DEFAULT_HOST_TRIPLET $vcpkg_host_triplet
ENV VCPKG_DEFAULT_TRIPLET $vcpkg_target_triplet
ENV VCPKG_DISABLE_METRICS 1
RUN git clone --depth 1 https://github.com/Microsoft/vcpkg.git
RUN ./vcpkg/bootstrap-vcpkg.sh -disableMetrics
ENV VCPKG_ROOT "/home/project/vcpkg"


# build script settings
ENV TARGET "all"
ENV BUILD_TYPE "Release"
ENV CMAKE_GENERATOR $cmake_generator
ENV VCPKG_TOOLCHAIN_FILE "/home/project/vcpkg/scripts/buildsystems/vcpkg.cmake"
ENV TOOLCHAIN_FILE "/home/project/vcpkg/scripts/buildsystems/vcpkg.cmake"
ENV CHAINLOAD_TOOLCHAIN_FILE $cmake_toolchain_file
ENV CHAINLOAD_TOOLCHAIN_FILE $ANDROID_TOOLCHAIN_FILE
ENV CROSS_CMAKE_ARGS -DANDROID_ABI="$ANDROID_ABI"
ENV CMAKE_ARGS ""

# setup project env
WORKDIR /home/project
COPY ./scripts/docker-build.android.sh ./docker-build.sh
COPY ./taskfiles/*.yml /home/taskfiles/
COPY ./taskfiles/TaskfileCross.yml /home/taskfiles/Taskfile.yml

ENV PROJECT_DIR /home/project
WORKDIR /home/project
RUN mkdir build
5 changes: 5 additions & 0 deletions Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ RUN runuser -l yay -c \
runuser -l yay -c "yay -Scc --noconfirm" && \
rm -rf /home/yay/.cache/*

# install task
ADD https://taskfile.dev/install.sh /tmp/taskfile_install.sh
RUN chmod +x /tmp/taskfile_install.sh
RUN /tmp/taskfile_install.sh -d -b /usr/local/bin && rm /tmp/taskfile_install.sh

# Install conan
RUN python -m pip install --upgrade pip setuptools && \
python -m pip install conan && \
Expand Down
54 changes: 32 additions & 22 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt-get update -yqq && \
valgrind gcovr linux-tools-common linux-tools-generic google-perftools \
neovim emacs nano && \
apt-get clean && rm -rf /var/lib/apt/lists/*
#bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
#ADD https://apt.llvm.org/llvm.sh /tmp/llvm.sh

# Install conan
RUN python3 -m pip install --upgrade pip setuptools && \
Expand All @@ -32,6 +32,12 @@ RUN python3 -m pip install --upgrade pip setuptools && \
RUN python3 -m pip install --upgrade pip setuptools && \
python3 -m pip install cogapp coverage cmake-format cmakelint

# install task
ADD https://taskfile.dev/install.sh /tmp/taskfile_install.sh
RUN chmod +x /tmp/taskfile_install.sh
RUN /tmp/taskfile_install.sh -d -b /usr/local/bin && rm /tmp/taskfile_install.sh


# thx to https://github.com/lefticus/cpp_starter_project/pull/121

# By default, anything you run in Docker is done as superuser.
Expand Down Expand Up @@ -67,18 +73,10 @@ RUN apt-get update -y && \
curl gnupg coreutils && \
apt-get clean && rm -rf /var/lib/apt/lists/*


# set default compiler
ENV CC "gcc"
ENV CXX "g++"
ENV CMAKE "cmake"
ENV MAKE "ninja"

# build script settings
ENV TARGET "all"
ENV BUILD_TYPE "Release"
ENV CMAKE_GENERATOR "Ninja"
ENV CMAKE_ARGS ""
# install task
ADD https://taskfile.dev/install.sh /tmp/taskfile_install.sh
RUN chmod +x /tmp/taskfile_install.sh
RUN /tmp/taskfile_install.sh -d -b /usr/local/bin && rm /tmp/taskfile_install.sh

# install CodeCov
WORKDIR /home/codecov
Expand All @@ -91,11 +89,12 @@ RUN shasum -a 256 -c codecov.SHA256SUM
RUN chmod +x codecov
ENV CODECOV "/home/codecov/codecov"

# setup project env
WORKDIR /home/project
COPY ./scripts/docker-build.sh ./docker-build.sh
COPY ./scripts/docker-test.sh ./docker-test.sh
COPY ./scripts/docker-test-coverage.sh ./docker-test-coverage.sh

# set default compiler
ENV CC "gcc"
ENV CXX "g++"
ENV CMAKE "cmake"
ENV MAKE "ninja"

# install vcpkg
ENV VCPKG_DISABLE_METRICS 1
Expand All @@ -106,10 +105,21 @@ ENV VCPKG_ROOT "/home/project/vcpkg"
ENV VCPKG_TOOLCHAIN_FILE "$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
ENV TOOLCHAIN_FILE "$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"


# build script settings
ENV TARGET "all"
ENV BUILD_TYPE "Release"
ENV CMAKE_GENERATOR "Ninja"
ENV CMAKE_ARGS ""

# setup project env
WORKDIR /home/project
COPY ./scripts/docker-build.sh ./docker-build.sh
COPY ./scripts/docker-test.sh ./docker-test.sh
COPY ./scripts/docker-test-coverage.sh ./docker-test-coverage.sh
COPY ./taskfiles/*.yml /home/taskfiles/
COPY ./taskfiles/TaskfileDefault.yml /home/taskfiles/Taskfile.yml

ENV PROJECT_DIR /home/project
WORKDIR /home/project
RUN mkdir build

COPY ./scripts/docker-entrypoint.ci.sh /docker-entrypoint.sh
ENTRYPOINT ["/bin/bash", "-c", "/docker-entrypoint.sh"]
CMD ["/bin/bash"]
Loading

0 comments on commit c76a871

Please sign in to comment.