Esempio n. 1
0
    def __call__(self, target, source, env):

        if not self._libraries:
            return None

        args = bjam_command(env, self._location, self._toolchain,
                            self._libraries, self._variant, self._target_arch,
                            self._linktype, self._stage_dir,
                            self._verbose_build, self._verbose_config,
                            self._job_count, self._parallel)

        processor = BjamOutputProcessor(env, self._verbose_build,
                                        self._verbose_config, self._toolchain)

        returncode = IncrementalSubProcess.Popen(processor,
                                                 args,
                                                 cwd=self._location)

        summary = processor.summary(returncode)

        if summary:
            print summary

        if returncode:
            return returncode

        return None
Esempio n. 2
0
    def __call__(self, target, source, env):

        if not self._libraries:
            return None

        stage_dir = stage_directory(self._toolchain, self._variant,
                                    self._target_arch,
                                    self._toolchain.abi_flag(env))
        args = self._build_command(env, self._toolchain, self._libraries,
                                   self._variant, self._target_arch,
                                   self._linktype, stage_dir)
        processor = BjamOutputProcessor(
            env, self._verbose_build, self._verbose_config,
            self._toolset_name_from_toolchain(self._toolchain))

        returncode = IncrementalSubProcess.Popen(processor,
                                                 args,
                                                 cwd=self._location)

        summary = processor.summary(returncode)

        if summary:
            print summary

        if returncode:
            return returncode

        return None
Esempio n. 3
0
def run_command(command, working_dir):
    print "coverage: {}".format(command)
    process_output = WriteToString()
    return_code = IncrementalSubProcess.Popen(process_output,
                                              shlex.split(command),
                                              cwd=working_dir)
    return return_code, process_output.string()
Esempio n. 4
0
def run_command(command, working_dir, env):
    process_output = WriteToString()
    return_code = IncrementalSubProcess.Popen(process_output,
                                              shlex.split(command),
                                              cwd=working_dir,
                                              scons_env=env)
    return return_code, process_output.string()
Esempio n. 5
0
    def __call__(self, target, source, env):

        if not os.path.exists(self._location + '/bjam'):
            self._build_bjam()

        library = self._library == 'log_setup' and 'log' or self._library
        toolchain = self._env['toolchain']
        stage_dir = os.path.join('build', toolchain.name(), self._variant)
        args = self._build_command(toolchain, library, self._variant,
                                   self._linktype, stage_dir)

        if cuppa.build_platform.name() == "Linux":
            self._update_project_config_jam(toolchain, self._location)

        try:
            IncrementalSubProcess.Popen(self.process_bjam_output,
                                        args,
                                        cwd=self._location)

            target_path = str(target[0])
            filename = os.path.split(target_path)[1]
            built_library_path = os.path.join(self._location, stage_dir, 'lib',
                                              filename)

            shutil.copy(built_library_path, target_path)
            return None

        except OSError as error:
            print 'Error building ' + self._library + '[' + str(
                error.args) + ']'
            return 1
Esempio n. 6
0
    def get_dependency_list(self, base_path, files, variant, env, project,
                            build_dir):

        tree_command = "scons --no-exec --tree=prune --" + variant + " --projects=" + project
        #print "Project Generator (CodeBlocks): Update using [" + tree_command + "]"

        if not self.excluded_paths_starting:
            self.excluded_paths_starting = [build_dir]

        tree_processor = ProcessTree(base_path, files, [env['branch_root']],
                                     self.excluded_paths_starting)

        IncrementalSubProcess.Popen(tree_processor, shlex.split(tree_command))
        return tree_processor.file_paths()
Esempio n. 7
0
    def __call__( self, target, source, env ):

        build_script_path = os.path.join( self._location, 'tools', 'build' )

        if self._version < 1.47:
            build_script_path = os.path.join( build_script_path, 'src', 'v2', 'engine' )

        elif self._version > 1.55:
            build_script_path = os.path.join( build_script_path, 'src', 'engine' )

        else:
            build_script_path = os.path.join( build_script_path, 'v2', 'engine' )

        bjam_build_script = './build.sh'
        if platform.system() == "Windows":
            bjam_build_script = os.path.join( build_script_path, 'build.bat' )

        logger.debug( "Execute [{}] from [{}]".format(
                bjam_build_script,
                str(build_script_path)
        ) )

        process_bjam_build = ProcessBjamBuild()

        try:
            IncrementalSubProcess.Popen(
                process_bjam_build,
                [ bjam_build_script ],
                cwd=build_script_path
            )

            bjam_exe_path = process_bjam_build.exe_path()

            if not bjam_exe_path:
                logger.critical( "Could not determine bjam exe path" )
                return 1

            bjam_binary_path = os.path.join( build_script_path, bjam_exe_path )

            shutil.copy( bjam_binary_path, target[0].path )

        except OSError as error:
            logger.critical( "Error building bjam [{}]".format( str( error.args ) ) )
            return 1

        return None
Esempio n. 8
0
    def _build_bjam(self):
        build_script_path = self._location + '/tools/build'

        if self._version < 1.47:
            build_script_path += '/src/v2/engine'

        elif self._version > 1.55:
            build_script_path += '/src/engine'

        else:
            build_script_path += '/v2/engine'

        ## TODO: change build script depending on platform
        bjam_build_script = './build.sh'

        print 'Execute ' + bjam_build_script + ' from ' + build_script_path

        process_bjam_build = ProcessBjamBuild()

        try:
            IncrementalSubProcess.Popen(process_bjam_build,
                                        [bjam_build_script],
                                        cwd=build_script_path)

            bjam_exe_path = process_bjam_build.exe_path()

            if not bjam_exe_path:
                print "Could not determine bjam exe path"
                return 1

            bjam_binary_path = build_script_path + '/' + bjam_exe_path

            shutil.copy(bjam_binary_path, self._location + '/bjam')

        except OSError as error:
            print 'Error building bjam [' + str(error.args) + ']'
            return 1