Esempio n. 1
0
 def __git_clone_revision(self):
     # The commit is not yet known; clone into a temporary location to determine the commit and decide whether the
     # code for that revision is already present. If it is, use the existing code, as it may have already been built.
     tmp_dir_root = os.path.abspath((os.path.join(self.__output_root, 'build', 'tmp')))
     try:
         tmp_dir = os.path.abspath(os.path.join(tmp_dir_root, self._name))
         if not os.path.isdir(tmp_dir_root):
             os.makedirs(tmp_dir_root)
         tmp_log = os.path.abspath(os.path.join(tmp_dir_root, 'tmp_log.txt'))
         log_call(tmp_log, (TOOL_DEPENDENCIES['git'], 'clone', '--recurse-submodules', self.__location,
                  tmp_dir))
         os.chdir(tmp_dir)
         if self.__revision is not None:
             log_call(tmp_log, (TOOL_DEPENDENCIES['git'], 'checkout', self.__revision))
             log_call(tmp_log, (TOOL_DEPENDENCIES['git'], 'submodule', 'update', '--init'))
         commit = check_output((TOOL_DEPENDENCIES['git'], 'rev-parse', '--short', 'HEAD')).strip()
         self.__identifier = self._name + '_' + commit.decode()
         self._build_dir = os.path.abspath(os.path.join(self.__output_root, 'build', self.__identifier))
         logs_dir = os.path.abspath(os.path.join(self.__output_root, 'build', 'logs'))
         if not os.path.isdir(logs_dir):
             os.makedirs(logs_dir)
         self.__build_log = os.path.abspath(os.path.join(logs_dir, self.__identifier + '.txt'))
         if not os.path.exists(self._build_dir):
             shutil.move(tmp_log, self.__build_log)  # This build is being used, overwrite an existing log (if any).
             shutil.move(tmp_dir, self._build_dir)
         else:
             print("%s already present. Using existing source." % self._build_dir)
     finally:
         shutil.rmtree(tmp_dir_root)
def install_ion_c(log):
    log_call(log, (TOOL_DEPENDENCIES['cmake'], '-DCMAKE_BUILD_TYPE=Debug'))
    log_call(log, (TOOL_DEPENDENCIES['cmake'], '--build', '.'))
def install_ion_java(log):
    log_call(
        log,
        (TOOL_DEPENDENCIES['maven'], '-f', 'ion-java-cli/pom.xml', 'package'))
Esempio n. 4
0
def install_ion_js(log):
    log_call(log, (TOOL_DEPENDENCIES['npm'], 'install', '--ignore-scripts'))
    log_call(log, (TOOL_DEPENDENCIES['npm'], 'run-script', 'test-driver'))
    log_call(log, (TOOL_DEPENDENCIES['npm'], 'run-script', 'build-test-driver'))