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

Commit e11319d4 authored by Zhi Dou's avatar Zhi Dou
Browse files

enable exportable check

If a library is built to mode exported, the flag declaration has to be
set with exportable true. The reason for this requirement is only flags
in the exportabel declarations will be repackaged. To prevent forgetting
adding this attribute, this exportable attribute is required to be set
for all exportable declarations.

Test: m
Bug: 310504781
Change-Id: I3ddafe0b212dabe86aa5000b1b76c7c412acc93c
parent 0684c5fc
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -92,12 +92,12 @@ func (callbacks *JavaAconfigDeclarationsLibraryCallbacks) GenerateSourceJarBuild
	if !isModeSupported(mode) {
		ctx.PropertyErrorf("mode", "%q is not a supported mode", mode)
	}
	// TODO: uncomment this part after internal clean up
	//if mode == "exported" && !declarations.Exportable {
	//	// if mode is exported, the corresponding aconfig_declaration must mark its
	//	// exportable property true
	//	ctx.PropertyErrorf("mode", "exported mode requires its aconfig_declaration has exportable prop true")
	//}

	if mode == "exported" && !declarations.Exportable {
		// if mode is exported, the corresponding aconfig_declaration must mark its
		// exportable property true
		ctx.PropertyErrorf("mode", "exported mode requires its aconfig_declaration has exportable prop true")
	}

	ctx.Build(pctx, android.BuildParams{
		Rule:        javaRule,