Merge "Remove duplicate entries from hiddenapi files" am: c6fcf29872
am: d32e59bb54
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1575170 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: If31c8c3b53942a9880266fe3623ee7cff6cb7703
This commit is contained in:
@@ -108,9 +108,18 @@ func (h *hiddenAPI) hiddenAPI(ctx android.ModuleContext, name string, primary bo
|
|||||||
// not on the list then that will cause failures in the CtsHiddenApiBlacklist...
|
// not on the list then that will cause failures in the CtsHiddenApiBlacklist...
|
||||||
// tests.
|
// tests.
|
||||||
if inList(bootJarName, ctx.Config().BootJars()) {
|
if inList(bootJarName, ctx.Config().BootJars()) {
|
||||||
// Create ninja rules to generate various CSV files needed by hiddenapi and store the paths
|
// More than one library with the same classes may need to be encoded but only one should be
|
||||||
// in the hiddenAPI structure.
|
// used as a source of information for hidden API processing otherwise it will result in
|
||||||
h.hiddenAPIGenerateCSV(ctx, implementationJar)
|
// duplicate entries in the files.
|
||||||
|
if primary {
|
||||||
|
// Create ninja rules to generate various CSV files needed by hiddenapi and store the paths
|
||||||
|
// in the hiddenAPI structure.
|
||||||
|
h.hiddenAPIGenerateCSV(ctx, implementationJar)
|
||||||
|
|
||||||
|
// Save the unencoded dex jar so it can be used when generating the
|
||||||
|
// hiddenAPISingletonPathsStruct.stubFlags file.
|
||||||
|
h.bootDexJarPath = dexJar
|
||||||
|
}
|
||||||
|
|
||||||
// If this module is actually on the boot jars list and not providing
|
// If this module is actually on the boot jars list and not providing
|
||||||
// hiddenapi information for a module on the boot jars list then encode
|
// hiddenapi information for a module on the boot jars list then encode
|
||||||
@@ -118,13 +127,6 @@ func (h *hiddenAPI) hiddenAPI(ctx android.ModuleContext, name string, primary bo
|
|||||||
if name == bootJarName {
|
if name == bootJarName {
|
||||||
hiddenAPIJar := android.PathForModuleOut(ctx, "hiddenapi", name+".jar").OutputPath
|
hiddenAPIJar := android.PathForModuleOut(ctx, "hiddenapi", name+".jar").OutputPath
|
||||||
|
|
||||||
// More than one library with the same classes can be encoded but only one can
|
|
||||||
// be added to the global set of flags, otherwise it will result in duplicate
|
|
||||||
// classes which is an error. Therefore, only add the dex jar of one of them
|
|
||||||
// to the global set of flags.
|
|
||||||
if primary {
|
|
||||||
h.bootDexJarPath = dexJar
|
|
||||||
}
|
|
||||||
hiddenAPIEncodeDex(ctx, hiddenAPIJar, dexJar, uncompressDex)
|
hiddenAPIEncodeDex(ctx, hiddenAPIJar, dexJar, uncompressDex)
|
||||||
dexJar = hiddenAPIJar
|
dexJar = hiddenAPIJar
|
||||||
}
|
}
|
||||||
|
@@ -109,10 +109,8 @@ func TestHiddenAPIIndexSingleton(t *testing.T) {
|
|||||||
hiddenAPIIndex := ctx.SingletonForTests("hiddenapi_index")
|
hiddenAPIIndex := ctx.SingletonForTests("hiddenapi_index")
|
||||||
indexRule := hiddenAPIIndex.Rule("singleton-merged-hiddenapi-index")
|
indexRule := hiddenAPIIndex.Rule("singleton-merged-hiddenapi-index")
|
||||||
checkRuleInputs(t, `
|
checkRuleInputs(t, `
|
||||||
.intermediates/bar.impl/android_common/hiddenapi/index.csv
|
|
||||||
.intermediates/bar/android_common/hiddenapi/index.csv
|
.intermediates/bar/android_common/hiddenapi/index.csv
|
||||||
.intermediates/foo/android_common/hiddenapi/index.csv
|
.intermediates/foo/android_common/hiddenapi/index.csv
|
||||||
.intermediates/prebuilt_foo/android_common/hiddenapi/index.csv
|
|
||||||
`,
|
`,
|
||||||
indexRule)
|
indexRule)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user