首页 > 解决方案 > 无论如何要控制 Soong 何时选择 Android.bp 何时不选择?

问题描述

使用新的构建系统,即"Soong"Android 替换Android.mkAndroid.bp. 此外,Android Q 以后,无论文件在哪里,Soong都会选择所有文件。Android.bp早些时候,对于 2 级和 3 级模块,它不会拾取 Android.bp 文件,除非"optional_dirs". 现在这也已被弃用。引用 android 源代码的platform/build/soong/root.bp

// Soong finds all Android.bp and Blueprints files in the source tree,
// subdirs= and optional_subdirs= are obsolete and this file no longer
// needs a list of the top level directories that may contain Android.bp
// files.

我查看了Soongapi 并发现了一个叫做"visibility"的东西,我们可以使用它来将包设为私有、公共或隐藏;但无论哪种方式,它都不会停止Soong挑选包裹的Android.bp. 现在似乎没有办法说不为特定目标或任何目标Soong选择特定文件。Android.bp

只是为了清楚地提出问题,我应该能够根据构建时选择的目标来选择和取消选择任何包的 Android.bp 。对此的任何帮助都会很棒。

标签: androidgoandroid-source

解决方案


推荐阅读