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

Commit 99deb085 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Ensure package check is run for java_library in APEX" am: b719d60d

Change-Id: Icb95b6cb68b370bb571eae951c1e124c15e1f223
parents 6a63341a b719d60d
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -69,7 +69,26 @@ func (library *Library) AndroidMkEntries() []android.AndroidMkEntries {
	if !library.ApexModuleBase.AvailableFor(android.AvailableToPlatform) {
		hideFromMake = true
	}
	if !hideFromMake {
	if hideFromMake {
		// May still need to add some additional dependencies. This will be called
		// once for the platform variant (even if it is not being used) and once each
		// for the APEX specific variants. In order to avoid adding the dependency
		// multiple times only add it for the platform variant.
		checkedModulePaths := library.additionalCheckedModules
		if library.IsForPlatform() && len(checkedModulePaths) != 0 {
			mainEntries = android.AndroidMkEntries{
				Class: "FAKE",
				// Need at least one output file in order for this to take effect.
				OutputFile: android.OptionalPathForPath(checkedModulePaths[0]),
				Include:    "$(BUILD_PHONY_PACKAGE)",
				ExtraEntries: []android.AndroidMkExtraEntriesFunc{
					func(entries *android.AndroidMkEntries) {
						entries.AddStrings("LOCAL_ADDITIONAL_CHECKED_MODULE", checkedModulePaths.Strings()...)
					},
				},
			}
		}
	} else {
		mainEntries = android.AndroidMkEntries{
			Class:      "JAVA_LIBRARIES",
			DistFile:   android.OptionalPathForPath(library.distFile),
+5 −1
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ zip_contents=`zipinfo -1 $jar_file`
# Check all class file names against the expected prefixes.
old_ifs=${IFS}
IFS=$'\n'
failed=false
for zip_entry in ${zip_contents}; do
  # Check the suffix.
  if [[ "${zip_entry}" = *.class ]]; then
@@ -65,8 +66,11 @@ for zip_entry in ${zip_contents}; do
    done
    if [[ "${found}" == "false" ]]; then
      echo "Class file ${zip_entry} is outside specified packages."
      exit 1
      failed=true
    fi
  fi
done
if [[ "${failed}" == "true" ]]; then
  exit 1
fi
IFS=${old_ifs}