Fix androidmk converting cc libraries
The java library rewrites should only happen for java modules, not cc modules. Test: Ran androidmk on a number of Android.mk files Change-Id: Ife2cfb5a69d7db37216671f08317033b99fcd3a1
This commit is contained in:
@@ -576,6 +576,19 @@ include $(call all-makefiles-under,$(LOCAL_PATH))
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
desc: "cc_library shared_libs",
|
||||||
|
in: `
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_SHARED_LIBRARIES := libfoo
|
||||||
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
`,
|
||||||
|
expected: `
|
||||||
|
cc_library_shared {
|
||||||
|
shared_libs: ["libfoo"],
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestEndToEnd(t *testing.T) {
|
func TestEndToEnd(t *testing.T) {
|
||||||
|
@@ -22,6 +22,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/google/blueprint/parser"
|
"github.com/google/blueprint/parser"
|
||||||
)
|
)
|
||||||
@@ -220,6 +221,10 @@ func (f *Fixer) rewriteIncorrectAndroidmkAndroidLibraries() error {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !strings.HasPrefix(mod.Type, "java_") && !strings.HasPrefix(mod.Type, "android_") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
hasAndroidLibraries := hasNonEmptyLiteralListProperty(mod, "android_libs")
|
hasAndroidLibraries := hasNonEmptyLiteralListProperty(mod, "android_libs")
|
||||||
hasStaticAndroidLibraries := hasNonEmptyLiteralListProperty(mod, "android_static_libs")
|
hasStaticAndroidLibraries := hasNonEmptyLiteralListProperty(mod, "android_static_libs")
|
||||||
hasResourceDirs := hasNonEmptyLiteralListProperty(mod, "resource_dirs")
|
hasResourceDirs := hasNonEmptyLiteralListProperty(mod, "resource_dirs")
|
||||||
|
Reference in New Issue
Block a user