Merge "Allow NDK APIs to be marked as drafts." am: abe477a33a am: 8f37f22d71

am: 5648b332a1

Change-Id: I0369d08123d7d6c203aca96a4b0b28c25beafac5
This commit is contained in:
Dan Albert
2018-11-28 17:19:17 -08:00
committed by android-build-merger
6 changed files with 44 additions and 2 deletions

View File

@@ -77,6 +77,11 @@ type headerProperties struct {
// Path to the NOTICE file associated with the headers.
License *string
// True if this API is not yet ready to be shipped in the NDK. It will be
// available in the platform for testing, but will be excluded from the
// sysroot provided to the NDK proper.
Draft bool
}
type headerModule struct {
@@ -182,6 +187,11 @@ type versionedHeaderProperties struct {
// Path to the NOTICE file associated with the headers.
License *string
// True if this API is not yet ready to be shipped in the NDK. It will be
// available in the platform for testing, but will be excluded from the
// sysroot provided to the NDK proper.
Draft bool
}
// Like ndk_headers, but preprocesses the headers with the bionic versioner:
@@ -309,6 +319,11 @@ type preprocessedHeadersProperties struct {
// Path to the NOTICE file associated with the headers.
License *string
// True if this API is not yet ready to be shipped in the NDK. It will be
// available in the platform for testing, but will be excluded from the
// sysroot provided to the NDK proper.
Draft bool
}
type preprocessedHeadersModule struct {

View File

@@ -91,6 +91,11 @@ type libraryProperties struct {
// Private property for use by the mutator that splits per-API level.
ApiLevel string `blueprint:"mutated"`
// True if this API is not yet ready to be shipped in the NDK. It will be
// available in the platform for testing, but will be excluded from the
// sysroot provided to the NDK proper.
Draft bool
}
type stubDecorator struct {

View File

@@ -104,22 +104,38 @@ func (n *ndkSingleton) GenerateBuildActions(ctx android.SingletonContext) {
}
if m, ok := module.(*headerModule); ok {
if ctx.Config().ExcludeDraftNdkApis() && m.properties.Draft {
return
}
installPaths = append(installPaths, m.installPaths...)
licensePaths = append(licensePaths, m.licensePath)
}
if m, ok := module.(*versionedHeaderModule); ok {
if ctx.Config().ExcludeDraftNdkApis() && m.properties.Draft {
return
}
installPaths = append(installPaths, m.installPaths...)
licensePaths = append(licensePaths, m.licensePath)
}
if m, ok := module.(*preprocessedHeadersModule); ok {
if ctx.Config().ExcludeDraftNdkApis() && m.properties.Draft {
return
}
installPaths = append(installPaths, m.installPaths...)
licensePaths = append(licensePaths, m.licensePath)
}
if m, ok := module.(*Module); ok {
if installer, ok := m.installer.(*stubDecorator); ok {
if ctx.Config().ExcludeDraftNdkApis() &&
installer.properties.Draft {
return
}
installPaths = append(installPaths, installer.installPath)
}