一、android build system编译系统概述
二、envsetup.sh脚本(Android10)
三、soong_ui.bash脚本
四、soong_ui的main.go
五、kati中调用main.mk
六、make目录中的main.mk
七、AndroidProducts.mk
八、module-info.json
九、子模块的执行
soong中子模块执行
部分的代码
log提示
/build/soong/ui/status/log.go
verboseLog
type verboseLog struct {
w io.WriteCloser
}
func (v *verboseLog) StartAction(action *Action, counts Counts) {}
func (v *verboseLog) FinishAction(result ActionResult, counts Counts) {
cmd := result.Command
if cmd == "" {
cmd = result.Description
}
fmt.Fprintf(v.w, "[%d/%d] %s\n", counts.FinishedActions, counts.TotalActions, cmd)
if result.Error != nil {
fmt.Fprintf(v.w, "FAILED: %s\n", strings.Join(result.Outputs, " "))
}
if result.Output != "" {
fmt.Fprintln(v.w, result.Output)
}
}
errorLog
type errorLog struct {
w io.WriteCloser
empty bool
}
func (e *errorLog) StartAction(action *Action, counts Counts) {}
func (e *errorLog) FinishAction(result ActionResult, counts Counts) {
if result.Error == nil {
return
}
cmd := result.Command
if cmd == "" {
cmd = result.Description
}
if !e.empty {
fmt.Fprintf(e.w, "\n\n")
}
e.empty = false
fmt.Fprintf(e.w, "FAILED: %s\n", result.Description)
if len(result.Outputs) > 0 {
fmt.Fprintf(e.w, "Outputs: %s\n", strings.Join(result.Outputs, " "))
}
fmt.Fprintf(e.w, "Error: %s\n", result.Error)
if result.Command != "" {
fmt.Fprintf(e.w, "Command: %s\n", result.Command)
}
fmt.Fprintf(e.w, "Output:\n%s\n", result.Output)
}