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

Commit a3fb67dd authored by Paul Duffin's avatar Paul Duffin
Browse files

Retry: "java_sdk_library: Do not expose stubs implementation jar"

The stubs header jar is optimized for use as a dependency for others
to use. It only changes if there is a significant difference in the
externals of the classes, i.e. anything that a library being compiled
against depends upon. So changes to implementations of method or the
addition/removal of private methods, fields will have no impact.

As there is no benefit in returning the implementation of the stubs
jar this change removes it. The implementation is still used when
taking a snapshot as the header jar is an internal build artefact
that is not suitable for long term snapshot.

Bug: 155164730
Test: m droid
(cherry picked from commit 23970f42)
Change-Id: I8277ec643837514d74cb57ad4f236ceb1f5c6c5b
parent 46fdda87
Loading
Loading
Loading
Loading
+4 −12
Original line number Diff line number Diff line
@@ -694,7 +694,7 @@ func (c *commonToSdkLibraryAndImport) findClosestScopePath(scope *apiScope) *sco
	return nil
}

func (c *commonToSdkLibraryAndImport) sdkJarsCommon(ctx android.BaseModuleContext, sdkVersion sdkSpec, headerJars bool) android.Paths {
func (c *commonToSdkLibraryAndImport) selectHeaderJarsForSdkVersion(ctx android.BaseModuleContext, sdkVersion sdkSpec) android.Paths {

	// If a specific numeric version has been requested then use prebuilt versions of the sdk.
	if sdkVersion.version.isNumbered() {
@@ -725,11 +725,7 @@ func (c *commonToSdkLibraryAndImport) sdkJarsCommon(ctx android.BaseModuleContex
		return nil
	}

	if headerJars {
	return paths.stubsHeaderPath
	} else {
		return paths.stubsImplPath
	}
}

type SdkLibrary struct {
@@ -1205,7 +1201,7 @@ func (module *SdkLibrary) sdkJars(ctx android.BaseModuleContext, sdkVersion sdkS
		return module.HeaderJars()
	}

	return module.sdkJarsCommon(ctx, sdkVersion, headerJars)
	return module.selectHeaderJarsForSdkVersion(ctx, sdkVersion)
}

// to satisfy SdkLibraryDependency interface
@@ -1644,11 +1640,7 @@ func (module *sdkLibraryImport) GenerateAndroidBuildActions(ctx android.ModuleCo
}

func (module *sdkLibraryImport) sdkJars(ctx android.BaseModuleContext, sdkVersion sdkSpec) android.Paths {

	// The java_sdk_library_import can only ever give back header jars as it does not
	// have an implementation jar.
	headerJars := true
	return module.sdkJarsCommon(ctx, sdkVersion, headerJars)
	return module.selectHeaderJarsForSdkVersion(ctx, sdkVersion)
}

// to satisfy SdkLibraryDependency interface