Merge "Change remaining properties to *string, *bool in Soong."
This commit is contained in:
commit
bafc47aea6
|
@ -156,13 +156,13 @@ type preprocessedHeaderProperies struct {
|
||||||
//
|
//
|
||||||
// Will install $SYSROOT/usr/include/foo/bar/baz.h. If `from` were instead
|
// Will install $SYSROOT/usr/include/foo/bar/baz.h. If `from` were instead
|
||||||
// "include/foo", it would have installed $SYSROOT/usr/include/bar/baz.h.
|
// "include/foo", it would have installed $SYSROOT/usr/include/bar/baz.h.
|
||||||
From string
|
From *string
|
||||||
|
|
||||||
// Install path within the sysroot. This is relative to usr/include.
|
// Install path within the sysroot. This is relative to usr/include.
|
||||||
To string
|
To *string
|
||||||
|
|
||||||
// Path to the NOTICE file associated with the headers.
|
// Path to the NOTICE file associated with the headers.
|
||||||
License string
|
License *string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Like ndk_headers, but preprocesses the headers with the bionic versioner:
|
// Like ndk_headers, but preprocesses the headers with the bionic versioner:
|
||||||
|
@ -185,25 +185,25 @@ func (m *preprocessedHeaderModule) DepsMutator(ctx android.BottomUpMutatorContex
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *preprocessedHeaderModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
func (m *preprocessedHeaderModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||||
if m.properties.License == "" {
|
if String(m.properties.License) == "" {
|
||||||
ctx.PropertyErrorf("license", "field is required")
|
ctx.PropertyErrorf("license", "field is required")
|
||||||
}
|
}
|
||||||
|
|
||||||
m.licensePath = android.PathForModuleSrc(ctx, m.properties.License)
|
m.licensePath = android.PathForModuleSrc(ctx, String(m.properties.License))
|
||||||
|
|
||||||
fromSrcPath := android.PathForModuleSrc(ctx, m.properties.From)
|
fromSrcPath := android.PathForModuleSrc(ctx, String(m.properties.From))
|
||||||
toOutputPath := getCurrentIncludePath(ctx).Join(ctx, m.properties.To)
|
toOutputPath := getCurrentIncludePath(ctx).Join(ctx, String(m.properties.To))
|
||||||
srcFiles := ctx.Glob(filepath.Join(fromSrcPath.String(), "**/*.h"), nil)
|
srcFiles := ctx.Glob(filepath.Join(fromSrcPath.String(), "**/*.h"), nil)
|
||||||
var installPaths []android.WritablePath
|
var installPaths []android.WritablePath
|
||||||
for _, header := range srcFiles {
|
for _, header := range srcFiles {
|
||||||
installDir := getHeaderInstallDir(ctx, header, m.properties.From, m.properties.To)
|
installDir := getHeaderInstallDir(ctx, header, String(m.properties.From), String(m.properties.To))
|
||||||
installPath := installDir.Join(ctx, header.Base())
|
installPath := installDir.Join(ctx, header.Base())
|
||||||
installPaths = append(installPaths, installPath)
|
installPaths = append(installPaths, installPath)
|
||||||
m.installPaths = append(m.installPaths, installPath.String())
|
m.installPaths = append(m.installPaths, installPath.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(m.installPaths) == 0 {
|
if len(m.installPaths) == 0 {
|
||||||
ctx.ModuleErrorf("glob %q matched zero files", m.properties.From)
|
ctx.ModuleErrorf("glob %q matched zero files", String(m.properties.From))
|
||||||
}
|
}
|
||||||
|
|
||||||
processHeadersWithVersioner(ctx, fromSrcPath, toOutputPath, srcFiles, installPaths)
|
processHeadersWithVersioner(ctx, fromSrcPath, toOutputPath, srcFiles, installPaths)
|
||||||
|
|
|
@ -343,7 +343,7 @@ func NewGenSrcs() *Module {
|
||||||
outFiles := android.WritablePaths{}
|
outFiles := android.WritablePaths{}
|
||||||
genPath := android.PathForModuleGen(ctx).String()
|
genPath := android.PathForModuleGen(ctx).String()
|
||||||
for _, in := range srcFiles {
|
for _, in := range srcFiles {
|
||||||
outFile := android.GenPathWithExt(ctx, "", in, properties.Output_extension)
|
outFile := android.GenPathWithExt(ctx, "", in, String(properties.Output_extension))
|
||||||
outFiles = append(outFiles, outFile)
|
outFiles = append(outFiles, outFile)
|
||||||
|
|
||||||
// replace "out" with "__SBOX_OUT_DIR__/<the value of ${out}>"
|
// replace "out" with "__SBOX_OUT_DIR__/<the value of ${out}>"
|
||||||
|
@ -390,7 +390,7 @@ func GenSrcsFactory() android.Module {
|
||||||
|
|
||||||
type genSrcsProperties struct {
|
type genSrcsProperties struct {
|
||||||
// extension that will be substituted for each output file
|
// extension that will be substituted for each output file
|
||||||
Output_extension string
|
Output_extension *string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewGenRule() *Module {
|
func NewGenRule() *Module {
|
||||||
|
|
Loading…
Reference in New Issue