问题
With new build system i.e. "Soong"
, Android replaced Android.mk
with Android.bp
. Also Android Q onward, Soong
will pick all Android.bp
files no matter where all are present. Earlier, For 2 level and 3 level modules, it was not picking up Android.bp file unless instructed by "optional_dirs"
. Now this too has been deprecated. Quoting from android source code's 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.
I looked into Soong
api and found something called "visibility", using which we can make a package private or public or hidden; but either way it won't stop Soong
to pick a package's Android.bp
. Now there seems no way to say Soong
not to pick a specific Android.bp
file for a particular target or for any of the target.
Just to put the question clearly, I should be able to pick and unpick any package's Android.bp based on the target selected at build time. Any help on this would be great.
来源:https://stackoverflow.com/questions/59980476/anyway-to-control-soong-when-to-pick-android-bp-and-when-not