Merge "Convert external/sl4a to Android.bp"
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index b23c878..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-##  Copyright (C) 2016 Google, Inc.
-#
-##  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.
-#
-
-include $(call all-subdir-makefiles)
diff --git a/Common/Android.bp b/Common/Android.bp
new file mode 100644
index 0000000..4fc52b3
--- /dev/null
+++ b/Common/Android.bp
@@ -0,0 +1,37 @@
+//
+//  Copyright (C) 2017 Google, Inc.
+//
+//  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.
+//
+
+java_library {
+    name: "sl4a.Common",
+    owner: "google",
+
+    static_libs: [
+        "guava",
+        "android-common",
+        "sl4a.Utils",
+        "junit",
+    ],
+
+    libs: [
+        "telephony-common",
+        "ims-common",
+    ],
+
+    srcs: [
+        "src/com/googlecode/android_scripting/**/*.java",
+        "src/org/apache/commons/codec/**/*.java",
+    ],
+}
diff --git a/Common/Android.mk b/Common/Android.mk
deleted file mode 100644
index 18e93c3..0000000
--- a/Common/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-#  Copyright (C) 2017 Google, Inc.
-#
-#  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 := sl4a.Common
-LOCAL_MODULE_OWNER := google
-
-LOCAL_STATIC_JAVA_LIBRARIES := guava android-common sl4a.Utils junit
-LOCAL_JAVA_LIBRARIES := telephony-common
-LOCAL_JAVA_LIBRARIES += ims-common
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src/com/googlecode/android_scripting)
-LOCAL_SRC_FILES += $(call all-java-files-under, src/org/apache/commons/codec)
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/InterpreterForAndroid/Android.bp b/InterpreterForAndroid/Android.bp
new file mode 100644
index 0000000..452b65d
--- /dev/null
+++ b/InterpreterForAndroid/Android.bp
@@ -0,0 +1,29 @@
+//
+//  Copyright (C) 2017 Google, Inc.
+//
+//  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.
+//
+
+java_library {
+    name: "sl4a.InterpreterForAndroid",
+    owner: "google",
+    static_libs: [
+        "guava",
+        "android-common",
+        "sl4a.Utils",
+
+        //"android-support-v4",
+    ],
+
+    srcs: ["src/com/googlecode/android_scripting/**/*.java"],
+}
diff --git a/InterpreterForAndroid/Android.mk b/InterpreterForAndroid/Android.mk
deleted file mode 100644
index 8df90e1..0000000
--- a/InterpreterForAndroid/Android.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-#  Copyright (C) 2017 Google, Inc.
-#
-#  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 := sl4a.InterpreterForAndroid
-LOCAL_MODULE_OWNER := google
-LOCAL_STATIC_JAVA_LIBRARIES := guava android-common sl4a.Utils
-#LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4
-LOCAL_SRC_FILES := $(call all-java-files-under, src/com/googlecode/android_scripting)
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/ScriptingLayer/Android.bp b/ScriptingLayer/Android.bp
new file mode 100644
index 0000000..cf65c2e
--- /dev/null
+++ b/ScriptingLayer/Android.bp
@@ -0,0 +1,30 @@
+//
+//  Copyright (C) 2016 Google, Inc.
+//
+//  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.
+//
+
+java_library {
+    name: "sl4a.ScriptingLayer",
+    owner: "google",
+
+    static_libs: [
+        "guava",
+        "android-common",
+
+        "sl4a.Utils",
+        "sl4a.Common",
+    ],
+
+    srcs: ["src/com/googlecode/android_scripting/**/*.java"],
+}
diff --git a/ScriptingLayer/Android.mk b/ScriptingLayer/Android.mk
deleted file mode 100644
index 2871eff..0000000
--- a/ScriptingLayer/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-#  Copyright (C) 2016 Google, Inc.
-#
-#  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 := sl4a.ScriptingLayer
-LOCAL_MODULE_OWNER := google
-
-LOCAL_STATIC_JAVA_LIBRARIES := guava android-common
-LOCAL_STATIC_JAVA_LIBRARIES += sl4a.Utils sl4a.Common
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src/com/googlecode/android_scripting)
-
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/ScriptingLayerForAndroid/Android.bp b/ScriptingLayerForAndroid/Android.bp
new file mode 100644
index 0000000..0c66e15
--- /dev/null
+++ b/ScriptingLayerForAndroid/Android.bp
@@ -0,0 +1,64 @@
+//
+//  Copyright (C) 2016 Google, Inc.
+//
+//  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.
+//
+
+android_test_helper_app {
+    name: "sl4a",
+
+    test_suites: [
+        "pts",
+        "device-tests",
+    ],
+
+    platform_apis: true,
+    owner: "google",
+    dex_preopt: {
+        enabled: false,
+    },
+
+    certificate: "platform",
+
+    srcs: ["src/**/*.java"],
+    resource_dirs: ["res"],
+
+    aaptflags: ["--auto-add-overlay"],
+
+    compile_multilib: "both",
+
+    static_libs: [
+        "guava",
+        "android-common",
+        "sl4a.locale_platform",
+        "android-support-v4",
+
+        "sl4a.Utils",
+        "sl4a.Common",
+
+        "sl4a.InterpreterForAndroid",
+        "sl4a.ScriptingLayer",
+    ],
+
+    privileged: true,
+    optimize: {
+        enabled: false,
+    },
+
+    jni_libs: ["libcom_googlecode_android_scripting_Exec"],
+}
+
+java_import {
+    name: "sl4a.locale_platform",
+    jars: ["libs/locale_platform.jar"],
+}
diff --git a/ScriptingLayerForAndroid/Android.mk b/ScriptingLayerForAndroid/Android.mk
deleted file mode 100644
index 7539f72..0000000
--- a/ScriptingLayerForAndroid/Android.mk
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-#  Copyright (C) 2016 Google, Inc.
-#
-#  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_COMPATIBILITY_SUITE := pts device-tests
-LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG := true
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_PACKAGE_NAME := sl4a
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_MODULE_OWNER := google
-LOCAL_DEX_PREOPT := false
-
-LOCAL_CERTIFICATE := platform
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
-
-LOCAL_AAPT_FLAGS := --auto-add-overlay
-
-LOCAL_MULTILIB := both
-
-# Builds on the Data Partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := guava android-common locale_platform android-support-v4
-LOCAL_STATIC_JAVA_LIBRARIES += sl4a.Utils sl4a.Common
-LOCAL_STATIC_JAVA_LIBRARIES += sl4a.InterpreterForAndroid sl4a.ScriptingLayer
-
-LOCAL_PRIVILEGED_MODULE := true
-LOCAL_PROGUARD_ENABLED := disabled
-
-
-LOCAL_JNI_SHARED_LIBRARIES := libcom_googlecode_android_scripting_Exec
-
-include $(BUILD_PACKAGE)
-
-include $(CLEAR_VARS)
-LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := locale_platform:libs/locale_platform.jar
-include $(BUILD_MULTI_PREBUILT)
diff --git a/Utils/Android.bp b/Utils/Android.bp
new file mode 100644
index 0000000..d48d317
--- /dev/null
+++ b/Utils/Android.bp
@@ -0,0 +1,25 @@
+//
+//  Copyright (C) 2016 Google, Inc.
+//
+//  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.
+//
+
+java_library {
+    name: "sl4a.Utils",
+    owner: "google",
+    static_libs: [
+        "guava",
+        "android-common",
+    ],
+    srcs: ["src/**/*.java"],
+}
diff --git a/Utils/Android.mk b/Utils/Android.mk
deleted file mode 100644
index 5417389..0000000
--- a/Utils/Android.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-#  Copyright (C) 2016 Google, Inc.
-#
-#  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 := sl4a.Utils
-LOCAL_MODULE_OWNER := google
-LOCAL_STATIC_JAVA_LIBRARIES := guava android-common
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-include $(BUILD_STATIC_JAVA_LIBRARY)