Rename preprocessed_ndk_headers to versioned_ndk_headers.
The current rule runs a specific preprocessor over the source files, and I'm adding support for generic preprocessed headers in a follow up patch. Test: make checkbuild Bug: None Change-Id: I1f3193cd595f151309e6321e1b41d8d16085379d
This commit is contained in:
@@ -26,7 +26,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
preprocessBionicHeaders = pctx.AndroidStaticRule("preprocessBionicHeaders",
|
versionBionicHeaders = pctx.AndroidStaticRule("versionBionicHeaders",
|
||||||
blueprint.RuleParams{
|
blueprint.RuleParams{
|
||||||
// The `&& touch $out` isn't really necessary, but Blueprint won't
|
// The `&& touch $out` isn't really necessary, but Blueprint won't
|
||||||
// let us have only implicit outputs.
|
// let us have only implicit outputs.
|
||||||
@@ -157,10 +157,10 @@ func ndkHeadersFactory() android.Module {
|
|||||||
return module
|
return module
|
||||||
}
|
}
|
||||||
|
|
||||||
type preprocessedHeaderProperties struct {
|
type versionedHeaderProperties struct {
|
||||||
// Base directory of the headers being installed. As an example:
|
// Base directory of the headers being installed. As an example:
|
||||||
//
|
//
|
||||||
// preprocessed_ndk_headers {
|
// versioned_ndk_headers {
|
||||||
// name: "foo",
|
// name: "foo",
|
||||||
// from: "include",
|
// from: "include",
|
||||||
// to: "",
|
// to: "",
|
||||||
@@ -184,19 +184,19 @@ type preprocessedHeaderProperties struct {
|
|||||||
// module does not have the srcs property, and operates on a full directory (the `from` property).
|
// module does not have the srcs property, and operates on a full directory (the `from` property).
|
||||||
//
|
//
|
||||||
// Note that this is really only built to handle bionic/libc/include.
|
// Note that this is really only built to handle bionic/libc/include.
|
||||||
type preprocessedHeaderModule struct {
|
type versionedHeaderModule struct {
|
||||||
android.ModuleBase
|
android.ModuleBase
|
||||||
|
|
||||||
properties preprocessedHeaderProperties
|
properties versionedHeaderProperties
|
||||||
|
|
||||||
installPaths android.Paths
|
installPaths android.Paths
|
||||||
licensePath android.ModuleSrcPath
|
licensePath android.ModuleSrcPath
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *preprocessedHeaderModule) DepsMutator(ctx android.BottomUpMutatorContext) {
|
func (m *versionedHeaderModule) DepsMutator(ctx android.BottomUpMutatorContext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *preprocessedHeaderModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
func (m *versionedHeaderModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||||
if String(m.properties.License) == "" {
|
if String(m.properties.License) == "" {
|
||||||
ctx.PropertyErrorf("license", "field is required")
|
ctx.PropertyErrorf("license", "field is required")
|
||||||
}
|
}
|
||||||
@@ -251,7 +251,7 @@ func processHeadersWithVersioner(ctx android.ModuleContext, srcDir, outDir andro
|
|||||||
|
|
||||||
timestampFile := android.PathForModuleOut(ctx, "versioner.timestamp")
|
timestampFile := android.PathForModuleOut(ctx, "versioner.timestamp")
|
||||||
ctx.Build(pctx, android.BuildParams{
|
ctx.Build(pctx, android.BuildParams{
|
||||||
Rule: preprocessBionicHeaders,
|
Rule: versionBionicHeaders,
|
||||||
Description: "versioner preprocess " + srcDir.Rel(),
|
Description: "versioner preprocess " + srcDir.Rel(),
|
||||||
Output: timestampFile,
|
Output: timestampFile,
|
||||||
Implicits: append(srcFiles, depsGlob...),
|
Implicits: append(srcFiles, depsGlob...),
|
||||||
@@ -266,8 +266,8 @@ func processHeadersWithVersioner(ctx android.ModuleContext, srcDir, outDir andro
|
|||||||
return timestampFile
|
return timestampFile
|
||||||
}
|
}
|
||||||
|
|
||||||
func preprocessedNdkHeadersFactory() android.Module {
|
func versionedNdkHeadersFactory() android.Module {
|
||||||
module := &preprocessedHeaderModule{}
|
module := &versionedHeaderModule{}
|
||||||
|
|
||||||
module.AddProperties(&module.properties)
|
module.AddProperties(&module.properties)
|
||||||
|
|
||||||
|
@@ -59,7 +59,7 @@ import (
|
|||||||
func init() {
|
func init() {
|
||||||
android.RegisterModuleType("ndk_headers", ndkHeadersFactory)
|
android.RegisterModuleType("ndk_headers", ndkHeadersFactory)
|
||||||
android.RegisterModuleType("ndk_library", ndkLibraryFactory)
|
android.RegisterModuleType("ndk_library", ndkLibraryFactory)
|
||||||
android.RegisterModuleType("preprocessed_ndk_headers", preprocessedNdkHeadersFactory)
|
android.RegisterModuleType("versioned_ndk_headers", versionedNdkHeadersFactory)
|
||||||
android.RegisterSingletonType("ndk", NdkSingleton)
|
android.RegisterSingletonType("ndk", NdkSingleton)
|
||||||
|
|
||||||
pctx.Import("android/soong/common")
|
pctx.Import("android/soong/common")
|
||||||
@@ -107,7 +107,7 @@ func (n *ndkSingleton) GenerateBuildActions(ctx android.SingletonContext) {
|
|||||||
licensePaths = append(licensePaths, m.licensePath)
|
licensePaths = append(licensePaths, m.licensePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
if m, ok := module.(*preprocessedHeaderModule); ok {
|
if m, ok := module.(*versionedHeaderModule); ok {
|
||||||
installPaths = append(installPaths, m.installPaths...)
|
installPaths = append(installPaths, m.installPaths...)
|
||||||
licensePaths = append(licensePaths, m.licensePath)
|
licensePaths = append(licensePaths, m.licensePath)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user