Exemple #1
0
    def __init__(self, parent_project, name, libraries, source_files=None, path=None):
        """Create a new sample project."""

        super(SampleProject, self).__init__(name, libraries, path)

        self.parent_project = parent_project

        # Scan for source files
        if source_files is None:
            self.source_files = []

            for root, directories, files in os.walk(self.path):
                self.source_files += [os.path.join(root, file) for file in file_tools.filter(files, ["*.c", "*.cpp"])]
        else:
            self.source_files = source_files
Exemple #2
0
    def __init__(self, path, parent_project, name, libraries, source_files=None):
        """Create a new sample project."""

        super(SampleProject, self).__init__(path, name, libraries)

        self.parent_project = parent_project

        # Scan for source files
        if source_files is None:
            self.source_files = []

            for root, directories, files in os.walk(self.path.srcnode().abspath):
                self.source_files.extend(file_tools.filter(files, ['*.c', '*.cpp']))
        else:
            self.source_files = source_files
Exemple #3
0
    def __init__(self, path, name, major, minor, libraries, source_files, include_path=None):
        """Create a new LibraryProject reading from the specified path."""

        super(LibraryProject, self).__init__(path, name, libraries)

        self.major = major
        self.minor = minor
        self.source_files = source_files

        if include_path is None:
            self.include_path = os.path.join(self.path.srcnode().abspath, 'include', self.name)
        else:
            self.include_path = include_path

        # Scan for include files
        self.include_files = []

        for root, directories, files in os.walk(self.include_path):
            self.include_files += [os.path.join(root, file) for file in file_tools.filter(files, ['*.h', '*.hpp'])]
Exemple #4
0
    def __init__(self, name, major, minor, libraries, source_files, include_path=None, path=None):
        """Create a new ProgramProject reading from the specified path."""

        super(ProgramProject, self).__init__(name, libraries, path)

        self.major = major
        self.minor = minor
        self.source_files = source_files

        if include_path is None:
            self.include_path = os.path.join(self.path, "src")
        else:
            self.include_path = include_path

        # Scan for include files
        self.include_files = []

        for root, directories, files in os.walk(self.include_path):
            self.include_files += [os.path.join(root, file) for file in file_tools.filter(files, ["*.h", "*.hpp"])]