summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Donszelmann <Mark.Donszelmann@gmail.com>2007-07-09 03:50:18 +0000
committerMark Donszelmann <Mark.Donszelmann@gmail.com>2007-07-09 03:50:18 +0000
commit912baebd6dee1638e3c9f8f82fb846f7f7349261 (patch)
tree7511aa0d06b7f8826177a27d84b2e5da78278f4c /src
parent5b7e02aad6d9d09dc782f42d5e8feb0e384ec59e (diff)
downloadcpptasks-parallel-912baebd6dee1638e3c9f8f82fb846f7f7349261.tar.gz
cpptasks-parallel-912baebd6dee1638e3c9f8f82fb846f7f7349261.tar.bz2
cpptasks-parallel-912baebd6dee1638e3c9f8f82fb846f7f7349261.tar.xz
cpptasks-parallel-912baebd6dee1638e3c9f8f82fb846f7f7349261.zip
Fixed NARPLUGIN-112
Diffstat (limited to 'src')
-rw-r--r--src/net/sf/antcontrib/cpptasks/CCTask.java56
1 files changed, 55 insertions, 1 deletions
diff --git a/src/net/sf/antcontrib/cpptasks/CCTask.java b/src/net/sf/antcontrib/cpptasks/CCTask.java
index c38ba61..3825b22 100644
--- a/src/net/sf/antcontrib/cpptasks/CCTask.java
+++ b/src/net/sf/antcontrib/cpptasks/CCTask.java
@@ -16,6 +16,7 @@
*/
package net.sf.antcontrib.cpptasks;
import java.io.File;
+import java.io.FileFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Enumeration;
@@ -678,6 +679,11 @@ public class CCTask extends Task {
}
}
}
+
+// BEGINFREEHEP
+ Progress progress = new Progress(getObjdir(), rebuildCount);
+ progress.start();
+
for (int i = 0; i < targetVectors.length; i++) {
//
// get the targets for this configuration
@@ -711,6 +717,10 @@ public class CCTask extends Task {
break;
}
}
+
+// FREEHEP
+ progress.exit();
+
//
// save the details of the object file compilation
// settings to disk for dependency analysis
@@ -770,8 +780,10 @@ public class CCTask extends Task {
if (linkTarget.getRebuild()) {
LinkerConfiguration linkConfig = (LinkerConfiguration) linkTarget
.getConfiguration();
-// FREEHEP
+// BEGINFREEHEP
+ log("Linking...");
log("Starting link {"+linkConfig.getIdentifier()+"}");
+// ENDFREEHEP
if (failOnError) {
linkConfig.link(this, linkTarget);
} else {
@@ -798,6 +810,48 @@ public class CCTask extends Task {
}
}
}
+// BEGINFREEHEP
+ class Progress extends Thread {
+
+ private boolean stop = false;
+ private File objDir;
+ private int rebuildCount;
+
+ public Progress(File objDir, int rebuildCount) {
+ this.objDir = objDir;
+ this.rebuildCount = rebuildCount;
+ }
+
+ public void run() {
+ if (rebuildCount < 10) return;
+ try {
+ FileFilter updatedFiles = new FileFilter() {
+ private long startTime = System.currentTimeMillis();
+
+ public boolean accept(File file) {
+ return file.lastModified() > startTime && !file.getName().endsWith(".xml");
+ }
+ };
+ while (!stop) {
+ System.err.print("\r"+objDir.listFiles(updatedFiles).length+" / "+rebuildCount+" files compiled...");
+ System.err.flush();
+ Thread.sleep(5000);
+ }
+ } catch (InterruptedException e) {
+ }
+ System.err.print("\r ");
+ System.err.print("\r");
+ log(Integer.toString(rebuildCount) + " files were compiled.");
+ System.err.flush();
+ }
+
+ public void exit() {
+ stop = true;
+ }
+
+ }
+// ENDFREEHEP
+
/**
* Gets the dataset.
*