Wei Li | 0d72311 | 2024-01-02 17:56:51 -0800 | [diff] [blame] | 1 | // Copyright 2024 Google Inc. All rights reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package build |
| 16 | |
| 17 | import ( |
| 18 | "strings" |
| 19 | |
| 20 | "android/soong/android" |
| 21 | ) |
| 22 | |
| 23 | var androidmk_denylist []string = []string{ |
| 24 | "chained_build_config/", |
| 25 | "cts/", |
| 26 | "dalvik/", |
| 27 | "developers/", |
Wei Li | a292446 | 2024-01-11 12:04:40 -0800 | [diff] [blame^] | 28 | // Do not block other directories in kernel/, see b/319658303. |
| 29 | "kernel/configs/", |
| 30 | "kernel/prebuilts/", |
| 31 | "kernel/tests/", |
Wei Li | 0d72311 | 2024-01-02 17:56:51 -0800 | [diff] [blame] | 32 | "libcore/", |
| 33 | "libnativehelper/", |
| 34 | "pdk/", |
| 35 | "toolchain/", |
| 36 | } |
| 37 | |
| 38 | func blockAndroidMks(androidMks []string) []string { |
| 39 | return android.FilterListPred(androidMks, func(s string) bool { |
| 40 | for _, d := range androidmk_denylist { |
| 41 | if strings.HasPrefix(s, d) { |
| 42 | return false |
| 43 | } |
| 44 | } |
| 45 | return true |
| 46 | }) |
| 47 | } |