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

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

Merge "Improve apex build check explanation"

parents 3239bcb1 d967aee9
Loading
Loading
Loading
Loading
+9 −2
Original line number Original line Diff line number Diff line
@@ -3211,8 +3211,15 @@ func createApexPermittedPackagesRules(modules_packages map[string][]string) []an
			WithMatcher("permitted_packages", android.NotInList(module_packages)).
			WithMatcher("permitted_packages", android.NotInList(module_packages)).
			WithMatcher("min_sdk_version", android.LessThanSdkVersion("Tiramisu")).
			WithMatcher("min_sdk_version", android.LessThanSdkVersion("Tiramisu")).
			Because("jars that are part of the " + module_name +
			Because("jars that are part of the " + module_name +
				" module may only allow these packages: " + strings.Join(module_packages, ",") +
				" module may only use these package prefixes: " + strings.Join(module_packages, ",") +
				" with min_sdk < T. Please jarjar or move code around.")
				" with min_sdk < T. Please consider the following alternatives:\n" +
				"    1. If the offending code is from a statically linked library, consider " +
				"removing that dependency and using an alternative already in the " +
				"bootclasspath, or perhaps a shared library." +
				"    2. Move the offending code into an allowed package.\n" +
				"    3. Jarjar the offending code. Please be mindful of the potential system " +
				"health implications of bundling that code, particularly if the offending jar " +
				"is part of the bootclasspath.")
		rules = append(rules, permittedPackagesRule)
		rules = append(rules, permittedPackagesRule)
	}
	}
	return rules
	return rules
+2 −2
Original line number Original line Diff line number Diff line
@@ -7464,7 +7464,7 @@ func TestApexPermittedPackagesRules(t *testing.T) {
		},
		},
		{
		{
			name:          "Bootclasspath apex jar not satisfying allowed module packages on Q.",
			name:          "Bootclasspath apex jar not satisfying allowed module packages on Q.",
			expectedError: `(?s)module "bcp_lib2" .* which is restricted because jars that are part of the myapex module may only allow these packages: foo.bar with min_sdk < T. Please jarjar or move code around.`,
			expectedError: `(?s)module "bcp_lib2" .* which is restricted because jars that are part of the myapex module may only use these package prefixes: foo.bar with min_sdk < T. Please consider the following alternatives:\n    1. If the offending code is from a statically linked library, consider removing that dependency and using an alternative already in the bootclasspath, or perhaps a shared library.    2. Move the offending code into an allowed package.\n    3. Jarjar the offending code. Please be mindful of the potential system health implications of bundling that code, particularly if the offending jar is part of the bootclasspath.`,
			bp: `
			bp: `
				java_library {
				java_library {
					name: "bcp_lib1",
					name: "bcp_lib1",
@@ -7501,7 +7501,7 @@ func TestApexPermittedPackagesRules(t *testing.T) {
		},
		},
		{
		{
			name:          "Bootclasspath apex jar not satisfying allowed module packages on R.",
			name:          "Bootclasspath apex jar not satisfying allowed module packages on R.",
			expectedError: `(?s)module "bcp_lib2" .* which is restricted because jars that are part of the myapex module may only allow these packages: foo.bar with min_sdk < T. Please jarjar or move code around.`,
			expectedError: `(?s)module "bcp_lib2" .* which is restricted because jars that are part of the myapex module may only use these package prefixes: foo.bar with min_sdk < T. Please consider the following alternatives:\n    1. If the offending code is from a statically linked library, consider removing that dependency and using an alternative already in the bootclasspath, or perhaps a shared library.    2. Move the offending code into an allowed package.\n    3. Jarjar the offending code. Please be mindful of the potential system health implications of bundling that code, particularly if the offending jar is part of the bootclasspath.`,
			bp: `
			bp: `
				java_library {
				java_library {
					name: "bcp_lib1",
					name: "bcp_lib1",