build-webview: Adapt to new split-project structure
* With the new structure, we can wait to clone a specific arch's prebuilt project until/unless we are actually building that arch Change-Id: I9a49766dba81e7bedaa9775b0ab7fd1dbd00866c
This commit is contained in:
committed by
Kevin Haggerty
parent
5cc4c2d6c7
commit
507e4eeb25
@@ -8,6 +8,10 @@ clean=0
|
|||||||
gsync=0
|
gsync=0
|
||||||
supported_archs=(arm arm64 x86 x64)
|
supported_archs=(arm arm64 x86 x64)
|
||||||
|
|
||||||
|
lineage_github=https://github.com/LineageOS
|
||||||
|
lineage_gitlab=https://gitlab.com/LineageOS/android
|
||||||
|
webview_proj_base=android_external_chromium-webview
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage:"
|
echo "Usage:"
|
||||||
echo " build_webview [ options ]"
|
echo " build_webview [ options ]"
|
||||||
@@ -25,6 +29,17 @@ usage() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clone_proj() {
|
||||||
|
depth=""
|
||||||
|
if [ "$#" -eq 3 ]; then
|
||||||
|
depth="--depth $3"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "$2" ]; then
|
||||||
|
git clone $1 $2 $depth
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
build_args=$args' target_cpu="'$1'"'
|
build_args=$args' target_cpu="'$1'"'
|
||||||
|
|
||||||
@@ -43,8 +58,21 @@ build() {
|
|||||||
gn gen "out/$1" --args="$build_args"
|
gn gen "out/$1" --args="$build_args"
|
||||||
ninja -C out/$1 system_webview_apk
|
ninja -C out/$1 system_webview_apk
|
||||||
if [ "$?" -eq 0 ]; then
|
if [ "$?" -eq 0 ]; then
|
||||||
[ "$1" '==' "x64" ] && android_arch="x86_64" || android_arch=$1
|
case $1 in
|
||||||
cp out/$1/apks/SystemWebView.apk ../android_external_chromium-webview/prebuilt/$android_arch/webview.apk
|
x64)
|
||||||
|
android_arch="x86_64"
|
||||||
|
lineage_git=$lineage_gitlab
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
android_arch=$1
|
||||||
|
lineage_git=$lineage_github
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
clone_proj ${lineage_git}/${webview_proj_base}_prebuilt_${android_arch}.git \
|
||||||
|
../${webview_proj_base}/prebuilt/${android_arch} 1
|
||||||
|
|
||||||
|
cp out/$1/apks/SystemWebView.apk ../$webview_proj_base/prebuilt/$android_arch/webview.apk
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,10 +108,9 @@ while getopts ":a:chr:s" opt; do
|
|||||||
done
|
done
|
||||||
shift $((OPTIND-1))
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
# Download android_external_chromium-webview
|
# Download webview patches
|
||||||
if [ ! -d android_external_chromium-webview ]; then
|
clone_proj ${lineage_github}/${webview_proj_base}_patches.git \
|
||||||
git clone https://github.com/LineageOS/android_external_chromium-webview.git --depth 1
|
${webview_proj_base}/patches
|
||||||
fi
|
|
||||||
|
|
||||||
# Add depot_tools to PATH
|
# Add depot_tools to PATH
|
||||||
if [ ! -d depot_tools ]; then
|
if [ ! -d depot_tools ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user