+# an entire Project
+class Project:
+ def __init__(self, folder, projectConfig, globalConfig):
+ self.folder = folder
+ self.name = projectConfig['name']
+ # VCS
+ vcsName = projectConfig['vcs']
+ if vcsName == 'git':
+ self.vcs = vcs.Git(self.sourceFolder(), projectConfig['url'], projectConfig['version'])
+ elif vcsName == 'svn':
+ self.vcs = vcs.SVN(self.sourceFolder(), projectConfig['url'], projectConfig.get('versionName'))
+ else:
+ raise Exception("Unknown VCS type "+vcsName)
+ # build system
+ if globalConfig.get('buildDeb', False):
+ self.buildSystem = build_system.AutoDebuild(self.sourceFolder(), self.buildFolder(), projectConfig, self.vcs, globalConfig)
+ else:
+ buildSystemName = projectConfig['buildSystem']
+ if buildSystemName == 'cmake':
+ self.buildSystem = build_system.CMake(self.sourceFolder(), self.buildFolder(), projectConfig, globalConfig)
+ else:
+ raise Exception("Unknown build system type "+buildSystemName)
+
+ def sourceFolder(self):
+ return os.path.join(self.folder, self.name)
+
+ def buildFolder(self):
+ return os.path.join(config['buildDir'], self.sourceFolder())
+