summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/androidmk.go8
-rw-r--r--python/binary.go2
-rw-r--r--python/library.go2
-rw-r--r--python/test.go12
4 files changed, 21 insertions, 3 deletions
diff --git a/python/androidmk.go b/python/androidmk.go
index 247b80dc0..8ad5889b5 100644
--- a/python/androidmk.go
+++ b/python/androidmk.go
@@ -15,11 +15,12 @@
package python
import (
- "android/soong/android"
"fmt"
"io"
"path/filepath"
"strings"
+
+ "android/soong/android"
)
type subAndroidMkProvider interface {
@@ -74,6 +75,11 @@ func (p *testDecorator) AndroidMk(base *Module, ret *android.AndroidMkData) {
if !BoolDefault(p.binaryProperties.Auto_gen_config, true) {
fmt.Fprintln(w, "LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG := true")
}
+
+ if len(p.data) > 0 {
+ fmt.Fprintln(w, "LOCAL_TEST_DATA :=",
+ strings.Join(android.AndroidMkDataPaths(p.data), " "))
+ }
})
base.subAndroidMk(ret, p.binaryDecorator.pythonInstaller)
}
diff --git a/python/binary.go b/python/binary.go
index 5a7492648..1d2400efd 100644
--- a/python/binary.go
+++ b/python/binary.go
@@ -79,7 +79,7 @@ func NewBinary(hod android.HostOrDeviceSupported) (*Module, *binaryDecorator) {
}
func PythonBinaryHostFactory() android.Module {
- module, _ := NewBinary(android.HostSupportedNoCross)
+ module, _ := NewBinary(android.HostSupported)
return module.Init()
}
diff --git a/python/library.go b/python/library.go
index 65c1352e7..0c8d61313 100644
--- a/python/library.go
+++ b/python/library.go
@@ -26,7 +26,7 @@ func init() {
}
func PythonLibraryHostFactory() android.Module {
- module := newModule(android.HostSupportedNoCross, android.MultilibFirst)
+ module := newModule(android.HostSupported, android.MultilibFirst)
return module.Init()
}
diff --git a/python/test.go b/python/test.go
index a669c73a6..434e71abf 100644
--- a/python/test.go
+++ b/python/test.go
@@ -34,6 +34,10 @@ type TestProperties struct {
// the name of the test configuration template (for example "AndroidTestTemplate.xml") that
// should be installed with the module.
Test_config_template *string `android:"path,arch_variant"`
+
+ // list of files or filegroup modules that provide data that should be installed alongside
+ // the test
+ Data []string `android:"path,arch_variant"`
}
type testDecorator struct {
@@ -42,6 +46,8 @@ type testDecorator struct {
testProperties TestProperties
testConfig android.Path
+
+ data []android.DataPath
}
func (test *testDecorator) bootstrapperProps() []interface{} {
@@ -59,6 +65,12 @@ func (test *testDecorator) install(ctx android.ModuleContext, file android.Path)
test.binaryDecorator.pythonInstaller.relative = ctx.ModuleName()
test.binaryDecorator.pythonInstaller.install(ctx, file)
+
+ dataSrcPaths := android.PathsForModuleSrc(ctx, test.testProperties.Data)
+
+ for _, dataSrcPath := range dataSrcPaths {
+ test.data = append(test.data, android.DataPath{SrcPath: dataSrcPath})
+ }
}
func NewTest(hod android.HostOrDeviceSupported) *Module {