From b5efaf661c85f17af202d38e18769771f528a6bf Mon Sep 17 00:00:00 2001 From: Michael Keller Date: Mon, 8 Jan 2024 07:51:43 +1300 Subject: [PATCH] CICD: Improve Location of Scripts for the Android Build Environment. Move around the scripts required for the setup of the build environment for android to satisfy docker's requirement of locality. This allows the removal of an extra copy step, and avoids the creation of extra artefacts, while still providing the same functionality. Signed-off-by: Michael Keller --- .github/workflows/android-dockerimage.yml | 7 ------- .gitignore | 2 -- packaging/android/README.md | 2 +- packaging/android/qmake-build.sh | 4 ++-- .../android-build-container}/android-build-setup.sh | 0 scripts/docker/android-build-container/setup-docker.sh | 8 -------- .../docker/android-build-container}/variables.sh | 0 scripts/get-dep-lib.sh | 2 +- 8 files changed, 4 insertions(+), 21 deletions(-) rename {packaging/android => scripts/docker/android-build-container}/android-build-setup.sh (100%) rename {packaging/android => scripts/docker/android-build-container}/variables.sh (100%) diff --git a/.github/workflows/android-dockerimage.yml b/.github/workflows/android-dockerimage.yml index 2b924cb38..8aef225a2 100644 --- a/.github/workflows/android-dockerimage.yml +++ b/.github/workflows/android-dockerimage.yml @@ -5,8 +5,6 @@ on: paths: - scripts/docker/android-build-container - .github/workflows/android-docker* - - packaging/android/android-build-setup.sh - - packaging/android/variables.sh jobs: android-build-container: @@ -17,11 +15,6 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Get our pre-reqs - run: | - cd scripts/docker/android-build-container - bash setup-docker.sh -no-docker-build - - name: Build the name for the docker image id: build_name run: | diff --git a/.gitignore b/.gitignore index 243b8aa55..b22414b26 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,4 @@ packaging/ios/Info.plist packaging/ios/Qt packaging/ios/asset_catalog_compiler.Info.plist appdata/subsurface.appdata.xml -scripts/docker/android-build-container/android-build-setup.sh -scripts/docker/android-build-container/variables.sh android-mobile/Roboto-Regular.ttf diff --git a/packaging/android/README.md b/packaging/android/README.md index 41a6d258f..e8b3ebd0e 100644 --- a/packaging/android/README.md +++ b/packaging/android/README.md @@ -85,7 +85,7 @@ unzip commandlinetools-linux-*.zip git clone https://github.com/subsurface/subsurface # now get the SDK, NDK, Qt, everything that's needed -bash /android/subsurface/packaging/android/android-build-setup.sh +bash /android/subsurface/scripts/docker/android-build-container/android-build-setup.sh ``` Once this has completed, you should have a working build environment. diff --git a/packaging/android/qmake-build.sh b/packaging/android/qmake-build.sh index c7767faee..d732b1390 100755 --- a/packaging/android/qmake-build.sh +++ b/packaging/android/qmake-build.sh @@ -4,7 +4,7 @@ # # this requires Qt5.14 or newer with matching NDK # -# the packaging/android/android-build-setup.sh sets up an environment that works for this +# the scripts/docker/android-build-container/android-build-setup.sh sets up an environment that works for this set -eu @@ -22,7 +22,7 @@ popd BUILD_TYPE=Debug # Read build variables -source $SUBSURFACE_SOURCE/packaging/android/variables.sh +source $SUBSURFACE_SOURCE/scripts/docker/android-build-container/variables.sh # this assumes that the Subsurface source directory is in the same # directory hierarchy as the SDK and NDK diff --git a/packaging/android/android-build-setup.sh b/scripts/docker/android-build-container/android-build-setup.sh similarity index 100% rename from packaging/android/android-build-setup.sh rename to scripts/docker/android-build-container/android-build-setup.sh diff --git a/scripts/docker/android-build-container/setup-docker.sh b/scripts/docker/android-build-container/setup-docker.sh index 5ce99cb28..4f8071c7d 100755 --- a/scripts/docker/android-build-container/setup-docker.sh +++ b/scripts/docker/android-build-container/setup-docker.sh @@ -12,13 +12,5 @@ # If this fails, go to https://developer.android.com/studio#cmdline-tools and # click through for yourself, and then update the URL in the Dockerfile -# copy the dependency script into this folder -cp ../../../packaging/android/android-build-setup.sh . -cp ../../../packaging/android/variables.sh . - -if [ "$1X" == "-no-docker-buildX" ]; then - exit 0 -fi - # create the container (this takes a while) docker build -t android-build . diff --git a/packaging/android/variables.sh b/scripts/docker/android-build-container/variables.sh similarity index 100% rename from packaging/android/variables.sh rename to scripts/docker/android-build-container/variables.sh diff --git a/scripts/get-dep-lib.sh b/scripts/get-dep-lib.sh index 927c212a5..f46ee49a3 100755 --- a/scripts/get-dep-lib.sh +++ b/scripts/get-dep-lib.sh @@ -104,7 +104,7 @@ fi # FIX FOR ANDROID, if [ "$PLATFORM" == "singleAndroid" ] ; then CURRENT_OPENSSL="OpenSSL_1_1_1m" -# If changing the openSSL version here, make sure to change it in packaging/android/variables.sh also. +# If changing the openSSL version here, make sure to change it in scripts/docker/android-build-container/variables.sh also. fi # no curl and old libs (never version breaks) # check whether to use curl or wget