Merge "Allow access to the class jar for java_import using {.jar} tag" am: a87ea4587d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1450820 Change-Id: I32200cbb541524bd73ba6695ace4b21162914529
This commit is contained in:
commit
d8c90a7e8d
11
java/java.go
11
java/java.go
|
@ -2711,6 +2711,17 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|||
}
|
||||
}
|
||||
|
||||
func (j *Import) OutputFiles(tag string) (android.Paths, error) {
|
||||
switch tag {
|
||||
case ".jar":
|
||||
return android.Paths{j.combinedClasspathFile}, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported module reference tag %q", tag)
|
||||
}
|
||||
}
|
||||
|
||||
var _ android.OutputFileProducer = (*Import)(nil)
|
||||
|
||||
var _ Dependency = (*Import)(nil)
|
||||
|
||||
func (j *Import) HeaderJars() android.Paths {
|
||||
|
|
|
@ -1412,7 +1412,31 @@ func TestJavaLibrary(t *testing.T) {
|
|||
name: "core",
|
||||
sdk_version: "none",
|
||||
system_modules: "none",
|
||||
}`),
|
||||
}
|
||||
|
||||
filegroup {
|
||||
name: "core-jar",
|
||||
srcs: [":core{.jar}"],
|
||||
}
|
||||
`),
|
||||
})
|
||||
ctx := testContext()
|
||||
run(t, ctx, config)
|
||||
}
|
||||
|
||||
func TestJavaImport(t *testing.T) {
|
||||
config := testConfig(nil, "", map[string][]byte{
|
||||
"libcore/Android.bp": []byte(`
|
||||
java_import {
|
||||
name: "core",
|
||||
sdk_version: "none",
|
||||
}
|
||||
|
||||
filegroup {
|
||||
name: "core-jar",
|
||||
srcs: [":core{.jar}"],
|
||||
}
|
||||
`),
|
||||
})
|
||||
ctx := testContext()
|
||||
run(t, ctx, config)
|
||||
|
|
Loading…
Reference in New Issue