Merge "List bootclasspath_fragments in module-info.json" am: d94e4f5554
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2007227 Change-Id: Id0ab2729a636dbe0654d4219fa0dfd0f39a61319
This commit is contained in:
@@ -16,6 +16,7 @@ package java
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -588,6 +589,19 @@ func (b *BootclasspathFragmentModule) GenerateAndroidBuildActions(ctx android.Mo
|
|||||||
// Provide the apex content info.
|
// Provide the apex content info.
|
||||||
b.provideApexContentInfo(ctx, imageConfig, hiddenAPIOutput, bootImageFilesByArch)
|
b.provideApexContentInfo(ctx, imageConfig, hiddenAPIOutput, bootImageFilesByArch)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Versioned fragments are not needed by make.
|
||||||
|
b.HideFromMake()
|
||||||
|
}
|
||||||
|
|
||||||
|
// In order for information about bootclasspath_fragment modules to be added to module-info.json
|
||||||
|
// it is necessary to output an entry to Make. As bootclasspath_fragment modules are part of an
|
||||||
|
// APEX there can be multiple variants, including the default/platform variant and only one can
|
||||||
|
// be output to Make but it does not really matter which variant is output. The default/platform
|
||||||
|
// variant is the first (ctx.PrimaryModule()) and is usually hidden from make so this just picks
|
||||||
|
// the last variant (ctx.FinalModule()).
|
||||||
|
if ctx.Module() != ctx.FinalModule() {
|
||||||
|
b.HideFromMake()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -849,7 +863,22 @@ func (b *BootclasspathFragmentModule) generateBootImageBuildActions(ctx android.
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *BootclasspathFragmentModule) AndroidMkEntries() []android.AndroidMkEntries {
|
func (b *BootclasspathFragmentModule) AndroidMkEntries() []android.AndroidMkEntries {
|
||||||
var entriesList []android.AndroidMkEntries
|
// Use the generated classpath proto as the output.
|
||||||
|
outputFile := b.outputFilepath
|
||||||
|
// Create a fake entry that will cause this to be added to the module-info.json file.
|
||||||
|
entriesList := []android.AndroidMkEntries{{
|
||||||
|
Class: "FAKE",
|
||||||
|
OutputFile: android.OptionalPathForPath(outputFile),
|
||||||
|
Include: "$(BUILD_PHONY_PACKAGE)",
|
||||||
|
ExtraFooters: []android.AndroidMkExtraFootersFunc{
|
||||||
|
func(w io.Writer, name, prefix, moduleDir string) {
|
||||||
|
// Allow the bootclasspath_fragment to be built by simply passing its name on the command
|
||||||
|
// line.
|
||||||
|
fmt.Fprintln(w, ".PHONY:", b.Name())
|
||||||
|
fmt.Fprintln(w, b.Name()+":", outputFile.String())
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}}
|
||||||
for _, install := range b.bootImageDeviceInstalls {
|
for _, install := range b.bootImageDeviceInstalls {
|
||||||
entriesList = append(entriesList, install.ToMakeEntries())
|
entriesList = append(entriesList, install.ToMakeEntries())
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user