Loading apex/apex.go +0 −19 Original line number Diff line number Diff line Loading @@ -884,18 +884,6 @@ func apexFileForJavaLibrary(ctx android.BaseModuleContext, lib javaLibrary) apex return newApexFile(ctx, fileToCopy, lib.Name(), dirInApex, javaSharedLib, lib) } func apexFileForPrebuiltJavaLibrary(ctx android.BaseModuleContext, java *java.Import) apexFile { dirInApex := "javalib" // The output is only one, but for some reason, ImplementationJars returns Paths, not Path implJars := java.ImplementationJars() if len(implJars) != 1 { panic(fmt.Errorf("java.ImplementationJars() must return single Path, but got: %s", strings.Join(implJars.Strings(), ", "))) } fileToCopy := implJars[0] return newApexFile(ctx, fileToCopy, java.Name(), dirInApex, javaSharedLib, java) } func apexFileForPrebuiltEtc(ctx android.BaseModuleContext, prebuilt android.PrebuiltEtcModule, depName string) apexFile { dirInApex := filepath.Join("etc", prebuilt.SubDir()) fileToCopy := prebuilt.OutputFile() Loading Loading @@ -1043,13 +1031,6 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) { } filesInfo = append(filesInfo, newApexFile(ctx, pf, pf.Base(), "etc/permissions", etc, nil)) return true // track transitive dependencies } else if javaLib, ok := child.(*java.Import); ok { af := apexFileForPrebuiltJavaLibrary(ctx, javaLib) if !af.Ok() { ctx.PropertyErrorf("java_libs", "%q does not have a jar output", depName) } else { filesInfo = append(filesInfo, af) } } else { ctx.PropertyErrorf("java_libs", "%q of type %q is not supported", depName, ctx.OtherModuleType(child)) } Loading apex/apex_test.go +1 −10 Original line number Diff line number Diff line Loading @@ -372,7 +372,7 @@ func TestBasicApex(t *testing.T) { binaries: ["foo",], } }, java_libs: ["myjar", "myprebuiltjar"], java_libs: ["myjar"], } apex { Loading Loading @@ -447,12 +447,6 @@ func TestBasicApex(t *testing.T) { system_modules: "none", compile_dex: true, } java_import { name: "myprebuiltjar", jars: ["prebuilt.jar"], installable: true, } `) apexRule := ctx.ModuleForTests("myapex", "android_common_myapex_image").Rule("apexRule") Loading @@ -470,7 +464,6 @@ func TestBasicApex(t *testing.T) { // Ensure that apex variant is created for the direct dep ensureListContains(t, ctx.ModuleVariantsForTests("mylib"), "android_arm64_armv8-a_shared_myapex") ensureListContains(t, ctx.ModuleVariantsForTests("myjar"), "android_common_myapex") ensureListContains(t, ctx.ModuleVariantsForTests("myprebuiltjar"), "android_common_myapex") // Ensure that apex variant is created for the indirect dep ensureListContains(t, ctx.ModuleVariantsForTests("mylib2"), "android_arm64_armv8-a_shared_myapex") Loading @@ -480,7 +473,6 @@ func TestBasicApex(t *testing.T) { ensureContains(t, copyCmds, "image.apex/lib64/mylib.so") ensureContains(t, copyCmds, "image.apex/lib64/mylib2.so") ensureContains(t, copyCmds, "image.apex/javalib/myjar.jar") ensureContains(t, copyCmds, "image.apex/javalib/myprebuiltjar.jar") // .. but not for java libs ensureNotContains(t, copyCmds, "image.apex/javalib/myotherjar.jar") Loading @@ -489,7 +481,6 @@ func TestBasicApex(t *testing.T) { ensureListContains(t, ctx.ModuleVariantsForTests("mylib2"), "android_arm64_armv8-a_shared") ensureListContains(t, ctx.ModuleVariantsForTests("myjar"), "android_common") ensureListContains(t, ctx.ModuleVariantsForTests("myotherjar"), "android_common") ensureListContains(t, ctx.ModuleVariantsForTests("myprebuiltjar"), "android_common") // Ensure that all symlinks are present. found_foo_link_64 := false Loading Loading
apex/apex.go +0 −19 Original line number Diff line number Diff line Loading @@ -884,18 +884,6 @@ func apexFileForJavaLibrary(ctx android.BaseModuleContext, lib javaLibrary) apex return newApexFile(ctx, fileToCopy, lib.Name(), dirInApex, javaSharedLib, lib) } func apexFileForPrebuiltJavaLibrary(ctx android.BaseModuleContext, java *java.Import) apexFile { dirInApex := "javalib" // The output is only one, but for some reason, ImplementationJars returns Paths, not Path implJars := java.ImplementationJars() if len(implJars) != 1 { panic(fmt.Errorf("java.ImplementationJars() must return single Path, but got: %s", strings.Join(implJars.Strings(), ", "))) } fileToCopy := implJars[0] return newApexFile(ctx, fileToCopy, java.Name(), dirInApex, javaSharedLib, java) } func apexFileForPrebuiltEtc(ctx android.BaseModuleContext, prebuilt android.PrebuiltEtcModule, depName string) apexFile { dirInApex := filepath.Join("etc", prebuilt.SubDir()) fileToCopy := prebuilt.OutputFile() Loading Loading @@ -1043,13 +1031,6 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) { } filesInfo = append(filesInfo, newApexFile(ctx, pf, pf.Base(), "etc/permissions", etc, nil)) return true // track transitive dependencies } else if javaLib, ok := child.(*java.Import); ok { af := apexFileForPrebuiltJavaLibrary(ctx, javaLib) if !af.Ok() { ctx.PropertyErrorf("java_libs", "%q does not have a jar output", depName) } else { filesInfo = append(filesInfo, af) } } else { ctx.PropertyErrorf("java_libs", "%q of type %q is not supported", depName, ctx.OtherModuleType(child)) } Loading
apex/apex_test.go +1 −10 Original line number Diff line number Diff line Loading @@ -372,7 +372,7 @@ func TestBasicApex(t *testing.T) { binaries: ["foo",], } }, java_libs: ["myjar", "myprebuiltjar"], java_libs: ["myjar"], } apex { Loading Loading @@ -447,12 +447,6 @@ func TestBasicApex(t *testing.T) { system_modules: "none", compile_dex: true, } java_import { name: "myprebuiltjar", jars: ["prebuilt.jar"], installable: true, } `) apexRule := ctx.ModuleForTests("myapex", "android_common_myapex_image").Rule("apexRule") Loading @@ -470,7 +464,6 @@ func TestBasicApex(t *testing.T) { // Ensure that apex variant is created for the direct dep ensureListContains(t, ctx.ModuleVariantsForTests("mylib"), "android_arm64_armv8-a_shared_myapex") ensureListContains(t, ctx.ModuleVariantsForTests("myjar"), "android_common_myapex") ensureListContains(t, ctx.ModuleVariantsForTests("myprebuiltjar"), "android_common_myapex") // Ensure that apex variant is created for the indirect dep ensureListContains(t, ctx.ModuleVariantsForTests("mylib2"), "android_arm64_armv8-a_shared_myapex") Loading @@ -480,7 +473,6 @@ func TestBasicApex(t *testing.T) { ensureContains(t, copyCmds, "image.apex/lib64/mylib.so") ensureContains(t, copyCmds, "image.apex/lib64/mylib2.so") ensureContains(t, copyCmds, "image.apex/javalib/myjar.jar") ensureContains(t, copyCmds, "image.apex/javalib/myprebuiltjar.jar") // .. but not for java libs ensureNotContains(t, copyCmds, "image.apex/javalib/myotherjar.jar") Loading @@ -489,7 +481,6 @@ func TestBasicApex(t *testing.T) { ensureListContains(t, ctx.ModuleVariantsForTests("mylib2"), "android_arm64_armv8-a_shared") ensureListContains(t, ctx.ModuleVariantsForTests("myjar"), "android_common") ensureListContains(t, ctx.ModuleVariantsForTests("myotherjar"), "android_common") ensureListContains(t, ctx.ModuleVariantsForTests("myprebuiltjar"), "android_common") // Ensure that all symlinks are present. found_foo_link_64 := false Loading