Refactor to support dynamic repositories

This commit is contained in:
FriwiDev
2021-11-16 18:43:50 +01:00
parent 88fea496ce
commit d6e4e569a5
6 changed files with 37 additions and 15 deletions

View File

@@ -1,17 +1,27 @@
#!/bin/bash
set -e
if [ ! $# -eq 2 ]
if [ $# -lt 2 ] || [ $# -eq 3 ]
then
echo "Usage: ./compile_macosx.sh <architecture> <buildType>"
echo "Usage: ./compile_macosx.sh <architecture> <buildType> [<gitrepo> <gitref>]"
echo ""
echo "architecture: the target architecture to build for. Architectures are either amd64 or arm64."
echo "buildType: either Release or Debug"
echo "gitrepo: git repository url to clone"
echo "gitref: the git commit id to pull"
exit 1
fi
TARGETARCH=$1
BUILD_TYPE=$2
if [ $# -lt 4 ]
then
REPO=https://bitbucket.org/chromiumembedded/java-cef.git
REF=master
else
REPO=$3
REF=$4
fi
# Determine architecture
echo "Building for architecture $TARGETARCH"
@@ -19,14 +29,15 @@ echo "Building for architecture $TARGETARCH"
if [ ! -f "jcef/README.md" ]; then
echo "Did not find existing files to build - cloning..."
rm -rf jcef
git clone https://bitbucket.org/chromiumembedded/java-cef.git jcef
git clone ${REPO} jcef
cd jcef
git checkout ${REF}
#No CMakeLists patching required on macos, as we do not add any new platforms
else
echo "Found existing files to build"
cd jcef
fi
# Enter the JCEF source code directory.
cd jcef
# Create and enter the `jcef_build` directory.
# The `jcef_build` directory name is required by other JCEF tooling
# and should not be changed.