diff options
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 52 | 
1 files changed, 49 insertions, 3 deletions
| diff --git a/java/java.go b/java/java.go index d536ca11b..d7d271cca 100644 --- a/java/java.go +++ b/java/java.go @@ -248,6 +248,8 @@ type JavaInfo struct {  	// against this module.  If empty, ImplementationJars should be used instead.  	HeaderJars android.Paths +	RepackagedHeaderJars android.Paths +  	// set of header jars for all transitive libs deps  	TransitiveLibsHeaderJars *android.DepSet[android.Path] @@ -1837,6 +1839,7 @@ func (al *ApiLibrary) extractApiSrcs(ctx android.ModuleContext, rule *android.Ru  func (al *ApiLibrary) DepsMutator(ctx android.BottomUpMutatorContext) {  	apiContributions := al.properties.Api_contributions  	addValidations := !ctx.Config().IsEnvTrue("DISABLE_STUB_VALIDATION") && +		!ctx.Config().IsEnvTrue("WITHOUT_CHECK_API") &&  		proptools.BoolDefault(al.properties.Enable_validation, true)  	for _, apiContributionName := range apiContributions {  		ctx.AddDependency(ctx.Module(), javaApiContributionTag, apiContributionName) @@ -2089,6 +2092,16 @@ type ImportProperties struct {  		// that depend on this module, as well as to aidl for this module.  		Export_include_dirs []string  	} + +	// Name of the source soong module that gets shadowed by this prebuilt +	// If unspecified, follows the naming convention that the source module of +	// the prebuilt is Name() without "prebuilt_" prefix +	Source_module_name *string + +	// Non-nil if this java_import module was dynamically created by a java_sdk_library_import +	// The name is the undecorated name of the java_sdk_library as it appears in the blueprint file +	// (without any prebuilt_ prefix) +	Created_by_java_sdk_library_name *string `blueprint:"mutated"`  }  type Import struct { @@ -2162,12 +2175,20 @@ func (j *Import) PrebuiltSrcs() []string {  	return j.properties.Jars  } +func (j *Import) BaseModuleName() string { +	return proptools.StringDefault(j.properties.Source_module_name, j.ModuleBase.Name()) +} +  func (j *Import) Name() string {  	return j.prebuilt.Name(j.ModuleBase.Name())  }  func (j *Import) Stem() string { -	return proptools.StringDefault(j.properties.Stem, j.ModuleBase.Name()) +	return proptools.StringDefault(j.properties.Stem, j.BaseModuleName()) +} + +func (j *Import) CreatedByJavaSdkLibraryName() *string { +	return j.properties.Created_by_java_sdk_library_name  }  func (a *Import) JacocoReportClassesFile() android.Path { @@ -2453,6 +2474,10 @@ func (j *Import) RequiredFilesFromPrebuiltApex(_ android.BaseModuleContext) []st  	return requiredFilesFromPrebuiltApexForImport(name, &j.dexpreopter)  } +func (j *Import) UseProfileGuidedDexpreopt() bool { +	return proptools.Bool(j.importDexpreoptProperties.Dex_preopt.Profile_guided) +} +  // Add compile time check for interface implementation  var _ android.IDEInfo = (*Import)(nil)  var _ android.IDECustomizedModuleName = (*Import)(nil) @@ -2817,7 +2842,20 @@ func addCLCFromDep(ctx android.ModuleContext, depModule android.Module,  type JavaApiContributionImport struct {  	JavaApiContribution -	prebuilt android.Prebuilt +	prebuilt           android.Prebuilt +	prebuiltProperties javaApiContributionImportProperties +} + +type javaApiContributionImportProperties struct { +	// Name of the source soong module that gets shadowed by this prebuilt +	// If unspecified, follows the naming convention that the source module of +	// the prebuilt is Name() without "prebuilt_" prefix +	Source_module_name *string + +	// Non-nil if this java_import module was dynamically created by a java_sdk_library_import +	// The name is the undecorated name of the java_sdk_library as it appears in the blueprint file +	// (without any prebuilt_ prefix) +	Created_by_java_sdk_library_name *string `blueprint:"mutated"`  }  func ApiContributionImportFactory() android.Module { @@ -2825,7 +2863,7 @@ func ApiContributionImportFactory() android.Module {  	android.InitAndroidModule(module)  	android.InitDefaultableModule(module)  	android.InitPrebuiltModule(module, &[]string{""}) -	module.AddProperties(&module.properties) +	module.AddProperties(&module.properties, &module.prebuiltProperties)  	module.AddProperties(&module.sdkLibraryComponentProperties)  	return module  } @@ -2838,6 +2876,14 @@ func (module *JavaApiContributionImport) Name() string {  	return module.prebuilt.Name(module.ModuleBase.Name())  } +func (j *JavaApiContributionImport) BaseModuleName() string { +	return proptools.StringDefault(j.prebuiltProperties.Source_module_name, j.ModuleBase.Name()) +} + +func (j *JavaApiContributionImport) CreatedByJavaSdkLibraryName() *string { +	return j.prebuiltProperties.Created_by_java_sdk_library_name +} +  func (ap *JavaApiContributionImport) GenerateAndroidBuildActions(ctx android.ModuleContext) {  	ap.JavaApiContribution.GenerateAndroidBuildActions(ctx)  } |