Merge "Update Headers_only to a bool pointer" into main am: 9ea1d061b7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2775982 Change-Id: I01cd2d73f055028b09107a06661040c0fd7be845 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -20,6 +20,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"android/soong/android"
|
"android/soong/android"
|
||||||
|
|
||||||
|
"github.com/google/blueprint/proptools"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (library *Library) AndroidMkEntriesHostDex() android.AndroidMkEntries {
|
func (library *Library) AndroidMkEntriesHostDex() android.AndroidMkEntries {
|
||||||
@@ -79,7 +81,7 @@ func (library *Library) AndroidMkEntries() []android.AndroidMkEntries {
|
|||||||
} else if !library.ApexModuleBase.AvailableFor(android.AvailableToPlatform) {
|
} else if !library.ApexModuleBase.AvailableFor(android.AvailableToPlatform) {
|
||||||
// Platform variant. If not available for the platform, we don't need Make module.
|
// Platform variant. If not available for the platform, we don't need Make module.
|
||||||
entriesList = append(entriesList, android.AndroidMkEntries{Disabled: true})
|
entriesList = append(entriesList, android.AndroidMkEntries{Disabled: true})
|
||||||
} else if library.properties.Headers_only {
|
} else if proptools.Bool(library.properties.Headers_only) {
|
||||||
// If generating headers only then don't expose to Make.
|
// If generating headers only then don't expose to Make.
|
||||||
entriesList = append(entriesList, android.AndroidMkEntries{Disabled: true})
|
entriesList = append(entriesList, android.AndroidMkEntries{Disabled: true})
|
||||||
} else {
|
} else {
|
||||||
|
@@ -194,7 +194,7 @@ type CommonProperties struct {
|
|||||||
Generated_srcjars []android.Path `android:"mutated"`
|
Generated_srcjars []android.Path `android:"mutated"`
|
||||||
|
|
||||||
// If true, then only the headers are built and not the implementation jar.
|
// If true, then only the headers are built and not the implementation jar.
|
||||||
Headers_only bool
|
Headers_only *bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Properties that are specific to device modules. Host module factories should not add these when
|
// Properties that are specific to device modules. Host module factories should not add these when
|
||||||
@@ -582,7 +582,7 @@ func (j *Module) checkPlatformAPI(ctx android.ModuleContext) {
|
|||||||
|
|
||||||
func (j *Module) checkHeadersOnly(ctx android.ModuleContext) {
|
func (j *Module) checkHeadersOnly(ctx android.ModuleContext) {
|
||||||
if _, ok := ctx.Module().(android.SdkContext); ok {
|
if _, ok := ctx.Module().(android.SdkContext); ok {
|
||||||
headersOnly := proptools.Bool(&j.properties.Headers_only)
|
headersOnly := proptools.Bool(j.properties.Headers_only)
|
||||||
installable := proptools.Bool(j.properties.Installable)
|
installable := proptools.Bool(j.properties.Installable)
|
||||||
|
|
||||||
if headersOnly && installable {
|
if headersOnly && installable {
|
||||||
@@ -1180,7 +1180,7 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars, extraClasspath
|
|||||||
flags.classpath = append(android.CopyOf(extraClasspathJars), flags.classpath...)
|
flags.classpath = append(android.CopyOf(extraClasspathJars), flags.classpath...)
|
||||||
|
|
||||||
// If compiling headers then compile them and skip the rest
|
// If compiling headers then compile them and skip the rest
|
||||||
if j.properties.Headers_only {
|
if proptools.Bool(j.properties.Headers_only) {
|
||||||
if srcFiles.HasExt(".kt") {
|
if srcFiles.HasExt(".kt") {
|
||||||
ctx.ModuleErrorf("Compiling headers_only with .kt not supported")
|
ctx.ModuleErrorf("Compiling headers_only with .kt not supported")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user