chiark / gitweb /
Revert "Always print output directly if -v/--verbose"
authorDaniel Martí <mvdan@mvdan.cc>
Sun, 1 Sep 2013 15:45:09 +0000 (17:45 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Sun, 1 Sep 2013 15:45:09 +0000 (17:45 +0200)
This reverts commit 9e0908824549762e89f92b4a18bac7b14f3400ac.

fdroidserver/build.py

index 4ceb70e78e5f9067abd62e67cc5f64bcae1e2716..2f1188b38dfd2270d5728a4477e19ccfdc1c83df 100644 (file)
@@ -438,13 +438,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d
 
         if 'mvnflags' in thisbuild:
             mvncmd += thisbuild['mvnflags']
-
-        # Output directly to console
-        if options.verbose:
-            print "Running %s on %s" % (" ".join(mvncmd), root_dir)
-            p = subprocess.Popen(mvncmd, cwd=root_dir)
-        else:
-            p = subprocess.Popen(mvncmd, cwd=root_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+        p = subprocess.Popen(mvncmd, cwd=root_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     elif 'gradle' in thisbuild:
         print "Building Gradle project..."
         if '@' in thisbuild['gradle']:
@@ -484,31 +478,25 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d
         else:
             commands += ['assemble'+flavour+'Release']
 
-        # Output directly to console
         if verbose:
             print "Running %s on %s" % (" ".join(commands), gradle_dir)
-            p = subprocess.Popen(commands, cwd=gradle_dir)
-        else:
-            p = subprocess.Popen(commands, cwd=gradle_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+
+        p = subprocess.Popen(commands, cwd=gradle_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     else:
         print "Building Ant project..."
-        antcommands = ['ant']
         if install:
-            antcommands += ['debug','install']
+            antcommands = ['debug','install']
         elif 'antcommand' in thisbuild:
-            antcommands += [thisbuild['antcommand']]
+            antcommands = [thisbuild['antcommand']]
         else:
-            antcommands += ['release']
-
-        # Output directly to console
-        if verbose:
-            print "Running %s on %s" % (" ".join(antcommands), root_dir)
-            p = subprocess.Popen(antcommands, cwd=root_dir)
-        else:
-            p = subprocess.Popen(antcommands, cwd=root_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+            antcommands = ['release']
+        p = subprocess.Popen(['ant'] + antcommands, cwd=root_dir, 
+                stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     output, error = p.communicate()
     if p.returncode != 0:
         raise BuildException("Build failed for %s:%s" % (app['id'], thisbuild['version']), output.strip(), error.strip())
+    if verbose:
+        print output
     if install:
         if 'maven' in thisbuild:
             p = subprocess.Popen([mvn3, 'android:deploy', '-Dandroid.sdk.path=' + sdk_path],