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

Commit 13f873ce authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add no_apex check for static library"

parents f1ff226c 2db7f46d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -984,6 +984,8 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
					}
				} else if am.CanHaveApexVariants() && am.IsInstallableToApex() {
					ctx.ModuleErrorf("unexpected tag %q for indirect dependency %q", depTag, depName)
				} else if am.NoApex() && !android.InList(depName, whitelistNoApex[ctx.ModuleName()]) {
					ctx.ModuleErrorf("tries to include no_apex module %s", depName)
				}
			}
		}
+30 −0
Original line number Diff line number Diff line
@@ -1851,6 +1851,36 @@ func TestApexUsesFailsIfUseNoApex(t *testing.T) {
		}
	`)

	testApexError(t, `tries to include no_apex module mylib2`, `
		apex {
			name: "commonapex",
			key: "myapex.key",
			native_shared_libs: ["mylib"],
		}

		apex_key {
			name: "myapex.key",
			public_key: "testkey.avbpubkey",
			private_key: "testkey.pem",
		}

		cc_library {
			name: "mylib",
			srcs: ["mylib.cpp"],
			static_libs: ["mylib2"],
			system_shared_libs: [],
			stl: "none",
		}

		cc_library {
			name: "mylib2",
			srcs: ["mylib.cpp"],
			system_shared_libs: [],
			stl: "none",
			no_apex: true,
		}
	`)

	ctx, _ := testApex(t, `
		apex {
			name: "myapex",