diff --git a/core/src/main/java/hudson/matrix/LinkedLogRotator.java b/core/src/main/java/hudson/matrix/LinkedLogRotator.java index 8aa421e9cb15e7f6f520a8c86e7ae0e13079b4d8..4f3d62a5d5386bff36bbe86369b5f0e5ad91c0a9 100644 --- a/core/src/main/java/hudson/matrix/LinkedLogRotator.java +++ b/core/src/main/java/hudson/matrix/LinkedLogRotator.java @@ -1,7 +1,7 @@ /* * The MIT License * - * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi + * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -40,15 +40,25 @@ import java.io.IOException; * @author Kohsuke Kawaguchi */ final class LinkedLogRotator extends LogRotator { + LinkedLogRotator(int artifactDaysToKeep, int artifactNumToKeep) { + super(-1, -1, artifactDaysToKeep, artifactNumToKeep); + } + + /** + * @deprecated since 1.369 + * Use {@link #LinkedLogRotator(int, int)} + */ LinkedLogRotator() { - super(-1,-1); + super(-1, -1, -1, -1); } @Override public void perform(Job _job) throws IOException, InterruptedException { - // copy it to the array because we'll be deleting builds as we go. + // Let superclass handle clearing artifacts, if configured: + super.perform(_job); MatrixConfiguration job = (MatrixConfiguration) _job; + // copy it to the array because we'll be deleting builds as we go. for( MatrixRun r : job.getBuilds().toArray(new MatrixRun[0]) ) { if(job.getParent().getBuildByNumber(r.getNumber())==null) r.delete(); diff --git a/core/src/main/java/hudson/matrix/MatrixConfiguration.java b/core/src/main/java/hudson/matrix/MatrixConfiguration.java index a1fee12e5099f201e57ce04b19f67248e0a0713e..8dff4f7e7ddf76a4099f290f716207bfa0ff0af7 100644 --- a/core/src/main/java/hudson/matrix/MatrixConfiguration.java +++ b/core/src/main/java/hudson/matrix/MatrixConfiguration.java @@ -1,7 +1,7 @@ /* * The MIT License * - * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Tom Huybrechts + * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, Tom Huybrechts * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -240,7 +240,9 @@ public class MatrixConfiguration extends Project @Override public LogRotator getLogRotator() { - return new LinkedLogRotator(); + LogRotator lr = getParent().getLogRotator(); + return new LinkedLogRotator(lr != null ? lr.getArtifactDaysToKeep() : -1, + lr != null ? lr.getArtifactNumToKeep() : -1); } @Override