Simplify build system interface: There is simply a single function to trigger configu...
[mass-build.git] / kdebuildpy.py
index 696c76f1e223e9cbb8b4b5b87779ff827371b77d..38e74c23905f541085bd99c478f2f4236d0d9587 100755 (executable)
@@ -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")
@@ -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