Skip to content
Permalink
Browse files

[JENKINS-15534] compute maven modules disk usage

  • Loading branch information
ndeloof committed Jan 21, 2013
1 parent 89a4783 commit 4c30e5bdc92a27a7889b687575e947904e1c132f
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/main/java/hudson/plugins/disk_usage/DiskUsageThread.java
@@ -4,7 +4,9 @@
import hudson.FilePath;
import hudson.Util;
import hudson.matrix.MatrixProject;
import hudson.maven.MavenBuild;
import hudson.maven.MavenModuleSet;
import hudson.maven.MavenModuleSetBuild;
import hudson.model.AsyncPeriodicWork;
import hudson.model.Item;
import hudson.model.ItemGroup;
@@ -17,6 +19,7 @@
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;
@@ -96,6 +99,15 @@ private static void calculateDiskUsageForBuild(AbstractBuild build)
//Build disk usage has to be always recalculated to be kept up-to-date
//- artifacts might be kept only for the last build and users sometimes delete files manually as well.
long buildSize = DiskUsageCallable.getFileSize(build.getRootDir());
if (build instanceof MavenModuleSetBuild) {
Collection<List<MavenBuild>> builds = ((MavenModuleSetBuild) build).getModuleBuilds().values();
for (List<MavenBuild> mavenBuilds : builds) {
for (MavenBuild mavenBuild : mavenBuilds) {
calculateDiskUsageForBuild(mavenBuild);
}
}
}

BuildDiskUsageAction action = build.getAction(BuildDiskUsageAction.class);
boolean updateBuild = false;
if (action == null) {

0 comments on commit 4c30e5b

Please sign in to comment.
You can’t perform that action at this time.