Add java_test and java_test_host
java_test is equivalent to a java_library with a default junit dependency and marked as a test in Make for installation and automatic AndroidTest.xml generation. Bug: 70770641 Test: m checkbuild Change-Id: I9ca97521e952d121db46abff6f24f274dd7a3ad7
This commit is contained in:
@@ -97,6 +97,19 @@ func (library *Library) AndroidMk() android.AndroidMkData {
|
||||
}
|
||||
}
|
||||
|
||||
func (j *Test) AndroidMk() android.AndroidMkData {
|
||||
data := j.Library.AndroidMk()
|
||||
data.Extra = append(data.Extra, func(w io.Writer, outputFile android.Path) {
|
||||
fmt.Fprintln(w, "LOCAL_MODULE_TAGS := tests")
|
||||
if len(j.testProperties.Test_suites) > 0 {
|
||||
fmt.Fprintln(w, "LOCAL_COMPATIBILITY_SUITE :=",
|
||||
strings.Join(j.testProperties.Test_suites, " "))
|
||||
}
|
||||
})
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
func (prebuilt *Import) AndroidMk() android.AndroidMkData {
|
||||
return android.AndroidMkData{
|
||||
Class: "JAVA_LIBRARIES",
|
||||
|
Reference in New Issue
Block a user