added doc for running individual ltp test, automated package import change when building python protobuf
Change-Id: I9c08908dfb5523c1f831119c6e76196b9c1fadb7
diff --git a/build-python.sh b/build-python.sh
index c953714..93c97ff 100755
--- a/build-python.sh
+++ b/build-python.sh
@@ -1,20 +1,16 @@
#!/bin/bash
-# if "from future import standard_library" fails, please install future:
-# $ sudo apt-get install python-dev
-# $ sudo apt-get install python-pip
-# $ sudo apt-get install python-virtualbox
-# $ sudo pip install future
-# $ sudo pip install futures
-# $ sudo pip install enum
-# $ sudo pip install concurrent
-# $ sudo pip install protobuf
-# for protoc, please install protoc by:
-# $ apt-get install protobuf-compiler
+# Modify any import statements (to remove subdir path)
-python -m compileall .
-
-# modify any import statements (to remove subdir path)
+## Modify import statement in proto/AndroidSystemControlMessage.proto
+sed -i 's/import "test\/vts\/proto\/InterfaceSpecificationMessage.proto";/import "InterfaceSpecificationMessage.proto";/g' proto/AndroidSystemControlMessage.proto
+## Compile proto/AndroidSystemControlMessage.proto to .py code
protoc -I=proto --python_out=proto proto/AndroidSystemControlMessage.proto
+## Restore import statement in proto/AndroidSystemControlMessage.proto
+sed -i 's/import "InterfaceSpecificationMessage.proto";/import "test\/vts\/proto\/InterfaceSpecificationMessage.proto";/g' proto/AndroidSystemControlMessage.proto
+
protoc -I=proto --python_out=proto proto/InterfaceSpecificationMessage.proto
protoc -I=proto --python_out=proto proto/VtsReportMessage.proto
+
+# Compile all the python source codes
+python -m compileall .