Add java modules to soong_to_convert.txt

Test: examine soong_to_convert.txt
Change-Id: Ibb6db664238a4e98f5d8885dfb3ddc0f35d11ff6
diff --git a/core/Makefile b/core/Makefile
index a4f46ca..135422d 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -521,7 +521,7 @@
 SOONG_CONV_DATA := $(call intermediates-dir-for,PACKAGING,soong_conversion)/soong_conv_data
 $(SOONG_CONV_DATA):
 	@rm -f $@
-	@$(foreach s,$(SOONG_CONV),echo "$(s),$(sort $(SOONG_CONV.$(s).PROBLEMS)),$(sort $(filter-out $(SOONG_ALREADY_CONV),$(SOONG_CONV.$(s).DEPS)))" >>$@;)
+	@$(foreach s,$(SOONG_CONV),echo "$(s),$(SOONG_CONV.$(s).TYPE),$(sort $(SOONG_CONV.$(s).PROBLEMS)),$(sort $(filter-out $(SOONG_ALREADY_CONV),$(SOONG_CONV.$(s).DEPS)))" >>$@;)
 
 SOONG_TO_CONVERT_SCRIPT := build/tools/soong_to_convert.py
 SOONG_TO_CONVERT := $(PRODUCT_OUT)/soong_to_convert.txt
diff --git a/core/binary.mk b/core/binary.mk
index 6b65b6c..2f306b2 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -1889,6 +1889,7 @@
         $(my_whole_static_libraries) \
         $(my_shared_libraries) \
         $(my_system_shared_libraries))
+SOONG_CONV.$(LOCAL_MODULE).TYPE := native
 SOONG_CONV := $(SOONG_CONV) $(LOCAL_MODULE)
 endif
 
diff --git a/core/java_common.mk b/core/java_common.mk
index a90c779..a816324 100644
--- a/core/java_common.mk
+++ b/core/java_common.mk
@@ -1,5 +1,11 @@
 # Common to host and target Java modules.
 
+my_soong_problems :=
+
+ifneq ($(filter ../%,$(LOCAL_SRC_FILES)),)
+my_soong_problems += dotdot_srcs
+endif
+
 ###########################################################
 ## Java version
 ###########################################################
@@ -440,3 +446,17 @@
 my_common := COMMON
 include $(BUILD_SYSTEM)/link_type.mk
 endif  # !LOCAL_IS_HOST_MODULE
+
+ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
+
+SOONG_CONV.$(LOCAL_MODULE).PROBLEMS := \
+    $(SOONG_CONV.$(LOCAL_MODULE).PROBLEMS) $(my_soong_problems)
+SOONG_CONV.$(LOCAL_MODULE).DEPS := \
+    $(SOONG_CONV.$(LOCAL_MODULE).DEPS) \
+    $(LOCAL_STATIC_JAVA_LIBRARIES) \
+    $(LOCAL_JAVA_LIBRARIES) \
+    $(LOCAL_JNI_SHARED_LIBRARIES)
+SOONG_CONV.$(LOCAL_MODULE).TYPE := java
+SOONG_CONV := $(SOONG_CONV) $(LOCAL_MODULE)
+
+endif
diff --git a/tools/soong_to_convert.py b/tools/soong_to_convert.py
index 3d62d43..083f6f7 100755
--- a/tools/soong_to_convert.py
+++ b/tools/soong_to_convert.py
@@ -76,8 +76,10 @@
     problems = dict()
     deps = dict()
     reverse_deps = dict()
+    module_types = dict()
 
-    for (module, problem, dependencies) in reader:
+    for (module, module_type, problem, dependencies) in reader:
+        module_types[module] = module_type
         problems[module] = problem
         deps[module] = [d for d in dependencies.strip().split(' ') if d != ""]
         for dep in deps[module]:
@@ -94,16 +96,19 @@
         extra = ""
         if len(problems[module]) > 0:
             extra = " ({})".format(problems[module])
-        results.append((count_deps(reverse_deps, module, []), module + extra))
+        results.append((count_deps(reverse_deps, module, []), module + extra, module_types[module]))
 
     return sorted(results, key=lambda result: (-result[0], result[1]))
 
+def filter(results, module_type):
+    return [x for x in results if x[2] == module_type]
+
 def display(results):
     """Displays the results"""
     count_header = "# Blocked on"
     count_width = len(count_header)
     print("{} Module (potential problems)".format(count_header))
-    for (count, module) in results:
+    for (count, module, module_type) in results:
         print("{:>{}} {}".format(count, count_width, module))
 
 def main(filename):
@@ -111,7 +116,15 @@
     with open(filename, 'rb') as csvfile:
         results = process(csv.reader(csvfile))
 
-    display(results)
+    native_results = filter(results, "native")
+    java_results = filter(results, "java")
+
+    print("native modules ready to convert")
+    display(native_results)
+
+    print("")
+    print("java modules ready to convert")
+    display(java_results)
 
 if __name__ == "__main__":
     if len(sys.argv) != 2: