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:
Colin Cross
2015-04-28 13:28:51 -07:00
parent d350ecd102
commit 0607cf7daa
3 changed files with 13 additions and 6 deletions

View File

@@ -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 {