Exemplo n.º 1
0
 def _check_toolchain_path(self):
     try:
         subprocess.check_output([self.__linker_path, self.__version_flag])
         subprocess.check_output([self.__compiler_path, self.__version_flag])
     except FileNotFoundError:
         logger.error("Can not find the compilers executable, check if the compilers path is correct or if the compiler is in a PATH.")
         exit(-1)
Exemplo n.º 2
0
 def read_config_file(self, config_yaml_file):
     try:
         with open(config_yaml_file, 'r') as config_file:
             self.configuration = yaml.load(config_file)
     except FileNotFoundError:
         logger.error('Given configuration file does not exist.')
         exit(-1)
Exemplo n.º 3
0
    def _check_config(self):
        try:
            self.__command_execution_location = self.configuration["location"]
        except KeyError:
            logger.warning(
                "location not set, executing from current directory.")
            self.__command_execution_location = "./"

        try:
            self.__commands = self.configuration["commands"]
        except KeyError:
            logger.error("no commands given.")
            exit(-1)
Exemplo n.º 4
0
    def _check_config(self):
        try:
            self.__repository_location = self.configuration["repo_location"]
        except KeyError:
            logger.error("No repository location given")
            exit(-1)

        try:
            self.__clone_destination = self.configuration["destination"]
        except KeyError:
            logger.error("No clone destination given")
            exit(-1)

        try:
            self.__branch = self.configuration["branch"]
        except KeyError:
            logger.debug("Pulling master branch")
            self.__branch = "master"
Exemplo n.º 5
0
    def _check_compiler_config_file(self):
        try:
            with open(os.path.join(path_to_configs, self.__choosen_compiler + ".yaml").replace("\\", "/"), "r") as compiler_config_file:
                compiler_config = yaml.load(compiler_config_file)

        except FileNotFoundError:
            logger.error("Configuration file for the compiler was not found.")
            exit(-1)

        self.__compiler_name = compiler_config["compiler"]
        self.__linker_name = compiler_config["linker"]

        self.__define_flag = compiler_config["define_flag"]
        self.__output_flag = compiler_config["output_flag"]
        self.__compile_flag = compiler_config["compile_flag"]
        self.__include_flag = compiler_config["include_flag"]
        self.__version_flag = compiler_config["version_flag"]
        self.__command_line_file = compiler_config["comand_line_file"]
Exemplo n.º 6
0
    def _check_config(self):
        try:
            self.__choosen_compiler = self.configuration["compiler"]
        except KeyError:
            logger.error("You must provide compiler name in a compiler configuration file")
            exit(-1)

        try:
            self.__compiler_flags = self.configuration["compiler_flags"]
        except KeyError:
            logger.warning("no compiler_flags_set")
            self.__compiler_flags = []

        try:
            self.__linker_flags = self.configuration["linker_flags"]
        except KeyError:
            logger.warning("no linker_flags")
            self.__linker_flags = []
Exemplo n.º 7
0
    def create(step_config, object_to_inject=None):
        step_identifier = list(step_config.keys())[0].split(" ")

        step_type = step_identifier[0]
        step_name = " ".join(step_identifier[1:])

        if 'compile' in step_type:
            return StepCompile(step_config, step_name,
                               object_to_inject.get_compiler())
        elif 'link' in step_type:
            return StepLink(step_config, step_name,
                            object_to_inject.get_linker())
        elif 'git' in step_type:
            return StepGit(step_config, step_name)
        elif 'command' in step_type:
            return StepCommand(step_config, step_name)
        else:
            logger.error('Unsuported step type')
            exit(-1)
Exemplo n.º 8
0
    def _check_config(self):
        try:
            self.__source_directories = self.configuration[
                "source_directories"]
        except KeyError:
            logger.error("No source directories given")
            exit(-1)

        try:
            self.__output_directory = self.configuration["output_direcotry"]
        except KeyError:
            logger.error("No output directory given")
            exit(-1)

        try:
            self.__types = self.configuration["types"]
        except KeyError:
            logger.error("No type given")
            exit(-1)

        try:
            self.__additional_flags = self.configuration["additional_flags"]
        except KeyError:
            #  logger.debug("No additional flags provided")
            self.__additional_flags = []

        try:
            self.__search_subdirectories = self.configuration[
                "search_subdirectories"]
        except KeyError:
            # logger.debug("Setting default search_subdirectories -- true")
            self.__search_subdirectories = True
Exemplo n.º 9
0
    def _check_config(self):
        try:
            self.__source_directories = self.configuration[
                "source_directories"]
        except KeyError:
            logger.error("No source directories given")
            exit(-1)

        try:
            self.__output_file = self.configuration["output_file"]
        except KeyError:
            logger.error("No output directory given")
            exit(-1)

        try:
            self.__types = self.configuration["types"]
        except KeyError:
            logger.error("No type given")
            exit(-1)

        try:
            self.__additional_flags = self.configuration["additional_flags"]
        except KeyError:
            logger.debug("additional_flags not set.")
            self.__additional_flags = []