X-Git-Url: https://git.ralfj.de/mass-build.git/blobdiff_plain/6809794087ce061ac5a0626c3f4c855c6e1b8f14..926f118078401d607fe72027dff6ff51de28e8f8:/kdebuildpy.py?ds=inline diff --git a/kdebuildpy.py b/kdebuildpy.py index bf2f2a3..99267e8 100755 --- a/kdebuildpy.py +++ b/kdebuildpy.py @@ -11,9 +11,9 @@ parser.add_argument("-c, --config", parser.add_argument("--reconfigure", action="store_true", dest="reconfigure", help="Force configuration to be run") -parser.add_argument("--phases", choices=["update", "configure", "compile"], nargs='*', metavar='PHASE', - dest="phases", default=["update", "configure", "compile"], - help="For each module, run the given phases in the given order. Possible phases are: update, configure, compile") +parser.add_argument("--no-update", + action="store_false", dest="update", + help="Do not update modules before compilation") parser.add_argument("--resume-from", metavar='MODULE', dest="resume_from", help="Resume building from the given repository") @@ -33,20 +33,20 @@ class Project: self.folder = folder self.name = module['name'] # VCS - vcsName = module.get('vcs', 'kde+git') - if vcsName == 'kde+git': - self.vcs = vcs.KDEGit(self.sourceFolder(), module['name'], module['version']) - elif vcsName == 'kde+svn': - self.vcs = vcs.KDESVN(self.sourceFolder(), module['svn-path']) + vcsName = module['vcs'] + if vcsName == 'git': + self.vcs = vcs.Git(self.sourceFolder(), module['url'], module['version']) + elif vcsName == 'svn': + self.vcs = vcs.SVN(self.sourceFolder(), module['url'], module.get('versionName')) else: raise Exception("Unknown VCS type "+vcsName) # build system if config.get('buildDeb', False): - self.buildSystem = build_system.AutoDebuild(self.sourceFolder(), module) + self.buildSystem = build_system.AutoDebuild(self.sourceFolder(), self.buildFolder(), module, self.vcs, config) else: - buildSystemName = module.get('build-system', 'cmake') + buildSystemName = module['buildSystem'] if buildSystemName == 'cmake': - self.buildSystem = build_system.CMake(self.sourceFolder(), self.buildFolder(), config) + self.buildSystem = build_system.CMake(self.sourceFolder(), self.buildFolder(), module, config) else: raise Exception("Unknown build system type "+buildSystemName) @@ -94,20 +94,12 @@ else: # and do it! for project in workProjects: try: - for phase in args.phases: - if phase == 'update': - print "Updating",project.sourceFolder() - project.vcs.update() - elif phase == 'configure': - print "Configuring",project.sourceFolder() - project.buildSystem.configure(force=args.reconfigure) - elif phase == 'compile': - print "Compiling",project.sourceFolder() - project.buildSystem.build() - print "Installing",project.sourceFolder() - project.buildSystem.install() - else: - raise Exception("Invalid phase "+phase) + if args.update: + print "Updating module",project.sourceFolder() + project.vcs.update() + print "Building module",project.sourceFolder() + project.buildSystem.build(reconfigure=args.reconfigure) + print except (subprocess.CalledProcessError, KeyboardInterrupt) as e: print >> sys.stderr print >> sys.stderr