diff --git a/DockerfileLinux b/DockerfileLinux index 7da81c7..f57c4b1 100644 --- a/DockerfileLinux +++ b/DockerfileLinux @@ -3,7 +3,7 @@ FROM friwidev/jcefdocker:linux-latest AS stage #Declare build type argument (Release or Debug) ARG BUILD_TYPE -#Declare architecture argument (386 or amd64) +#Declare architecture argument (arm64, arm/v7, 386 or amd64) ARG TARGETARCH #Declare git args diff --git a/compile_linux.sh b/compile_linux.sh index b47fbdc..418b2e5 100755 --- a/compile_linux.sh +++ b/compile_linux.sh @@ -4,7 +4,7 @@ if [ $# -lt 2 ] || [ $# -eq 3 ] then echo "Usage: ./compile_linux.sh [ ]" echo "" - echo "architecture: the target architecture to build for. Architectures are either 386 or amd64." + echo "architecture: the target architecture to build for. Architectures are either arm64, arm/v7, 386 or amd64." echo "buildType: either Release or Debug" echo "gitrepo: git repository url to clone" echo "gitref: the git commit id to pull" diff --git a/compile_macosx.sh b/compile_macosx.sh index c2dac4d..10fcfcb 100755 --- a/compile_macosx.sh +++ b/compile_macosx.sh @@ -1,17 +1,27 @@ #!/bin/bash set -e -if [ ! $# -eq 2 ] +if [ $# -lt 2 ] || [ $# -eq 3 ] then - echo "Usage: ./compile_macosx.sh " + echo "Usage: ./compile_macosx.sh [ ]" 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. diff --git a/compile_windows.bat b/compile_windows.bat index 2f988b8..83f9925 100755 --- a/compile_windows.bat +++ b/compile_windows.bat @@ -1,13 +1,21 @@ @echo off if ("%2"=="") ( ^ - echo "Usage: compile_windows.bat " && ^ + echo "Usage: compile_windows.bat [ ]" && ^ echo "" && ^ - echo "architecture: the target architecture to build for. Architectures are either 386 or amd64." && ^ + echo "architecture: the target architecture to build for. Architectures are either arm64, 386 or amd64." && ^ echo "buildType: either Release or Debug" && ^ + echo "gitrepo: git repository url to clone" && ^ + echo "gitref: the git commit id to pull" && ^ exit 1 ^ ) +::Determine repository and ref to pull from +if ("%3"=="") (set "REPO=https://bitbucket.org/chromiumembedded/java-cef.git") ^ +else (set "REPO=%3") +if ("%4"=="") (set "REF=master") ^ +else (set "REF=%4") + :: Execute build with windows Dockerfile docker build -t jcefbuild --file DockerfileWindows . @@ -15,5 +23,5 @@ docker build -t jcefbuild --file DockerfileWindows . if not exist "jcef" mkdir "jcef" rmdir /S /Q out mkdir "out" -docker run --name jcefbuild -v jcef:"C:\jcef" -e TARGETARCH=%1 -e BUILD_TYPE=%2 jcefbuild +docker run --name jcefbuild -v jcef:"C:\jcef" -e TARGETARCH=%1 -e BUILD_TYPE=%2 -e REPO=%REPO% -e REF=%REF% jcefbuild docker cp jcefbuild:/out/binary_distrib.tar.gz out/binary_distrib.tar.gz diff --git a/scripts/run_linux.sh b/scripts/run_linux.sh index 3488a00..7e7118d 100644 --- a/scripts/run_linux.sh +++ b/scripts/run_linux.sh @@ -15,6 +15,7 @@ if [ ! -f "/jcef/README.md" ]; then git clone ${REPO} /jcef cd /jcef git checkout ${REF} + #Temporary CMakeLists patching - beautify in the future rm CMakeLists.txt curl -o CMakeLists.txt https://raw.githubusercontent.com/jcefmaven/jcefbuild/master/CMakeLists.txt else diff --git a/scripts/run_windows.bat b/scripts/run_windows.bat index 6284a79..d858edc 100644 --- a/scripts/run_windows.bat +++ b/scripts/run_windows.bat @@ -8,12 +8,12 @@ certutil -generateSSTFromWU roots.sst && certutil -addstore -f root roots.sst && :: Check residency of workdir cd .. -if exist "jcef\README.md" (echo "Found existing files to build") ^ +if exist "jcef\README.md" (echo "Found existing files to build" && cd jcef) ^ else (echo "Did not find files to build - cloning..." && GOTO :CLONE) :BUILD -cd jcef -rm CMakeLists.txt +:: Temporary CMakeLists patching - beautify in the future +del /f CMakeLists.txt curl -o CMakeLists.txt https://raw.githubusercontent.com/jcefmaven/jcefbuild/master/CMakeLists.txt :: Prepare build dir @@ -51,5 +51,7 @@ GOTO :EOF :CLONE if exist jcef rmdir /S /Q jcef -git clone https://bitbucket.org/chromiumembedded/java-cef jcef +git clone %REPO% jcef +cd jcef +git checkout %REF% GOTO :BUILD