Merge changes from topic "soong_build_number_file" am: f14cd86e23
am: 5e1f7bf09b
Change-Id: Iac6e63067fd38a77eea68a4c7a76d02033b4908b
This commit is contained in:
commit
8b15cb8543
4 changed files with 12 additions and 10 deletions
|
@ -570,8 +570,8 @@ func (c *config) BuildId() string {
|
|||
return String(c.productVariables.BuildId)
|
||||
}
|
||||
|
||||
func (c *config) BuildNumberFromFile() string {
|
||||
return String(c.productVariables.BuildNumberFromFile)
|
||||
func (c *config) BuildNumberFile(ctx PathContext) Path {
|
||||
return PathForOutput(ctx, String(c.productVariables.BuildNumberFile))
|
||||
}
|
||||
|
||||
// DeviceName returns the name of the current device target
|
||||
|
|
|
@ -140,9 +140,8 @@ type productVariables struct {
|
|||
// Suffix to add to generated Makefiles
|
||||
Make_suffix *string `json:",omitempty"`
|
||||
|
||||
BuildId *string `json:",omitempty"`
|
||||
BuildNumberFromFile *string `json:",omitempty"`
|
||||
DateFromFile *string `json:",omitempty"`
|
||||
BuildId *string `json:",omitempty"`
|
||||
BuildNumberFile *string `json:",omitempty"`
|
||||
|
||||
Platform_version_name *string `json:",omitempty"`
|
||||
Platform_sdk_version *int `json:",omitempty"`
|
||||
|
@ -345,7 +344,7 @@ func stringPtr(v string) *string {
|
|||
|
||||
func (v *productVariables) SetDefaultConfig() {
|
||||
*v = productVariables{
|
||||
BuildNumberFromFile: stringPtr("123456789"),
|
||||
BuildNumberFile: stringPtr("build_number.txt"),
|
||||
|
||||
Platform_version_name: stringPtr("Q"),
|
||||
Platform_sdk_version: intPtr(28),
|
||||
|
|
|
@ -501,19 +501,21 @@ func init() {
|
|||
var injectVersionSymbol = pctx.AndroidStaticRule("injectVersionSymbol",
|
||||
blueprint.RuleParams{
|
||||
Command: "$symbolInjectCmd -i $in -o $out -s soong_build_number " +
|
||||
"-from 'SOONG BUILD NUMBER PLACEHOLDER' -v $buildNumberFromFile",
|
||||
"-from 'SOONG BUILD NUMBER PLACEHOLDER' -v $$(cat $buildNumberFile)",
|
||||
CommandDeps: []string{"$symbolInjectCmd"},
|
||||
},
|
||||
"buildNumberFromFile")
|
||||
"buildNumberFile")
|
||||
|
||||
func (linker *baseLinker) injectVersionSymbol(ctx ModuleContext, in android.Path, out android.WritablePath) {
|
||||
buildNumberFile := ctx.Config().BuildNumberFile(ctx)
|
||||
ctx.Build(pctx, android.BuildParams{
|
||||
Rule: injectVersionSymbol,
|
||||
Description: "inject version symbol",
|
||||
Input: in,
|
||||
Output: out,
|
||||
OrderOnly: android.Paths{buildNumberFile},
|
||||
Args: map[string]string{
|
||||
"buildNumberFromFile": proptools.NinjaEscape(ctx.Config().BuildNumberFromFile()),
|
||||
"buildNumberFile": buildNumberFile.String(),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
|
@ -773,6 +773,7 @@ func (d *Droiddoc) DepsMutator(ctx android.BottomUpMutatorContext) {
|
|||
}
|
||||
|
||||
func (d *Droiddoc) doclavaDocsFlags(ctx android.ModuleContext, cmd *android.RuleBuilderCommand, docletPath classpath) {
|
||||
buildNumberFile := ctx.Config().BuildNumberFile(ctx)
|
||||
// Droiddoc always gets "-source 1.8" because it doesn't support 1.9 sources. For modules with 1.9
|
||||
// sources, droiddoc will get sources produced by metalava which will have already stripped out the
|
||||
// 1.9 language features.
|
||||
|
@ -782,7 +783,7 @@ func (d *Droiddoc) doclavaDocsFlags(ctx android.ModuleContext, cmd *android.Rule
|
|||
Flag("-XDignore.symbol.file").
|
||||
FlagWithArg("-doclet ", "com.google.doclava.Doclava").
|
||||
FlagWithInputList("-docletpath ", docletPath.Paths(), ":").
|
||||
FlagWithArg("-hdf page.build ", ctx.Config().BuildId()+"-"+ctx.Config().BuildNumberFromFile()).
|
||||
FlagWithArg("-hdf page.build ", ctx.Config().BuildId()+"-$(cat "+buildNumberFile.String()+")").OrderOnly(buildNumberFile).
|
||||
FlagWithArg("-hdf page.now ", `"$(date -d @$(cat `+ctx.Config().Getenv("BUILD_DATETIME_FILE")+`) "+%d %b %Y %k:%M")" `)
|
||||
|
||||
if String(d.properties.Custom_template) == "" {
|
||||
|
|
Loading…
Reference in a new issue