Merge "Merge remote-tracking branch 'aosp/icu62' into aosp/master."
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index ecfae48..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2014 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 $(call all-subdir-makefiles)
diff --git a/tools/srcgen/Android.bp b/tools/srcgen/Android.bp
new file mode 100644
index 0000000..6d36c8f
--- /dev/null
+++ b/tools/srcgen/Android.bp
@@ -0,0 +1,22 @@
+// Copyright (C) 2015 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.
+
+// build the android_icu4j srcgen jar
+// ============================================================
+
+java_library_host {
+    name: "android_icu4j_srcgen",
+    libs: ["currysrc"],
+    srcs: ["src/**/*.java"],
+}
diff --git a/tools/srcgen/Android.mk b/tools/srcgen/Android.mk
deleted file mode 100644
index 72f36cd..0000000
--- a/tools/srcgen/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2015 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)
-
-#
-# Subprojects with separate makefiles
-#
-
-subdirs := currysrc
-subdir_makefiles := $(call all-named-subdir-makefiles,$(subdirs))
-
-# build the android_icu4j srcgen jar
-# ============================================================
-
-include $(CLEAR_VARS)
-LOCAL_IS_HOST_MODULE := true
-LOCAL_MODULE := android_icu4j_srcgen
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_JAVA_LIBRARIES := currysrc
-LOCAL_SRC_FILES := $(call all-java-files-under, src/)
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-include $(subdir_makefiles)
diff --git a/tools/srcgen/common.sh b/tools/srcgen/common.sh
index 8d2a47b..fd8e4b8 100644
--- a/tools/srcgen/common.sh
+++ b/tools/srcgen/common.sh
@@ -31,7 +31,7 @@
 ICU4J_DIR=${ANDROID_BUILD_TOP}/external/icu/icu4j
 ANDROID_ICU4J_DIR=${ANDROID_BUILD_TOP}/external/icu/android_icu4j
 
-CLASSPATH=${ANDROID_BUILD_TOP}/out/host/common/obj/JAVA_LIBRARIES/currysrc_intermediates/javalib.jar:${ANDROID_BUILD_TOP}/out/host/common/obj/JAVA_LIBRARIES/android_icu4j_srcgen_intermediates/javalib.jar
+CLASSPATH=${ANDROID_HOST_OUT}/framework/currysrc.jar:${ANDROID_HOST_OUT}/framework/android_icu4j_srcgen.jar
 
 # The parts of ICU4J to include during srcgen.
 #
diff --git a/tools/srcgen/currysrc/Android.bp b/tools/srcgen/currysrc/Android.bp
new file mode 100644
index 0000000..3b9d000
--- /dev/null
+++ b/tools/srcgen/currysrc/Android.bp
@@ -0,0 +1,49 @@
+// Copyright (C) 2015 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.
+
+// Host prebuilt dependencies.
+// ============================================================
+
+java_import_host {
+    name: "currysrc_org.eclipse",
+    jars: [
+        "libs/org.eclipse.core.contenttype_3.7.0.v20180426-1644.jar",
+        "libs/org.eclipse.core.jobs_3.10.0.v20180427-1454.jar",
+        "libs/org.eclipse.core.resources_3.13.0.v20180512-1138.jar",
+        "libs/org.eclipse.core.runtime_3.14.0.v20180417-0825.jar",
+        "libs/org.eclipse.equinox.common_3.10.0.v20180412-1130.jar",
+        "libs/org.eclipse.equinox.preferences_3.7.100.v20180510-1129.jar",
+        "libs/org.eclipse.jdt.core_3.14.0.v20180528-0519.jar",
+        "libs/org.eclipse.osgi_3.13.0.v20180409-1500.jar",
+        "libs/org.eclipse.text_3.6.300.v20180430-1330.jar",
+    ],
+    // Remove signature files found in META-INF/ that cause the combined jar to be rejected.
+    // http://b/111389216
+    exclude_files: [
+        "META-INF/ECLIPSE_.SF",
+        "META-INF/ECLIPSE_.RSA",
+    ],
+}
+
+// build currysrc jar
+// ============================================================
+
+java_library_host {
+    name: "currysrc",
+    static_libs: [
+        "currysrc_org.eclipse",
+        "guavalib"
+    ],
+    srcs: ["src/**/*.java"],
+}
diff --git a/tools/srcgen/currysrc/Android.mk b/tools/srcgen/currysrc/Android.mk
deleted file mode 100644
index fb1a765..0000000
--- a/tools/srcgen/currysrc/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (C) 2015 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)
-
-# Create a list of prebuilt jars relative to $(LOCAL_PATH). i.e. lib/xxx.jar
-prebuilt_jar_paths := $(strip \
-  $(foreach j,$(call all-named-files-under,*.jar,libs),$(if $(findstring .source_,$(j)),,$(j))))
-
-# For each data *.jar file, define a corresponding currysrc-prebuilt-* target. i.e. currysrc-prebuilt-xxx:libs/xxx.jar
-prebuilt_jar_mapping := $(foreach j,$(prebuilt_jar_paths),currysrc-prebuilt-$(basename $(notdir $(j))):$(j))
-
-# Create the list of target names each prebuilt will map to. i.e. currysrc-prebuilt-xxx
-prebuilt_target_names := $(foreach j,$(prebuilt_jar_mapping),$(call word-colon,1,$(j)))
-
-include $(CLEAR_VARS)
-LOCAL_MODULE_TAGS := optional
-LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := $(prebuilt_jar_mapping)
-include $(BUILD_HOST_PREBUILT)
-
-# build currysrc jar
-# ============================================================
-
-include $(CLEAR_VARS)
-LOCAL_IS_HOST_MODULE := true
-LOCAL_MODULE := currysrc
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_STATIC_JAVA_LIBRARIES := $(prebuilt_target_names) guavalib
-LOCAL_SRC_FILES := $(call all-java-files-under, src/)
-include $(BUILD_HOST_JAVA_LIBRARY)
-