Call bootstrap when needed 54/172654/1
authorSangYong Park <sy302.park@samsung.com>
Thu, 15 Mar 2018 05:15:52 +0000 (14:15 +0900)
committerSangYong Park <sy302.park@samsung.com>
Thu, 15 Mar 2018 05:20:49 +0000 (14:20 +0900)
bootstrap and build take a lot of times.
bootstrap is not necessary without change build configuration.
so do not call after bootstrap is called once.

Change-Id: If17c5e2de9a8a6bb85de2bb9bd811b31a185a553
Signed-off-by: SangYong Park <sy302.park@samsung.com>
packaging/electron-efl.spec
tizen/script/build

index cbc261f..67b8cef 100755 (executable)
@@ -82,12 +82,14 @@ DEFINE_ARGS+="
 "
 %endif
 
+%if "%{?skipbootstrap}" != "1"
 ./script/bootstrap.py \
     --libcc_chromium_efl_path /usr/lib \
     --define "${DEFINE_ARGS}" \
     --dev \
     --disable_clang \
     -v
+%endif
 
 ./script/build.py -c D
 
index 7e8b86e..5ef809c 100755 (executable)
@@ -122,6 +122,8 @@ def build_gbs(profile, force_bootstrap, verbose):
   print 'Build : profile=' + profile + ' architecture=' + arch
   command = ['gbs', '--conf', os.path.join(SCRIPT_PATH, 'gbs.conf'), 'build',
              '-P', profile, '--include-all', '-A', arch, '--incremental']
+  if not force_bootstrap and not need_bootstrap(profile):
+    command.extend(['--define=skipbootstrap 1'])
   return True if subprocess.call(command) == 0 else False
 
 def find_architecture(profile):
@@ -132,6 +134,15 @@ def find_architecture(profile):
   arch = arch if arch != 'ia32' else 'i586'
   return arch
 
+def need_bootstrap(profile):
+  # TODO: condition improvement is necessary
+  if profile == 'desktop':
+    if os.path.isdir(os.path.join(ROOT_PATH, 'out')):
+      return False
+  elif os.path.isdir(os.path.join(ROOT_PATH, 'out.tizen', 'out')):
+    return False
+  return True
+
 def build_desktop(chromium_path, force_bootstrap, verbose):
   if chromium_path is None:
     parent_path = os.path.dirname(ROOT_PATH)
@@ -142,9 +153,10 @@ def build_desktop(chromium_path, force_bootstrap, verbose):
   else:
     chromium_path = os.path.abspath(chromium_path)
 
-  if not run_bootstrap(chromium_path, verbose):
-    print('Fail to run bootstrap script')
-    return False
+  if force_bootstrap or need_bootstrap('desktop'):
+    if not run_bootstrap(chromium_path, verbose):
+      print('Fail to run bootstrap script')
+      return False
 
   subprocess.call([os.path.join(ROOT_PATH, 'script', 'build.py'), '-c', 'D'])
   return True