aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorNan Zhang <nanzhang@google.com>2017-12-01 06:19:27 +0000
committerNan Zhang <nanzhang@google.com>2017-12-01 06:19:27 +0000
commit0a32e5936b4c87bc705d06fa2d4f6fed1f58d602 (patch)
treeb614604c99116d2f0b66a6894cc4bce74e001613 /python
parent3bba05962dc4329c6e3d28544775db591574ba7b (diff)
downloadbuild_soong-0a32e5936b4c87bc705d06fa2d4f6fed1f58d602.tar.gz
build_soong-0a32e5936b4c87bc705d06fa2d4f6fed1f58d602.tar.bz2
build_soong-0a32e5936b4c87bc705d06fa2d4f6fed1f58d602.zip
Revert "Change Python in Soong to support device side build."
This reverts commit 3bba05962dc4329c6e3d28544775db591574ba7b. Reason for revert: <revert mac builds> Change-Id: I25f1380573d69f7e111287624a2d4a3d95fdd86b
Diffstat (limited to 'python')
-rw-r--r--python/androidmk.go6
-rw-r--r--python/binary.go8
-rw-r--r--python/installer.go31
-rw-r--r--python/library.go7
-rw-r--r--python/python.go4
-rw-r--r--python/test.go17
6 files changed, 16 insertions, 57 deletions
diff --git a/python/androidmk.go b/python/androidmk.go
index 5fa01abb..4c944508 100644
--- a/python/androidmk.go
+++ b/python/androidmk.go
@@ -39,7 +39,7 @@ func (p *Module) subAndroidMk(data *android.AndroidMkData, obj interface{}) {
}
func (p *Module) AndroidMk() android.AndroidMkData {
- ret := android.AndroidMkData{OutputFile: p.installSource}
+ ret := android.AndroidMkData{}
p.subAndroidMk(&ret, p.installer)
@@ -55,7 +55,7 @@ func (p *binaryDecorator) AndroidMk(base *Module, ret *android.AndroidMkData) {
strings.Join(p.binaryProperties.Test_suites, " "))
}
})
- base.subAndroidMk(ret, p.pythonInstaller)
+ base.subAndroidMk(ret, p.baseInstaller)
}
func (p *testDecorator) AndroidMk(base *Module, ret *android.AndroidMkData) {
@@ -67,7 +67,7 @@ func (p *testDecorator) AndroidMk(base *Module, ret *android.AndroidMkData) {
strings.Join(p.binaryDecorator.binaryProperties.Test_suites, " "))
}
})
- base.subAndroidMk(ret, p.binaryDecorator.pythonInstaller)
+ base.subAndroidMk(ret, p.binaryDecorator.baseInstaller)
}
func (installer *pythonInstaller) AndroidMk(base *Module, ret *android.AndroidMkData) {
diff --git a/python/binary.go b/python/binary.go
index 457c7fa0..14c49527 100644
--- a/python/binary.go
+++ b/python/binary.go
@@ -49,20 +49,24 @@ type BinaryProperties struct {
type binaryDecorator struct {
binaryProperties BinaryProperties
- *pythonInstaller
+ baseInstaller *pythonInstaller
}
type IntermPathProvider interface {
IntermPathForModuleOut() android.OptionalPath
}
+func (binary *binaryDecorator) install(ctx android.ModuleContext, file android.Path) {
+ binary.baseInstaller.install(ctx, file)
+}
+
var (
stubTemplateHost = "build/soong/python/scripts/stub_template_host.txt"
)
func NewBinary(hod android.HostOrDeviceSupported) (*Module, *binaryDecorator) {
module := newModule(hod, android.MultilibFirst)
- decorator := &binaryDecorator{pythonInstaller: NewPythonInstaller("bin", "")}
+ decorator := &binaryDecorator{baseInstaller: NewPythonInstaller("bin")}
module.bootstrapper = decorator
module.installer = decorator
diff --git a/python/installer.go b/python/installer.go
index ab3d9b4a..04698c55 100644
--- a/python/installer.go
+++ b/python/installer.go
@@ -15,47 +15,26 @@
package python
import (
- "path/filepath"
-
"android/soong/android"
)
// This file handles installing python executables into their final location
-type installLocation int
-
-const (
- InstallInData installLocation = iota
-)
-
type pythonInstaller struct {
- dir string
- dir64 string
- relative string
+ dir string
path android.OutputPath
}
-func NewPythonInstaller(dir, dir64 string) *pythonInstaller {
+func NewPythonInstaller(dir string) *pythonInstaller {
return &pythonInstaller{
- dir: dir,
- dir64: dir64,
+ dir: dir,
}
}
var _ installer = (*pythonInstaller)(nil)
-func (installer *pythonInstaller) installDir(ctx android.ModuleContext) android.OutputPath {
- dir := installer.dir
- if ctx.Arch().ArchType.Multilib == "lib64" && installer.dir64 != "" {
- dir = installer.dir64
- }
- if !ctx.Host() && !ctx.Arch().Native {
- dir = filepath.Join(dir, ctx.Arch().ArchType.String())
- }
- return android.PathForModuleInstall(ctx, dir, installer.relative)
-}
-
func (installer *pythonInstaller) install(ctx android.ModuleContext, file android.Path) {
- installer.path = ctx.InstallFile(installer.installDir(ctx), file.Base(), file)
+ installer.path = ctx.InstallFile(android.PathForModuleInstall(ctx, installer.dir),
+ file.Base(), file)
}
diff --git a/python/library.go b/python/library.go
index 65c1352e..58ee55fb 100644
--- a/python/library.go
+++ b/python/library.go
@@ -22,7 +22,6 @@ import (
func init() {
android.RegisterModuleType("python_library_host", PythonLibraryHostFactory)
- android.RegisterModuleType("python_library", PythonLibraryFactory)
}
func PythonLibraryHostFactory() android.Module {
@@ -30,9 +29,3 @@ func PythonLibraryHostFactory() android.Module {
return module.Init()
}
-
-func PythonLibraryFactory() android.Module {
- module := newModule(android.HostAndDeviceSupported, android.MultilibBoth)
-
- return module.Init()
-}
diff --git a/python/python.go b/python/python.go
index 05efbeae..9d6d6a79 100644
--- a/python/python.go
+++ b/python/python.go
@@ -558,9 +558,5 @@ func fillInMap(ctx android.ModuleContext, m map[string]string,
return true
}
-func (p *Module) InstallInData() bool {
- return true
-}
-
var Bool = proptools.Bool
var String = proptools.String
diff --git a/python/test.go b/python/test.go
index 825e63cc..de2b13e1 100644
--- a/python/test.go
+++ b/python/test.go
@@ -22,7 +22,6 @@ import (
func init() {
android.RegisterModuleType("python_test_host", PythonTestHostFactory)
- android.RegisterModuleType("python_test", PythonTestFactory)
}
type testDecorator struct {
@@ -30,18 +29,13 @@ type testDecorator struct {
}
func (test *testDecorator) install(ctx android.ModuleContext, file android.Path) {
- test.binaryDecorator.pythonInstaller.dir = "nativetest"
- test.binaryDecorator.pythonInstaller.dir64 = "nativetest64"
-
- test.binaryDecorator.pythonInstaller.relative = ctx.ModuleName()
-
- test.binaryDecorator.pythonInstaller.install(ctx, file)
+ test.binaryDecorator.baseInstaller.install(ctx, file)
}
func NewTest(hod android.HostOrDeviceSupported) *Module {
module, binary := NewBinary(hod)
- binary.pythonInstaller = NewPythonInstaller("nativetest", "nativetest64")
+ binary.baseInstaller = NewPythonInstaller("nativetest")
test := &testDecorator{binaryDecorator: binary}
@@ -56,10 +50,3 @@ func PythonTestHostFactory() android.Module {
return module.Init()
}
-
-func PythonTestFactory() android.Module {
- module := NewTest(android.HostAndDeviceSupported)
- module.multilib = android.MultilibBoth
-
- return module.Init()
-}