Merge "Add binary properties to python_defaults and add modern_python_path_defaults" am: 60644f9cb0

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2232627

Change-Id: Ib31d3536c52fc3941ca49908e41534d539d9b12c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Cole Faust
2022-09-27 00:10:26 +00:00
committed by Automerger Merge Worker
3 changed files with 15 additions and 7 deletions

View File

@@ -27,3 +27,15 @@ bootstrap_go_package {
],
pluginFor: ["soong_build"],
}
// We're transitioning all of these flags to be true by default.
// This is a defaults flag that can be used to easily add all of them to
// certain modules.
python_defaults {
name: "modern_python_path_defaults",
dont_add_top_level_directories_to_path: true,
dont_add_entrypoint_folder_to_path: true,
proto: {
respect_pkg_path: true,
},
}

View File

@@ -31,15 +31,12 @@ func (d *Defaults) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
func defaultsFactory() android.Module {
return DefaultsFactory()
}
func DefaultsFactory(props ...interface{}) android.Module {
module := &Defaults{}
module.AddProperties(props...)
module.AddProperties(
&BaseProperties{},
&android.ProtoProperties{},
&BinaryProperties{},
)
android.InitDefaultsModule(module)

View File

@@ -5,8 +5,7 @@ python_test_host {
"mypkg/main.py",
"mypkg/mymodule.py",
],
dont_add_entrypoint_folder_to_path: true,
dont_add_top_level_directories_to_path: true,
defaults: ["modern_python_path_defaults"],
}
python_test_host {