2020-02-27 23:58:17 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Copyright The ANGLE Project Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
#
|
|
|
|
# Generates a roll CL within the ANGLE repository of AOSP.
|
|
|
|
|
2020-07-08 01:24:55 +03:00
|
|
|
GN_OUTPUT_DIRECTORY=out/Android
|
|
|
|
|
2020-02-27 23:58:17 +03:00
|
|
|
deps=(
|
|
|
|
"third_party/spirv-tools/src"
|
|
|
|
"third_party/glslang/src"
|
|
|
|
"third_party/spirv-headers/src"
|
2020-03-07 00:15:11 +03:00
|
|
|
"third_party/vulkan-headers/src"
|
2020-02-27 23:58:17 +03:00
|
|
|
"third_party/jsoncpp"
|
|
|
|
"third_party/jsoncpp/source"
|
2020-05-08 21:01:29 +03:00
|
|
|
"third_party/vulkan_memory_allocator"
|
2020-06-22 15:52:31 +03:00
|
|
|
"third_party/zlib"
|
|
|
|
)
|
|
|
|
|
|
|
|
# Only add the parts of NDK that are required by ANGLE. The entire dep is too large.
|
|
|
|
delete_only_deps=(
|
|
|
|
"third_party/android_ndk"
|
|
|
|
)
|
|
|
|
|
|
|
|
add_only_deps=(
|
|
|
|
"third_party/android_ndk/sources/android/cpufeatures"
|
2020-02-27 23:58:17 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
# Delete dep directories so that gclient can check them out
|
2020-06-22 15:52:31 +03:00
|
|
|
for dep in ${deps[@]} ${delete_only_deps[@]}; do
|
2020-04-09 19:16:20 +03:00
|
|
|
rm -rf $dep
|
2020-02-27 23:58:17 +03:00
|
|
|
done
|
|
|
|
|
|
|
|
# Sync all of ANGLE's deps so that 'gn gen' works
|
|
|
|
python scripts/bootstrap.py
|
|
|
|
gclient sync -D
|
|
|
|
|
2020-07-08 01:24:55 +03:00
|
|
|
abis=(
|
|
|
|
"arm"
|
|
|
|
"arm64"
|
|
|
|
"x86"
|
|
|
|
"x64"
|
2020-03-06 21:17:19 +03:00
|
|
|
)
|
2020-07-08 01:24:55 +03:00
|
|
|
|
|
|
|
rm -r ${GN_OUTPUT_DIRECTORY}
|
|
|
|
for abi in ${abis[@]}; do
|
|
|
|
# generate gn build files and convert them to blueprints
|
|
|
|
gn_args=(
|
|
|
|
"target_os = \"android\""
|
|
|
|
"is_component_build = false"
|
|
|
|
"is_debug = false"
|
|
|
|
|
|
|
|
# Build for 64-bit CPUs
|
|
|
|
"target_cpu = \"$abi\""
|
|
|
|
|
|
|
|
# Target ndk API 26 to make sure ANGLE can use the Vulkan backend on Android
|
|
|
|
"android32_ndk_api_level = 26"
|
|
|
|
"android64_ndk_api_level = 26"
|
|
|
|
|
|
|
|
# Disable all backends except Vulkan
|
|
|
|
"angle_enable_vulkan = true"
|
|
|
|
"angle_enable_gl = true" # TODO(geofflang): Disable GL once Andrid no longer requires it. anglebug.com/4444
|
|
|
|
"angle_enable_d3d9 = false"
|
|
|
|
"angle_enable_d3d11 = false"
|
|
|
|
"angle_enable_null = false"
|
|
|
|
"angle_enable_metal = false"
|
|
|
|
|
|
|
|
# SwiftShader is loaded as the system Vulkan driver on Android, not compiled by ANGLE
|
|
|
|
"angle_enable_swiftshader = false"
|
|
|
|
|
|
|
|
# Disable all shader translator targets except desktop GL (for Vulkan)
|
|
|
|
"angle_enable_essl = true" # TODO(geofflang): Disable ESSL once Andrid no longer requires it. anglebug.com/4444
|
|
|
|
"angle_enable_glsl = true" # TODO(geofflang): Disable ESSL once Andrid no longer requires it. anglebug.com/4444
|
|
|
|
"angle_enable_hlsl = false"
|
Android: Set angle_enable_commit_id=false in roll_aosp.sh
The current roll_aosp.sh is generating an invalid Android.bp by
including the local repo's .git file:
cc_genrule {
name: "angle_commit_id",
tool_files: [
"src/commit_id.py",
],
cmd: "$(location) gen $(location commit.h)",
srcs: [
".git/refs/heads/rollAngle",
],
sdk_version: "28",
out: [
"commit.h",
],
}
This is fixed by enabling the GN arg 'angle_enable_commit_id=false' in
the script:
cc_genrule {
name: "angle_commit_id",
tool_files: [
"src/commit_id.py",
],
cmd: "$(location) gen $(location commit.h)",
sdk_version: "28",
out: [
"commit.h",
],
}
Bug: angleproject:5050
Test: Manual verification in AOSP checkout
Change-Id: I08a08084c4c25411b29b22544c2ed8c06f6f54d8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2412790
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2020-09-15 23:08:36 +03:00
|
|
|
|
|
|
|
"angle_enable_commit_id = false"
|
2020-07-08 01:24:55 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
gn gen ${GN_OUTPUT_DIRECTORY} --args="${gn_args[*]}"
|
|
|
|
gn desc ${GN_OUTPUT_DIRECTORY} --format=json "*" > ${GN_OUTPUT_DIRECTORY}/desc.$abi.json
|
|
|
|
done
|
|
|
|
|
|
|
|
python scripts/generate_android_bp.py \
|
|
|
|
${GN_OUTPUT_DIRECTORY}/desc.arm.json \
|
|
|
|
${GN_OUTPUT_DIRECTORY}/desc.arm64.json \
|
|
|
|
${GN_OUTPUT_DIRECTORY}/desc.x86.json \
|
|
|
|
${GN_OUTPUT_DIRECTORY}/desc.x64.json > Android.bp
|
|
|
|
|
|
|
|
rm -r ${GN_OUTPUT_DIRECTORY}
|
2020-02-27 23:58:17 +03:00
|
|
|
git add Android.bp
|
|
|
|
|
|
|
|
# Delete the .git files in each dep so that it can be added to this repo. Some deps like jsoncpp
|
|
|
|
# have multiple layers of deps so delete everything before adding them.
|
2020-06-22 15:52:31 +03:00
|
|
|
for dep in ${deps[@]} ${delete_only_deps[@]}; do
|
2020-07-08 01:24:55 +03:00
|
|
|
rm -rf $dep/.git
|
2020-02-27 23:58:17 +03:00
|
|
|
done
|
|
|
|
|
2020-04-09 21:08:09 +03:00
|
|
|
extra_removal_files=(
|
2020-07-08 01:24:55 +03:00
|
|
|
# Some third_party deps have OWNERS files which contains users that have not logged into
|
|
|
|
# the Android gerrit. Repo cannot upload with these files present.
|
|
|
|
"third_party/jsoncpp/OWNERS"
|
|
|
|
"third_party/vulkan_memory_allocator/OWNERS"
|
|
|
|
"third_party/zlib/OWNERS"
|
|
|
|
"third_party/zlib/google/OWNERS"
|
|
|
|
"third_party/zlib/contrib/tests/OWNERS"
|
|
|
|
"third_party/zlib/contrib/bench/OWNERS"
|
|
|
|
"third_party/zlib/contrib/tests/fuzzers/OWNERS"
|
2020-04-09 21:08:09 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
for removal_file in ${extra_removal_files[@]}; do
|
2020-07-08 01:24:55 +03:00
|
|
|
rm $removal_file
|
2020-04-17 19:29:07 +03:00
|
|
|
done
|
|
|
|
|
2020-06-22 15:52:31 +03:00
|
|
|
for dep in ${deps[@]} ${add_only_deps[@]}; do
|
2020-07-08 01:24:55 +03:00
|
|
|
git add -f $dep
|
2020-04-09 21:08:09 +03:00
|
|
|
done
|
|
|
|
|
2020-02-27 23:58:17 +03:00
|
|
|
git commit --amend --no-edit
|