java: add genrule support to java builds
Add support for source files generated by genrule or gensrcs to java builds. Change-Id: I39762b2ab65fa4cf92724300edc4ba995845ce92
This commit is contained in:
@@ -27,6 +27,7 @@ import (
|
||||
"github.com/google/blueprint/pathtools"
|
||||
|
||||
"android/soong/common"
|
||||
"android/soong/genrule"
|
||||
)
|
||||
|
||||
// TODO:
|
||||
@@ -243,8 +244,6 @@ func (j *javaBase) collectDeps(ctx common.AndroidModuleContext) (classpath []str
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ctx.ModuleErrorf("unknown dependency module type for %q", otherName)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -294,6 +293,12 @@ func (j *javaBase) GenerateJavaBuildActions(ctx common.AndroidModuleContext) {
|
||||
|
||||
srcFiles = j.genSources(ctx, srcFiles, flags)
|
||||
|
||||
ctx.VisitDirectDeps(func(module blueprint.Module) {
|
||||
if gen, ok := module.(genrule.SourceFileGenerator); ok {
|
||||
srcFiles = append(srcFiles, gen.GeneratedSourceFiles()...)
|
||||
}
|
||||
})
|
||||
|
||||
srcFileLists = append(srcFileLists, j.ExtraSrcLists...)
|
||||
|
||||
if len(srcFiles) > 0 {
|
||||
|
Reference in New Issue
Block a user