Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5edacb26 authored by Jaewoong Jung's avatar Jaewoong Jung Committed by Gerrit Code Review
Browse files

Merge "Add filegroup support to notice property."

parents f9e2c3f5 62707f79
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -436,7 +436,7 @@ toolchain_library {
            src: "prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/x86_64-w64-mingw32/lib/libwinpthread.a",
        },
    },
    notice: "../../prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/licenses/mingw-w64-svn-r5861/mingw-w64-libraries/winpthreads/COPYING",
    notice: ":mingw-libwinpthread-notice",
}

toolchain_library {
+2 −2
Original line number Diff line number Diff line
@@ -317,8 +317,8 @@ func translateAndroidModule(ctx SingletonContext, w io.Writer, mod blueprint.Mod
		}
	}

	if amod.commonProperties.Notice != nil {
		fmt.Fprintln(&data.preamble, "LOCAL_NOTICE_FILE :=", "$(LOCAL_PATH)/"+*amod.commonProperties.Notice)
	if amod.noticeFile != nil {
		fmt.Fprintln(&data.preamble, "LOCAL_NOTICE_FILE :=", amod.noticeFile.String())
	}

	if host {
+13 −0
Original line number Diff line number Diff line
@@ -459,6 +459,7 @@ type ModuleBase struct {
	noAddressSanitizer bool
	installFiles       Paths
	checkbuildFiles    Paths
	noticeFile         Path

	// Used by buildTargetSingleton to create checkbuild and per-directory build targets
	// Only set on the final variant of each module
@@ -826,6 +827,11 @@ 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 = ctx.ExpandSource(*a.commonProperties.Notice, "notice")
		}
	}

	if a == ctx.FinalModule().(Module).base() {
@@ -1347,6 +1353,13 @@ func (ctx *androidModuleContext) ExpandSource(srcFile, prop string) Path {
	srcFiles := ctx.ExpandSourcesSubDir([]string{srcFile}, nil, "")
	if len(srcFiles) == 1 {
		return srcFiles[0]
	} else if len(srcFiles) == 0 {
		if ctx.Config().AllowMissingDependencies() {
			ctx.AddMissingDependencies([]string{srcFile})
		} else {
			ctx.PropertyErrorf(prop, "%s path %s does not exist", prop, srcFile)
		}
		return nil
	} else {
		ctx.PropertyErrorf(prop, "module providing %s must produce exactly one file", prop)
		return nil
+5 −0
Original line number Diff line number Diff line
@@ -207,6 +207,11 @@ func (mutator *mutator) Parallel() MutatorHandle {
func depsMutator(ctx BottomUpMutatorContext) {
	if m, ok := ctx.Module().(Module); ok && m.Enabled() {
		m.DepsMutator(ctx)

		// For filegroup-based notice file references.
		if m.base().commonProperties.Notice != nil {
			ExtractSourceDeps(ctx, m.base().commonProperties.Notice)
		}
	}
}