Merge "java libs that isn't installable is gracefully rejected"
This commit is contained in:
@@ -477,7 +477,7 @@ func newApexFile(ctx android.BaseModuleContext, builtFile android.Path, moduleNa
|
||||
}
|
||||
|
||||
func (af *apexFile) Ok() bool {
|
||||
return af.builtFile != nil || af.builtFile.String() == ""
|
||||
return af.builtFile != nil && af.builtFile.String() != ""
|
||||
}
|
||||
|
||||
type apexBundle struct {
|
||||
|
@@ -3055,6 +3055,29 @@ func TestLegacyAndroid10Support(t *testing.T) {
|
||||
ensureContains(t, args["opt_flags"], "--manifest_json "+module.Output("apex_manifest.json").Output.String())
|
||||
}
|
||||
|
||||
func TestRejectNonInstallableJavaLibrary(t *testing.T) {
|
||||
testApexError(t, `"myjar" is not configured to be compiled into dex`, `
|
||||
apex {
|
||||
name: "myapex",
|
||||
key: "myapex.key",
|
||||
java_libs: ["myjar"],
|
||||
}
|
||||
|
||||
apex_key {
|
||||
name: "myapex.key",
|
||||
public_key: "testkey.avbpubkey",
|
||||
private_key: "testkey.pem",
|
||||
}
|
||||
|
||||
java_library {
|
||||
name: "myjar",
|
||||
srcs: ["foo/bar/MyClass.java"],
|
||||
sdk_version: "none",
|
||||
system_modules: "none",
|
||||
}
|
||||
`)
|
||||
}
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
run := func() int {
|
||||
setUp()
|
||||
|
Reference in New Issue
Block a user