diff --git a/java/androidmk.go b/java/androidmk.go index d37eac840..bbf2c3376 100644 --- a/java/androidmk.go +++ b/java/androidmk.go @@ -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{ @@ -578,35 +550,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:", diff --git a/java/sdk_library.go b/java/sdk_library.go index ff80d633b..51e680b7f 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -394,13 +394,6 @@ func (module *SdkLibrary) sdkVersionForStubsLibrary(mctx android.LoadHookContext } } -// $(INTERNAL_PLATFORM__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" } @@ -491,9 +484,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 @@ -572,10 +562,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)