aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2019-03-21 06:04:14 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-03-21 06:04:14 +0000
commit21c81326ff4ee6420e73077ce0f05e3cf5565e29 (patch)
treec2123bc6124e582a5dc23c51f03c4c1af05825d4 /android
parentefd249e62a873bbaab0ca367710f4bbc47220930 (diff)
parent52818fcde8265fd43ad5f331f57122ecdbe7a6be (diff)
downloadbuild_soong-21c81326ff4ee6420e73077ce0f05e3cf5565e29.tar.gz
build_soong-21c81326ff4ee6420e73077ce0f05e3cf5565e29.tar.bz2
build_soong-21c81326ff4ee6420e73077ce0f05e3cf5565e29.zip
Merge "Notice support for APEX"
Diffstat (limited to 'android')
-rw-r--r--android/androidmk.go2
-rw-r--r--android/module.go16
2 files changed, 13 insertions, 5 deletions
diff --git a/android/androidmk.go b/android/androidmk.go
index fc34471c..bd49e4c6 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -319,7 +319,7 @@ func translateAndroidModule(ctx SingletonContext, w io.Writer, mod blueprint.Mod
}
}
- if amod.noticeFile != nil {
+ if amod.noticeFile.Valid() {
fmt.Fprintln(&data.preamble, "LOCAL_NOTICE_FILE :=", amod.noticeFile.String())
}
diff --git a/android/module.go b/android/module.go
index afd2b714..abf2cae4 100644
--- a/android/module.go
+++ b/android/module.go
@@ -189,6 +189,7 @@ type Module interface {
InstallInRecovery() bool
SkipInstall()
ExportedToMake() bool
+ NoticeFile() OptionalPath
AddProperties(props ...interface{})
GetProperties() []interface{}
@@ -466,7 +467,7 @@ type ModuleBase struct {
noAddressSanitizer bool
installFiles Paths
checkbuildFiles Paths
- noticeFile Path
+ noticeFile OptionalPath
// Used by buildTargetSingleton to create checkbuild and per-directory build targets
// Only set on the final variant of each module
@@ -667,6 +668,10 @@ func (a *ModuleBase) Owner() string {
return String(a.commonProperties.Owner)
}
+func (a *ModuleBase) NoticeFile() OptionalPath {
+ return a.noticeFile
+}
+
func (a *ModuleBase) generateModuleTarget(ctx ModuleContext) {
allInstalledFiles := Paths{}
allCheckbuildFiles := Paths{}
@@ -852,9 +857,12 @@ func (a *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
a.installFiles = append(a.installFiles, ctx.installFiles...)
a.checkbuildFiles = append(a.checkbuildFiles, ctx.checkbuildFiles...)
- if a.commonProperties.Notice != nil {
- // For filegroup-based notice file references.
- a.noticeFile = PathForModuleSrc(ctx, *a.commonProperties.Notice)
+ notice := proptools.StringDefault(a.commonProperties.Notice, "NOTICE")
+ if m := SrcIsModule(notice); m != "" {
+ a.noticeFile = ctx.ExpandOptionalSource(&notice, "notice")
+ } else {
+ noticePath := filepath.Join(ctx.ModuleDir(), notice)
+ a.noticeFile = ExistentPathForSource(ctx, noticePath)
}
}