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

Commit 4a349ab6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Friendly error message on apex_available and min_sdk_version checks"

parents bbfd5f5e 767dbd9d
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -849,8 +849,12 @@ func CheckMinSdkVersion(m UpdatableModule, ctx ModuleContext, minSdkVersion ApiL
		if err := to.ShouldSupportSdkVersion(ctx, minSdkVersion); err != nil {
			toName := ctx.OtherModuleName(to)
			if ver, ok := minSdkVersionAllowlist[toName]; !ok || ver.GreaterThan(minSdkVersion) {
				ctx.OtherModuleErrorf(to, "should support min_sdk_version(%v) for %q: %v. Dependency path: %s",
					minSdkVersion, ctx.ModuleName(), err.Error(), ctx.GetPathString(false))
				ctx.OtherModuleErrorf(to, "should support min_sdk_version(%v) for %q: %v."+
					"\n\nDependency path: %s\n\n"+
					"Consider adding 'min_sdk_version: %q' to %q",
					minSdkVersion, ctx.ModuleName(), err.Error(),
					ctx.GetPathString(false),
					minSdkVersion, ctx.ModuleName())
				return false
			}
		}
+4 −2
Original line number Diff line number Diff line
@@ -2244,8 +2244,10 @@ func (a *apexBundle) checkApexAvailability(ctx android.ModuleContext) {
		if to.AvailableFor(apexName) || baselineApexAvailable(apexName, toName) {
			return true
		}
		ctx.ModuleErrorf("%q requires %q that doesn't list the APEX under 'apex_available'. Dependency path:%s",
			fromName, toName, ctx.GetPathString(true))
		ctx.ModuleErrorf("%q requires %q that doesn't list the APEX under 'apex_available'."+
			"\n\nDependency path:%s\n\n"+
			"Consider adding %q to 'apex_available' property of %q",
			fromName, toName, ctx.GetPathString(true), apexName, toName)
		// Visit this module's dependencies to check and report any issues with their availability.
		return true
	})
+1 −1
Original line number Diff line number Diff line
@@ -5315,7 +5315,7 @@ func TestApexAvailable_DirectDep(t *testing.T) {

func TestApexAvailable_IndirectDep(t *testing.T) {
	// libbbaz is an indirect dep
	testApexError(t, `requires "libbaz" that doesn't list the APEX under 'apex_available'. Dependency path:
	testApexError(t, `requires "libbaz" that doesn't list the APEX under 'apex_available'.\n\nDependency path:
.*via tag apex\.dependencyTag.*name:sharedLib.*
.*-> libfoo.*link:shared.*
.*via tag cc\.libraryDependencyTag.*Kind:sharedLibraryDependency.*