1#!/bin/bash 2 3# Copyright The ANGLE Project Authors. All rights reserved. 4# Use of this source code is governed by a BSD-style license that can be 5# found in the LICENSE file. 6# 7# Generates a roll CL within the ANGLE repository of AOSP. 8 9deps=( 10 "third_party/spirv-tools/src" 11 "third_party/glslang/src" 12 "third_party/spirv-headers/src" 13 "third_party/vulkan-headers/src" 14 "third_party/jsoncpp" 15 "third_party/jsoncpp/source" 16 "third_party/vulkan_memory_allocator" 17) 18 19# Delete dep directories so that gclient can check them out 20for dep in ${deps[@]}; do 21 rm -rf $dep 22done 23 24# Sync all of ANGLE's deps so that 'gn gen' works 25python scripts/bootstrap.py 26gclient sync -D 27 28# generate gn build files and convert them to blueprints 29gn_args=( 30 "target_os = \"android\"" 31 "is_component_build = false" 32 "is_debug = false" 33 34 # Build for 64-bit CPUs 35 "target_cpu = \"arm64\"" 36 37 # Don't make a dependency on .git/HEAD. Some Android builds are done without .git folders 38 # present. 39 "angle_enable_commit_id = false" 40 41 # Target ndk API 26 to make sure ANGLE can use the Vulkan backend on Android 42 "android32_ndk_api_level = 26" 43 "android64_ndk_api_level = 26" 44 45 # Disable all backends except Vulkan 46 "angle_enable_vulkan = true" 47 "angle_enable_gl = true" # TODO(geofflang): Disable GL once Andrid no longer requires it. anglebug.com/4444 48 "angle_enable_d3d9 = false" 49 "angle_enable_d3d11 = false" 50 "angle_enable_null = false" 51 "angle_enable_metal = false" 52 53 # SwiftShader is loaded as the system Vulkan driver on Android, not compiled by ANGLE 54 "angle_enable_swiftshader = false" 55 56 # Disable all shader translator targets except desktop GL (for Vulkan) 57 "angle_enable_essl = true" # TODO(geofflang): Disable ESSL once Andrid no longer requires it. anglebug.com/4444 58 "angle_enable_glsl = true" # TODO(geofflang): Disable ESSL once Andrid no longer requires it. anglebug.com/4444 59 "angle_enable_hlsl = false" 60) 61gn gen out/Android --args="${gn_args[*]}" 62gn desc out/Android --format=json "*" > out/Android/desc.json 63python scripts/generate_android_bp.py out/Android/desc.json > Android.bp 64rm -r out 65git add Android.bp 66 67# Delete the .git files in each dep so that it can be added to this repo. Some deps like jsoncpp 68# have multiple layers of deps so delete everything before adding them. 69for dep in ${deps[@]}; do 70 rm -rf $dep/.git 71done 72 73extra_removal_files=( 74 # The jsoncpp OWNERS and VulkanMemoryAllocator file contains users that have not logged into 75 # the Android gerrit so it fails to upload. 76 "third_party/jsoncpp/OWNERS" 77 "third_party/vulkan_memory_allocator/OWNERS" 78) 79 80for removal_file in ${extra_removal_files[@]}; do 81 rm $removal_file 82done 83 84for dep in ${deps[@]}; do 85 git add -f $dep 86done 87 88git commit --amend --no-edit 89