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

Commit 816a23a5 authored by Jeongik Cha's avatar Jeongik Cha
Browse files

Introduce AlwaysUsePrebuiltSdks

Instead of UnbundledBuild, use AlwaysUsePrebuiltSdks
to determine if java modules needs to be built against prebuilt sdks.
And rename UnbundledBuildUsePrebuiltSdks to AlwaysUsePrebuiltSdks to
express its behavior more correctly.(It can be orthgonal to "Unbundled")

Bug: 160390776
Test: TARGET_BUILD_UNBUNDLED_IMAGE=true m vendorimage

Change-Id: I0be7265c1959d8774c295372cd7a9250169f6df9
parent 79dcf732
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -722,7 +722,7 @@ func (c *config) AllowMissingDependencies() bool {
	return Bool(c.productVariables.Allow_missing_dependencies)
}

// Returns true if building without full platform sources.
// Returns true if a full platform source tree cannot be assumed.
func (c *config) UnbundledBuild() bool {
	return Bool(c.productVariables.Unbundled_build)
}
@@ -733,8 +733,9 @@ func (c *config) UnbundledBuildApps() bool {
	return Bool(c.productVariables.Unbundled_build_apps)
}

func (c *config) UnbundledBuildUsePrebuiltSdks() bool {
	return Bool(c.productVariables.Unbundled_build) && !Bool(c.productVariables.Unbundled_build_sdks_from_source)
// Returns true if building modules against prebuilt SDKs.
func (c *config) AlwaysUsePrebuiltSdks() bool {
	return Bool(c.productVariables.Always_use_prebuilt_sdks)
}

func (c *config) Fuchsia() bool {
+24 −24
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ type productVariables struct {
	Allow_missing_dependencies   *bool `json:",omitempty"`
	Unbundled_build              *bool `json:",omitempty"`
	Unbundled_build_apps         *bool `json:",omitempty"`
	Unbundled_build_sdks_from_source *bool `json:",omitempty"`
	Always_use_prebuilt_sdks     *bool `json:",omitempty"`
	Malloc_not_svelte            *bool `json:",omitempty"`
	Malloc_zero_contents         *bool `json:",omitempty"`
	Malloc_pattern_fill_contents *bool `json:",omitempty"`
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ import (

func init() {
	pctx.VariableFunc("rsCmd", func(ctx android.PackageVarContext) string {
		if ctx.Config().UnbundledBuild() {
		if ctx.Config().AlwaysUsePrebuiltSdks() {
			// Use RenderScript prebuilts for unbundled builds but not PDK builds
			return filepath.Join("prebuilts/sdk/tools", runtime.GOOS, "bin/llvm-rs-cc")
		} else {
+1 −1
Original line number Diff line number Diff line
@@ -625,7 +625,7 @@ func (a *AARImport) JacocoReportClassesFile() android.Path {
}

func (a *AARImport) DepsMutator(ctx android.BottomUpMutatorContext) {
	if !ctx.Config().UnbundledBuildUsePrebuiltSdks() {
	if !ctx.Config().AlwaysUsePrebuiltSdks() {
		sdkDep := decodeSdkDep(ctx, sdkContext(a))
		if sdkDep.useModule && sdkDep.frameworkResModule != "" {
			ctx.AddVariationDependencies(nil, frameworkResTag, sdkDep.frameworkResModule)
+1 −0
Original line number Diff line number Diff line
@@ -2866,6 +2866,7 @@ func TestUncompressDex(t *testing.T) {
		config := testAppConfig(nil, bp, nil)
		if unbundled {
			config.TestProductVariables.Unbundled_build = proptools.BoolPtr(true)
			config.TestProductVariables.Always_use_prebuilt_sdks = proptools.BoolPtr(true)
		}

		ctx := testContext()
Loading