summaryrefslogtreecommitdiff
path: root/android/module.go
diff options
context:
space:
mode:
author Jingwen Chen <jingwen@google.com> 2023-08-25 09:00:16 +0000
committer Jingwen Chen <jingwen@google.com> 2023-09-18 12:39:06 +0000
commite12c083198403ec694af6c625aed11327eb2bf7f (patch)
tree93c9e00d9be2b7f6cb62ced621cf83346e18a556 /android/module.go
parentfaa7c7c1021936d7feeda5c12320466396799ac7 (diff)
[bp2build] android_test bp2build.
android_test is just an android_app, but the test bits are handled purely in Starlark (tradefed_test_impl). This enables building HelloWorldTests (android_test) with Bazel. Bug: 297030120 Bug: 297029612 Test: WIP Change-Id: I6d287c94b31698ea247da48e4cd6b5a75bc71e11
Diffstat (limited to 'android/module.go')
-rw-r--r--android/module.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/android/module.go b/android/module.go
index 516810fcb..e6e5918a5 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1636,15 +1636,23 @@ func (b bp2buildInfo) BazelAttributes() []interface{} {
}
func (m *ModuleBase) addBp2buildInfo(info bp2buildInfo) {
- if m.commonProperties.BazelConversionStatus.UnconvertedReason != nil {
- panic(fmt.Errorf("bp2build: module '%s' marked unconvertible and also is converted", m.Name()))
+ 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 {
- panic(fmt.Errorf("bp2build: module '%s' marked unconvertible and also is converted", m.Name()))
+ 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),