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

Commit 78210f6c authored by Ulya Trafimovich's avatar Ulya Trafimovich
Browse files

Make error message more precise.

Bug: 132357300
Test: m nothing
Change-Id: Iaac6aaf61a3bbf8476f0b11cf2c01d7d96a79920
parent 0d18ef42
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -437,7 +437,11 @@ func validateClassLoaderContextRec(sdkVer int, clcs []*ClassLoaderContext) (bool
			if sdkVer == AnySdkVersion {
				// Return error if dexpreopt doesn't know paths to one of the <uses-library>
				// dependencies. In the future we may need to relax this and just disable dexpreopt.
				return false, fmt.Errorf("invalid path for <uses-library> \"%s\"", clc.Name)
				if clc.Host == nil {
					return false, fmt.Errorf("invalid build path for <uses-library> \"%s\"", clc.Name)
				} else {
					return false, fmt.Errorf("invalid install path for <uses-library> \"%s\"", clc.Name)
				}
			} else {
				// No error for compatibility libraries, as Soong doesn't know if they are needed
				// (this depends on the targetSdkVersion in the manifest), but the CLC is invalid.
+1 −1
Original line number Diff line number Diff line
@@ -195,7 +195,7 @@ func TestCLCMaybeAdd(t *testing.T) {
	// But class loader context in such cases should raise an error on validation.
	t.Run("validate", func(t *testing.T) {
		_, err := validateClassLoaderContext(m)
		checkError(t, err, "invalid path for <uses-library> \"a\"")
		checkError(t, err, "invalid build path for <uses-library> \"a\"")
	})
}