Strip META-INF/services from implementation jars when using as header jars
If a header jar couldn't be built (for example when an API generating
annoation processor is in use) the implementation jar is reused as the
header jar. If the implementation jar contains an annotation processor
listed in META-INF/services/javax.annotation.processing.Processor then
later javac executions with the implementation jar in the classpath
could attempt to run the annotation processors unexpectedly. Remove
the META-INF/services directory when using an implementation jar as
a header jar.
Bug: 290933559
Test: builds
(cherry picked from commit f06d8dc8e3
)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d3b1b77184b1c002136039e70074899a35b1ed77)
Merged-In: I40d48644bc5a09a9564dc2c4b38f627edd00fcf8
Change-Id: I40d48644bc5a09a9564dc2c4b38f627edd00fcf8
This commit is contained in:
committed by
Cherrypicker Worker
parent
66eca9b580
commit
9bc4228f88
@@ -71,8 +71,8 @@ func TestJavaFuzz(t *testing.T) {
|
||||
}
|
||||
|
||||
baz := result.ModuleForTests("baz", osCommonTarget).Rule("javac").Output.String()
|
||||
barOut := filepath.Join("out", "soong", ".intermediates", "bar", osCommonTarget, "javac", "bar.jar")
|
||||
bazOut := filepath.Join("out", "soong", ".intermediates", "baz", osCommonTarget, "javac", "baz.jar")
|
||||
barOut := filepath.Join("out", "soong", ".intermediates", "bar", osCommonTarget, "javac-header", "bar.jar")
|
||||
bazOut := filepath.Join("out", "soong", ".intermediates", "baz", osCommonTarget, "javac-header", "baz.jar")
|
||||
|
||||
android.AssertStringDoesContain(t, "foo classpath", javac.Args["classpath"], barOut)
|
||||
android.AssertStringDoesContain(t, "foo classpath", javac.Args["classpath"], bazOut)
|
||||
|
Reference in New Issue
Block a user