コード例 #1
0
 def _validate_vmake_installation(self):
     if OS_Utils.find_in_PATH("vmake") is not None:
         return
     if is_existing_file(
             join(self.build_cfg.vmake_instdir(), "pgm",
                  "vmake" if OS_Utils.is_UNIX() else "vmake.exe")):
         return
     raise XmakeException('Vmake was not found neither in PATH nor in %s.' %
                          (self.build_cfg.vmake_instdir()))
コード例 #2
0
 def _perl_instdir(self):
     '''determines a perl installation directory on the local host.
     if the PERL env var is set, this value is used. Otherwise, "perl" is being looked up in the PATH
     the first found entry from the PATH will be used / returned'''
     if 'PERL' in os.environ:
         return os.environ['PERL']
     perl_paths = OS_Utils.find_in_PATH('perl')
     if perl_paths is None:
         log.error(
             "could not determine perl installation directory (must either be set in env var 'PERL' or reside in PATH)",
             log.INFRA)
         raise XmakeException(
             "perl instalation directory could not be determined")
     # we arbitrarily choose the first found perl entry (instdir is two levels above perl binary)
     perl_instdir = os.path.abspath(
         os.path.join(perl_paths[0], os.path.pardir, os.path.pardir))
     log.info("using perl installation from " + perl_instdir)
     return perl_instdir
コード例 #3
0
 def _ant_executable(self):
     cmd = 'ant'  # +self.build_cfg.tools().tool_suffix('bat')
     if self._anthome is not None:
         self.java_exec_env.env['ANT_HOME'] = self._anthome
     if 'ANT_HOME' in self.java_exec_env.env:
         return join(self.java_exec_env.env['ANT_HOME'], 'bin', cmd)
     log.warning(
         'ANT_HOME was not set - falling back to using ant from PATH',
         log.INFRA)
     ant_executable = OS_Utils.find_in_PATH('ant')
     if ant_executable is not None:
         return ant_executable
     log.error(
         'ant was not found in PATH and ANT_HOME was not set - aborting build',
         log.INFRA)
     raise XmakeException(
         'ant was neither configured via ANT_HOME env var nor present in PATH'
     )