Loading rust/rust.go +3 −1 Original line number Diff line number Diff line Loading @@ -705,13 +705,15 @@ func (mod *Module) InstallInData() bool { func linkPathFromFilePath(filepath android.Path) string { return strings.Split(filepath.String(), filepath.Base())[0] } func libNameFromFilePath(filepath android.Path) string { libName := strings.Split(filepath.Base(), filepath.Ext())[0] libName := strings.TrimSuffix(filepath.Base(), filepath.Ext()) if strings.HasPrefix(libName, "lib") { libName = libName[3:] } return libName } func (mod *Module) DepsMutator(actx android.BottomUpMutatorContext) { ctx := &depsContext{ BottomUpMutatorContext: actx, Loading rust/rust_test.go +2 −2 Original line number Diff line number Diff line Loading @@ -114,13 +114,13 @@ func testRustError(t *testing.T, pattern string, bp string) { // Test that we can extract the lib name from a lib path. func TestLibNameFromFilePath(t *testing.T) { libBarPath := android.PathForTesting("out/soong/.intermediates/external/libbar/libbar/linux_glibc_x86_64_shared/libbar.so") libBarPath := android.PathForTesting("out/soong/.intermediates/external/libbar/libbar/linux_glibc_x86_64_shared/libbar.so.so") libLibPath := android.PathForTesting("out/soong/.intermediates/external/libbar/libbar/linux_glibc_x86_64_shared/liblib.dylib.so") libBarName := libNameFromFilePath(libBarPath) libLibName := libNameFromFilePath(libLibPath) expectedResult := "bar" expectedResult := "bar.so" if libBarName != expectedResult { t.Errorf("libNameFromFilePath returned the wrong name; expected '%#v', got '%#v'", expectedResult, libBarName) } Loading Loading
rust/rust.go +3 −1 Original line number Diff line number Diff line Loading @@ -705,13 +705,15 @@ func (mod *Module) InstallInData() bool { func linkPathFromFilePath(filepath android.Path) string { return strings.Split(filepath.String(), filepath.Base())[0] } func libNameFromFilePath(filepath android.Path) string { libName := strings.Split(filepath.Base(), filepath.Ext())[0] libName := strings.TrimSuffix(filepath.Base(), filepath.Ext()) if strings.HasPrefix(libName, "lib") { libName = libName[3:] } return libName } func (mod *Module) DepsMutator(actx android.BottomUpMutatorContext) { ctx := &depsContext{ BottomUpMutatorContext: actx, Loading
rust/rust_test.go +2 −2 Original line number Diff line number Diff line Loading @@ -114,13 +114,13 @@ func testRustError(t *testing.T, pattern string, bp string) { // Test that we can extract the lib name from a lib path. func TestLibNameFromFilePath(t *testing.T) { libBarPath := android.PathForTesting("out/soong/.intermediates/external/libbar/libbar/linux_glibc_x86_64_shared/libbar.so") libBarPath := android.PathForTesting("out/soong/.intermediates/external/libbar/libbar/linux_glibc_x86_64_shared/libbar.so.so") libLibPath := android.PathForTesting("out/soong/.intermediates/external/libbar/libbar/linux_glibc_x86_64_shared/liblib.dylib.so") libBarName := libNameFromFilePath(libBarPath) libLibName := libNameFromFilePath(libLibPath) expectedResult := "bar" expectedResult := "bar.so" if libBarName != expectedResult { t.Errorf("libNameFromFilePath returned the wrong name; expected '%#v', got '%#v'", expectedResult, libBarName) } Loading