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

Commit b5ddfa92 authored by Jiyong Park's avatar Jiyong Park
Browse files

Remove srcs_lib and srcs_lib_whitelist_pkgs

They are no longer used. Sources are provided via filegroup.

Also removing the SrcDependency interface as it is no longer used.

Bug: 135922046
Test: m
Merged-In: I81f9614d20fbdd2f7d18340d6dbdb592e7acde06
(cherry picked from commit fa21cba6)
Change-Id: I81f9614d20fbdd2f7d18340d6dbdb592e7acde06
parent 28920659
Loading
Loading
Loading
Loading
+0 −30
Original line number Diff line number Diff line
@@ -61,12 +61,6 @@ type JavadocProperties struct {
	// list of java libraries that will be in the classpath.
	Libs []string `android:"arch_variant"`

	// the java library (in classpath) for documentation that provides java srcs and srcjars.
	Srcs_lib *string

	// List of packages to document from srcs_lib
	Srcs_lib_whitelist_pkgs []string

	// If set to false, don't allow this module(-docs.zip) to be exported. Defaults to true.
	Installable *bool

@@ -422,9 +416,6 @@ func (j *Javadoc) addDeps(ctx android.BottomUpMutatorContext) {
	}

	ctx.AddVariationDependencies(nil, libTag, j.properties.Libs...)
	if j.properties.Srcs_lib != nil {
		ctx.AddVariationDependencies(nil, srcsLibTag, *j.properties.Srcs_lib)
	}
}

func (j *Javadoc) collectAidlFlags(ctx android.ModuleContext, deps deps) droiddocBuilderFlags {
@@ -518,27 +509,6 @@ func (j *Javadoc) collectDeps(ctx android.ModuleContext) deps {
			default:
				ctx.ModuleErrorf("depends on non-java module %q", otherName)
			}
		case srcsLibTag:
			switch dep := module.(type) {
			case Dependency:
				srcs := dep.(SrcDependency).CompiledSrcs()
				for _, src := range srcs {
					if _, ok := src.(android.WritablePath); ok { // generated sources
						deps.srcs = append(deps.srcs, src)
					} else { // select source path for documentation based on whitelist path prefixs.
						for _, pkg := range j.properties.Srcs_lib_whitelist_pkgs {
							pkgAsPath := filepath.Join(strings.Split(pkg, ".")...)
							if strings.HasPrefix(src.Rel(), pkgAsPath) {
								deps.srcs = append(deps.srcs, src)
								break
							}
						}
					}
				}
				deps.srcJars = append(deps.srcJars, dep.(SrcDependency).CompiledSrcJars()...)
			default:
				ctx.ModuleErrorf("depends on non-java module %q", otherName)
			}
		case systemModulesTag:
			if deps.systemModules != nil {
				panic("Found two system module dependencies")
+1 −17
Original line number Diff line number Diff line
@@ -404,29 +404,14 @@ type SdkLibraryDependency interface {
	SdkImplementationJars(ctx android.BaseModuleContext, sdkVersion string) android.Paths
}

type SrcDependency interface {
	CompiledSrcs() android.Paths
	CompiledSrcJars() android.Paths
}

type xref interface {
	XrefJavaFiles() android.Paths
}

func (j *Module) CompiledSrcs() android.Paths {
	return j.compiledJavaSrcs
}

func (j *Module) CompiledSrcJars() android.Paths {
	return j.compiledSrcJars
}

func (j *Module) XrefJavaFiles() android.Paths {
	return j.kytheFiles
}

var _ SrcDependency = (*Module)(nil)

func InitJavaModule(module android.DefaultableModule, hod android.HostOrDeviceSupported) {
	android.InitAndroidArchModule(module, hod, android.MultilibCommon)
	android.InitDefaultableModule(module)
@@ -1033,8 +1018,7 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
		srcJars = append(srcJars, aaptSrcJar)
	}

	// Collect source files from compiledJavaSrcs, compiledSrcJars and filter out Exclude_srcs
	// that IDEInfo struct will use
	// Collect source files and filter out Exclude_srcs that IDEInfo struct will use
	j.expandIDEInfoCompiledSrcs = append(j.expandIDEInfoCompiledSrcs, srcFiles.Strings()...)

	if j.properties.Jarjar_rules != nil {
+0 −10
Original line number Diff line number Diff line
@@ -100,12 +100,6 @@ type sdkLibraryProperties struct {
	//  $(location <label>): the path to the droiddoc_option_files with name <label>
	Droiddoc_options []string

	// the java library (in classpath) for documentation that provides java srcs and srcjars.
	Srcs_lib *string

	// list of packages to document from srcs_lib. Defaults to "android.annotation".
	Srcs_lib_whitelist_pkgs []string

	// a list of top-level directories containing files to merge qualifier annotations
	// (i.e. those intended to be included in the stubs written) from.
	Merge_annotations_dirs []string
@@ -438,8 +432,6 @@ func (module *SdkLibrary) createDocs(mctx android.LoadHookContext, apiScope apiS
		Name                             *string
		Srcs                             []string
		Installable                      *bool
		Srcs_lib                         *string
		Srcs_lib_whitelist_pkgs          []string
		Sdk_version                      *string
		Libs                             []string
		Arg_files                        []string
@@ -529,8 +521,6 @@ func (module *SdkLibrary) createDocs(mctx android.LoadHookContext, apiScope apiS
	props.Check_api.Last_released.Removed_api_file = proptools.StringPtr(
		module.latestRemovedApiFilegroupName(apiScope))
	props.Check_api.Ignore_missing_latest_api = proptools.BoolPtr(true)
	props.Srcs_lib = module.sdkLibraryProperties.Srcs_lib
	props.Srcs_lib_whitelist_pkgs = module.sdkLibraryProperties.Srcs_lib_whitelist_pkgs

	mctx.CreateModule(android.ModuleFactoryAdaptor(DroidstubsFactory), &props)
}