aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTri Vo <trong@google.com>2017-02-08 23:45:08 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-02-08 23:45:08 +0000
commit863e0ee3ec23c595abe5b2c5193c3bdf43d29ce5 (patch)
tree3e7078097002111b5a9677ba93f7f3a468cc7be1
parentd0d80385dc3a5adc11d8e1de90d7b93a79817a61 (diff)
parent0809e5f4d09c16a1cd4ad88b401143b851de9e0f (diff)
downloadacloud-863e0ee3ec23c595abe5b2c5193c3bdf43d29ce5.tar.gz
Merge "Android.mk, setup.py, __main__.py to package acloud. Update README.md"
-rw-r--r--Android.mk39
-rwxr-xr-xREADME.md12
-rw-r--r--public/__main__.py29
-rw-r--r--setup.py40
4 files changed, 119 insertions, 1 deletions
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 00000000..18e8b089
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,39 @@
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := acloud.zip
+LOCAL_MODULE_PATH := $(HOST_OUT)/tools
+LOCAL_MODULE_CLASS := EXECUTABLE
+LOCAL_IS_HOST_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+$(LOCAL_BUILT_MODULE): $(SOONG_ZIP)
+ $(hide) mkdir -p $(dir $@)
+ @rm -f $@.list
+ # ! used because setup.py needs to reside in the same directory
+ # as acloud package for proper installation.
+ $(hide) find tools/acloud ! -name '*setup.py' -name '*.py' -or -name \
+ '*.config' -or -name 'LICENSE' -or -name '*.md' | sort > $@.list
+ $(hide) $(SOONG_ZIP) -d -o $@ -C tools/ -l $@.list -C tools/acloud \
+ -f tools/acloud/setup.py
+ @rm -f $@.list
+
+.PHONY: acloud
+acloud: $(LOCAL_MODULE)
diff --git a/README.md b/README.md
index e6f3e7f2..ab5678fd 100755
--- a/README.md
+++ b/README.md
@@ -1,4 +1,14 @@
The Cloud Android Driver Binaries (namely, acloud) in this project provide the
standard APIs to access and control Cloud Android devices (i.e., Android Virtual
Devices on Google Compute Engine) instantiated by using the Android source code
-(e.g., device/google/gce* projects). \ No newline at end of file
+
+#1. Compilation:
+
+ `$ make acloud` # this produces acloud.zip
+
+#2. Installation:
+
+ `$ pip install acloud.zip`
+
+#3. Execution:
+ `$ acloud <flags>
diff --git a/public/__main__.py b/public/__main__.py
new file mode 100644
index 00000000..5bba7896
--- /dev/null
+++ b/public/__main__.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 - The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import sys
+
+from acloud.public import acloud_main
+
+def main(arg=None):
+ """This is an entry point into acloud.
+
+ We need this because entry_point in setuptools must not take any arguments.
+ """
+ acloud_main.main(sys.argv[1:])
+
+if __name__ == "__main__":
+ main()
diff --git a/setup.py b/setup.py
new file mode 100644
index 00000000..1fa34070
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 - The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from setuptools import setup
+from setuptools import find_packages
+
+install_requires = [
+ 'python-dateutil',
+ 'protobuf',
+ 'google-api-python-client'
+]
+
+setup(
+ name='acloud',
+ version='0.1',
+ description='Cloud Android Driver',
+ license='Apache2.0',
+ packages=find_packages(),
+ include_package_data=False,
+ install_requires=install_requires,
+ url="http://www.android.com/",
+ entry_points={
+ 'console_scripts': [
+ 'acloud = acloud.public.__main__:main'
+ ]
+ }
+)