platform_build_soong/python/defaults.go
Wei Li 7d8f6182f9 Fix some issues in bp2build converter for python_binary_host.
1) Bp2build convert python_binary_host main attribute as LabelAttribute. Currently "main" attribute in python_binary_host is handled as string but for some modules (e.g certify_bootimg) the "main" attribute points to a file in its subpackage like "subpackage/file.py" and should be converted to "//.../subpackage:file.py".

2) Filter out duplicated labels in the merged list of "required" attributes of python_binary_host and its defaults.

Test: b build //system/tools/mkbootimg:certify_bootimg
Test: b build //build/make/tools/releasetools:check_target_files_signatures
Bug: 253081249
Bug: 253101186

Change-Id: Ic2cb4cadec2c1348da70af9f0730da9914d3a8ca
2022-10-12 17:43:20 -07:00

45 lines
1.1 KiB
Go

// Copyright 2017 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package python
import (
"android/soong/android"
)
func init() {
android.RegisterModuleType("python_defaults", DefaultsFactory)
}
type Defaults struct {
android.ModuleBase
android.DefaultsModuleBase
}
func (d *Defaults) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
func DefaultsFactory() android.Module {
module := &Defaults{}
module.AddProperties(
&BaseProperties{},
&android.ProtoProperties{},
&BinaryProperties{},
)
android.InitDefaultsModule(module)
return module
}