aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2019-03-20 23:20:22 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-03-20 23:20:22 -0700
commit6964c93121262be217f3c598bea99397856be86a (patch)
tree9b2ec7ca130d55eb27b51cf3d788ac60e8ca660b /android
parentb7700709ddcf77baf381dfc2a93900bb52c1daff (diff)
parentba47ea108a51351bd0c7653874b54e109ab6968a (diff)
downloadbuild_soong-6964c93121262be217f3c598bea99397856be86a.tar.gz
build_soong-6964c93121262be217f3c598bea99397856be86a.tar.bz2
build_soong-6964c93121262be217f3c598bea99397856be86a.zip
Merge "Notice support for APEX" am: 21c81326ff am: 602b6ba221
am: ba47ea108a Change-Id: I67ecf430ba38963084c4a65d3482a0a7ff5ba73e
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)
}
}