mirror of
				https://github.com/jcefmaven/jcefbuild.git
				synced 2025-11-04 16:33:40 +08:00 
			
		
		
		
	Fix rmdir error
This commit is contained in:
		@@ -4,7 +4,7 @@ if [ ! $# -eq 2 ]
 | 
			
		||||
  then
 | 
			
		||||
    echo "Usage: ./compile_linux.sh <architecture> <buildType>"
 | 
			
		||||
    echo ""
 | 
			
		||||
    echo "architecture: the target architecture to build for. Architectures are the docker architectures (e.g. 386 or amd64)."
 | 
			
		||||
    echo "architecture: the target architecture to build for. Architectures are either 386 or amd64."
 | 
			
		||||
    echo "buildType: either Release or Debug"
 | 
			
		||||
    exit 1
 | 
			
		||||
fi
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										52
									
								
								compile_macosx.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										52
									
								
								compile_macosx.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,52 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
set -e
 | 
			
		||||
 | 
			
		||||
if [ ! $# -eq 2 ]
 | 
			
		||||
  then
 | 
			
		||||
    echo "Usage: ./compile_macosx.sh <architecture> <buildType>"
 | 
			
		||||
    echo ""
 | 
			
		||||
    echo "architecture: the target architecture to build for. Architectures are either amd64 or arm64."
 | 
			
		||||
    echo "buildType: either Release or Debug"
 | 
			
		||||
    exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
TARGETARCH=$1
 | 
			
		||||
BUILD_TYPE=$2
 | 
			
		||||
 | 
			
		||||
# Determine architecture
 | 
			
		||||
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
 | 
			
		||||
else
 | 
			
		||||
    echo "Found existing files to build"
 | 
			
		||||
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.
 | 
			
		||||
mkdir jcef_build && cd jcef_build
 | 
			
		||||
 | 
			
		||||
# MacOS: Generate amd64/arm64 Makefiles.
 | 
			
		||||
if [ ${TARGETARCH} == 'amd64' ]; then
 | 
			
		||||
    cmake -G "Ninja" -DPROJECT_ARCH="x86_64" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..
 | 
			
		||||
else
 | 
			
		||||
    cmake -G "Ninja" -DPROJECT_ARCH="arm64" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..
 | 
			
		||||
fi
 | 
			
		||||
# Build native part using ninja.
 | 
			
		||||
ninja -j4
 | 
			
		||||
 | 
			
		||||
#Generate distribution
 | 
			
		||||
cd ../tools
 | 
			
		||||
chmod +x make_distrib.sh
 | 
			
		||||
./make_distrib.sh macosx64
 | 
			
		||||
 | 
			
		||||
#Pack binary_distrib
 | 
			
		||||
cd ../binary_distrib/macosx64
 | 
			
		||||
mkdir ../../out
 | 
			
		||||
tar -czvf ../../out/binary_distrib.tar.gz *
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
if ("%2"=="") ( ^ 
 | 
			
		||||
    echo "Usage: compile_windows.bat <architecture> <buildType>" && ^ 
 | 
			
		||||
    echo "" && ^ 
 | 
			
		||||
    echo "architecture: the target architecture to build for. Architectures are the docker architectures (e.g. 386 or amd64)." && ^ 
 | 
			
		||||
    echo "architecture: the target architecture to build for. Architectures are either 386 or amd64." && ^ 
 | 
			
		||||
    echo "buildType: either Release or Debug" && ^ 
 | 
			
		||||
    exit 1 ^ 
 | 
			
		||||
)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
@echo off
 | 
			
		||||
@echo on
 | 
			
		||||
 | 
			
		||||
if "%TARGETARCH%"=="386" (echo "Building 32-bit version") ^
 | 
			
		||||
else (echo "Building 64-bit version")
 | 
			
		||||
@@ -6,7 +6,9 @@ else (echo "Building 64-bit version")
 | 
			
		||||
#Check residency of workdir
 | 
			
		||||
cd C:
 | 
			
		||||
if exist "jcef\README.md" (echo "Found existing files to build") ^
 | 
			
		||||
else (echo "Did not find files to build - cloning..." && rmdir /S /Q jcef && git clone https://bitbucket.org/chromiumembedded/java-cef jcef)
 | 
			
		||||
else (echo "Did not find files to build - cloning..." && GOTO :CLONE)
 | 
			
		||||
 | 
			
		||||
:BUILD
 | 
			
		||||
cd jcef
 | 
			
		||||
 | 
			
		||||
#Prepare build dir
 | 
			
		||||
@@ -31,3 +33,10 @@ if "%TARGETARCH%"=="386" (make_distrib.bat win32) else (make_distrib.bat win64)
 | 
			
		||||
if "%TARGETARCH%"=="386" (cd ../binary_distrib/win32) else (cd ../binary_distrib/win64)
 | 
			
		||||
del /F C:\out\binary_distrib.tar.gz
 | 
			
		||||
tar -czvf C:\out\binary_distrib.tar.gz *
 | 
			
		||||
 | 
			
		||||
GOTO :EOF
 | 
			
		||||
 | 
			
		||||
:CLONE
 | 
			
		||||
if exist jcef rmdir /S /Q jcef
 | 
			
		||||
git clone https://bitbucket.org/chromiumembedded/java-cef jcef
 | 
			
		||||
GOTO :BUILD
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user