AIDEGen: Build improve by disabling RunRoboTest

Bug: 117628424
Test: 1. cherry-pick
         aosp/790196
      2. aidegen Settings
      3. Time used to launch IntelliJ will be displayed in the command
         line output.

Change-Id: Idcf1243c1102b7d846fccce9287b6587baf97a79
diff --git a/aidegen/aidegen_main.py b/aidegen/aidegen_main.py
index 130dcad..c1eb4e3 100644
--- a/aidegen/aidegen_main.py
+++ b/aidegen/aidegen_main.py
@@ -43,6 +43,7 @@
 import logging
 import sys
 
+from aidegen.lib.common_util import time_logged
 from aidegen.lib.ide_util import launch_ide
 from aidegen.lib.module_info_util import ModuleInfoUtil
 from aidegen.lib.project_file_gen import generate_ide_project_file
@@ -91,6 +92,7 @@
     logging.basicConfig(level=level, format=log_format, datefmt=datefmt)
 
 
+@time_logged
 def main(argv):
     """Main entry.
 
diff --git a/aidegen/lib/common_util.py b/aidegen/lib/common_util.py
new file mode 100644
index 0000000..ecf4dcf
--- /dev/null
+++ b/aidegen/lib/common_util.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python3
+#
+# Copyright 2018 - 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.
+
+"""common_util
+
+This module has a collection of functions that provide helper functions to
+other modules.
+"""
+
+import functools
+import logging
+import time
+
+
+def time_logged(func):
+    """Decorate a function to find out how much time it spends.
+
+    Args:
+        func: a function is to be calculated its spending time.
+
+    Returns:
+        The wrapper function.
+    """
+
+    @functools.wraps(func)
+    def wrapper(*args, **kwargs):
+        """A wrapper function."""
+
+        start = time.time()
+        try:
+            return func(*args, **kwargs)
+        finally:
+            logging.debug('{}.{} time consumes: {:.2f}s'.format(
+                func.__module__, func.__name__,
+                time.time() - start))
+
+    return wrapper
diff --git a/aidegen/lib/module_info_util.py b/aidegen/lib/module_info_util.py
index 4754645..3bdc26f 100644
--- a/aidegen/lib/module_info_util.py
+++ b/aidegen/lib/module_info_util.py
@@ -31,6 +31,7 @@
 import os
 import sys
 
+from aidegen.lib.common_util import time_logged
 from aidegen.lib import errors
 from atest import atest_utils
 from atest import constants
@@ -44,7 +45,10 @@
 _KEY_DEP = 'dependencies'
 _KEY_SRCS = 'srcs'
 _MERGE_NEEDED_ITEMS = [_KEY_CLS, _KEY_PATH, _KEY_INS, _KEY_DEP, _KEY_SRCS]
-_BUILD_ENV_VARS = {'SOONG_COLLECT_JAVA_DEPS': 'true'}
+_BUILD_ENV_VARS = {
+    'SOONG_COLLECT_JAVA_DEPS' : 'true',
+    'DISABLE_ROBO_RUN_TESTS' : 'true'
+}
 _MODULES_IN = 'MODULES-IN-%s'
 _RELATIVE_PATH = '../'
 _INTELLIJ_PROJECT_FILE_EXT = '*.iml'
@@ -65,6 +69,7 @@
         """Return Atest module info instance."""
         return self._atest_module_info
 
+    @time_logged
     def generate_module_info_json(self, project, verbose):
         """Generate a merged json dictionary.