Merge "Remove _API_FILE variables" into rvc-dev

This commit is contained in:
Anton Hansson 2020-04-19 07:54:27 +00:00 committed by Android (Google) Code Review
commit 39a06440cd
2 changed files with 8 additions and 67 deletions

View File

@ -472,34 +472,6 @@ func (ddoc *Droiddoc) AndroidMkEntries() []android.AndroidMkEntries {
if ddoc.Javadoc.stubsSrcJar != nil {
entries.SetPath("LOCAL_DROIDDOC_STUBS_SRCJAR", ddoc.Javadoc.stubsSrcJar)
}
apiFilePrefix := "INTERNAL_PLATFORM_"
if String(ddoc.properties.Api_tag_name) != "" {
apiFilePrefix += String(ddoc.properties.Api_tag_name) + "_"
}
if ddoc.apiFile != nil {
entries.SetPath(apiFilePrefix+"API_FILE", ddoc.apiFile)
}
if ddoc.dexApiFile != nil {
entries.SetPath(apiFilePrefix+"DEX_API_FILE", ddoc.dexApiFile)
}
if ddoc.privateApiFile != nil {
entries.SetPath(apiFilePrefix+"PRIVATE_API_FILE", ddoc.privateApiFile)
}
if ddoc.privateDexApiFile != nil {
entries.SetPath(apiFilePrefix+"PRIVATE_DEX_API_FILE", ddoc.privateDexApiFile)
}
if ddoc.removedApiFile != nil {
entries.SetPath(apiFilePrefix+"REMOVED_API_FILE", ddoc.removedApiFile)
}
if ddoc.removedDexApiFile != nil {
entries.SetPath(apiFilePrefix+"REMOVED_DEX_API_FILE", ddoc.removedDexApiFile)
}
if ddoc.exactApiFile != nil {
entries.SetPath(apiFilePrefix+"EXACT_API_FILE", ddoc.exactApiFile)
}
if ddoc.proguardFile != nil {
entries.SetPath(apiFilePrefix+"PROGUARD_FILE", ddoc.proguardFile)
}
},
},
ExtraFooters: []android.AndroidMkExtraFootersFunc{
@ -567,35 +539,18 @@ func (dstubs *Droidstubs) AndroidMkEntries() []android.AndroidMkEntries {
if dstubs.metadataZip != nil {
entries.SetPath("LOCAL_DROIDDOC_METADATA_ZIP", dstubs.metadataZip)
}
apiFilePrefix := "INTERNAL_PLATFORM_"
if String(dstubs.properties.Api_tag_name) != "" {
apiFilePrefix += String(dstubs.properties.Api_tag_name) + "_"
}
if dstubs.apiFile != nil {
entries.SetPath(apiFilePrefix+"API_FILE", dstubs.apiFile)
}
if dstubs.dexApiFile != nil {
entries.SetPath(apiFilePrefix+"DEX_API_FILE", dstubs.dexApiFile)
}
if dstubs.privateApiFile != nil {
entries.SetPath(apiFilePrefix+"PRIVATE_API_FILE", dstubs.privateApiFile)
}
if dstubs.privateDexApiFile != nil {
entries.SetPath(apiFilePrefix+"PRIVATE_DEX_API_FILE", dstubs.privateDexApiFile)
}
if dstubs.removedApiFile != nil {
entries.SetPath(apiFilePrefix+"REMOVED_API_FILE", dstubs.removedApiFile)
}
if dstubs.removedDexApiFile != nil {
entries.SetPath(apiFilePrefix+"REMOVED_DEX_API_FILE", dstubs.removedDexApiFile)
}
if dstubs.exactApiFile != nil {
entries.SetPath(apiFilePrefix+"EXACT_API_FILE", dstubs.exactApiFile)
}
},
},
ExtraFooters: []android.AndroidMkExtraFootersFunc{
func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) {
if dstubs.apiFile != nil {
fmt.Fprintf(w, ".PHONY: %s %s.txt\n", dstubs.Name(), dstubs.Name())
fmt.Fprintf(w, "%s %s.txt: %s\n", dstubs.Name(), dstubs.Name(), dstubs.apiFile)
}
if dstubs.removedApiFile != nil {
fmt.Fprintf(w, ".PHONY: %s %s.txt\n", dstubs.Name(), dstubs.Name())
fmt.Fprintf(w, "%s %s.txt: %s\n", dstubs.Name(), dstubs.Name(), dstubs.removedApiFile)
}
if dstubs.checkCurrentApiTimestamp != nil {
fmt.Fprintln(w, ".PHONY:", dstubs.Name()+"-check-current-api")
fmt.Fprintln(w, dstubs.Name()+"-check-current-api:",

View File

@ -373,13 +373,6 @@ func (module *SdkLibrary) sdkVersionForStubsLibrary(mctx android.LoadHookContext
}
}
// $(INTERNAL_PLATFORM_<apiTagName>_API_FILE) points to the generated
// api file for the current source
// TODO: remove this when apicheck is done in soong
func (module *SdkLibrary) apiTagName(apiScope *apiScope) string {
return strings.Replace(strings.ToUpper(module.BaseModuleName()), ".", "_", -1) + apiScope.apiFileMakeVariableSuffix
}
func (module *SdkLibrary) latestApiFilegroupName(apiScope *apiScope) string {
return ":" + module.BaseModuleName() + ".api." + apiScope.name + ".latest"
}
@ -470,9 +463,6 @@ func (module *SdkLibrary) createStubsSources(mctx android.LoadHookContext, apiSc
Libs []string
Arg_files []string
Args *string
Api_tag_name *string
Api_filename *string
Removed_api_filename *string
Java_version *string
Merge_annotations_dirs []string
Merge_inclusion_annotations_dirs []string
@ -555,10 +545,6 @@ func (module *SdkLibrary) createStubsSources(mctx android.LoadHookContext, apiSc
apiDir := module.getApiDir()
currentApiFileName = path.Join(apiDir, currentApiFileName)
removedApiFileName = path.Join(apiDir, removedApiFileName)
// TODO(jiyong): remove these three props
props.Api_tag_name = proptools.StringPtr(module.apiTagName(apiScope))
props.Api_filename = proptools.StringPtr(currentApiFileName)
props.Removed_api_filename = proptools.StringPtr(removedApiFileName)
// check against the not-yet-release API
props.Check_api.Current.Api_file = proptools.StringPtr(currentApiFileName)