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

Commit 22053dcb authored by Martin Stjernholm's avatar Martin Stjernholm Committed by Gerrit Code Review
Browse files

Merge "Fix indexing bug when config.Arches() returns an empty array."

parents dbfafc0a df298b3b
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -741,6 +741,7 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
		}
	}

	if prebuilts := a.properties.Prebuilts; len(prebuilts) > 0 {
		// For prebuilt_etc, use the first variant (64 on 64/32bit device, 32 on 32bit device)
		// regardless of the TARGET_PREFER_* setting. See b/144532908
		archForPrebuiltEtc := config.Arches()[0]
@@ -754,7 +755,8 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
		ctx.AddFarVariationDependencies([]blueprint.Variation{
			{Mutator: "os", Variation: ctx.Os().String()},
			{Mutator: "arch", Variation: archForPrebuiltEtc.String()},
	}, prebuiltTag, a.properties.Prebuilts...)
		}, prebuiltTag, prebuilts...)
	}

	// Common-arch dependencies come next
	commonVariation := ctx.Config().AndroidCommonTarget.Variations()
+22 −0
Original line number Diff line number Diff line
@@ -7589,6 +7589,28 @@ func TestPrebuiltStubLibDep(t *testing.T) {
	}
}

func TestHostApexInHostOnlyBuild(t *testing.T) {
	testApex(t, `
		apex {
			name: "myapex",
			host_supported: true,
			key: "myapex.key",
			updatable: false,
			payload_type: "zip",
		}
		apex_key {
			name: "myapex.key",
			public_key: "testkey.avbpubkey",
			private_key: "testkey.pem",
		}
	`,
		android.FixtureModifyConfig(func(config android.Config) {
			// We may not have device targets in all builds, e.g. in
			// prebuilts/build-tools/build-prebuilts.sh
			config.Targets[android.Android] = []android.Target{}
		}))
}

func TestMain(m *testing.M) {
	os.Exit(m.Run())
}