summaryrefslogtreecommitdiff
path: root/android/module.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/module.go')
-rw-r--r--android/module.go23
1 files changed, 2 insertions, 21 deletions
diff --git a/android/module.go b/android/module.go
index f48af4a03..ceb54de5a 100644
--- a/android/module.go
+++ b/android/module.go
@@ -565,8 +565,8 @@ type Module interface {
AddProperties(props ...interface{})
GetProperties() []interface{}
- // IsConvertedByBp2build returns whether this module was converted via bp2build
- IsConvertedByBp2build() bool
+ // If this module should not have bazel BUILD definitions generated by bp2build,
+ // GetUnconvertedReason returns a reason this is the case.
GetUnconvertedReason() *UnconvertedReason
// Bp2buildTargets returns the target(s) generated for Bazel via bp2build for this module
@@ -1639,35 +1639,16 @@ func (b bp2buildInfo) BazelAttributes() []interface{} {
}
func (m *ModuleBase) addBp2buildInfo(info bp2buildInfo) {
- reason := m.commonProperties.BazelConversionStatus.UnconvertedReason
- if reason != nil {
- panic(fmt.Errorf("bp2build: internal error trying to convert module '%s' marked unconvertible. Reason type %d: %s",
- m.Name(),
- reason.ReasonType,
- reason.Detail))
- }
m.commonProperties.BazelConversionStatus.Bp2buildInfo = append(m.commonProperties.BazelConversionStatus.Bp2buildInfo, info)
}
func (m *ModuleBase) setBp2buildUnconvertible(reasonType bp2build_metrics_proto.UnconvertedReasonType, detail string) {
- if len(m.commonProperties.BazelConversionStatus.Bp2buildInfo) > 0 {
- fmt.Println(m.commonProperties.BazelConversionStatus.Bp2buildInfo)
- panic(fmt.Errorf("bp2build: internal error trying to mark converted module '%s' as unconvertible. Reason type %d: %s",
- m.Name(),
- reasonType,
- detail))
- }
m.commonProperties.BazelConversionStatus.UnconvertedReason = &UnconvertedReason{
ReasonType: int(reasonType),
Detail: detail,
}
}
-// IsConvertedByBp2build returns whether this module was converted via bp2build.
-func (m *ModuleBase) IsConvertedByBp2build() bool {
- return len(m.commonProperties.BazelConversionStatus.Bp2buildInfo) > 0
-}
-
func (m *ModuleBase) GetUnconvertedReason() *UnconvertedReason {
return m.commonProperties.BazelConversionStatus.UnconvertedReason
}