Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 49 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.400</version>
<version>2.32</version>
</parent>

<groupId>hudson.plugins.filesystem_scm</groupId>
Expand All @@ -16,6 +16,10 @@
<description>Using File System as SCM, done by checking file system last modified date.</description>
<url>http://wiki.jenkins-ci.org/display/JENKINS/File+System+SCM</url>

<properties>
<jenkins.version>1.642.3</jenkins.version>
</properties>

<developers>
<developer>
<id>samngms</id>
Expand All @@ -31,6 +35,14 @@
</developer>
</developers>

<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Netbeans already autoresolve it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think so.

<distribution>repo</distribution>
</license>
</licenses>

<!-- get every artifact through maven.glassfish.org, which proxies all
the artifacts that we need -->
<repositories>
Expand All @@ -46,7 +58,43 @@
<url>http://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>

<dependencies>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>structs</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
<version>2.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-job</artifactId>
<version>2.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-api</artifactId>
<version>2.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-support</artifactId>
<version>2.1</version>
<scope>test</scope>
</dependency>
<!-- Transient upper bound dependencies -->
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>annotation-indexer</artifactId>
<version>1.9</version>
</dependency>
</dependencies>

<scm>
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/hudson/plugins/filesystem_scm/Changelog.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.Collections;
import java.util.Date;
import java.util.List;
import javax.annotation.CheckForNull;

/** Represents a Changelog record (ChangeLogSet.Entry) in ChangelogSet
*
Expand Down Expand Up @@ -102,12 +103,13 @@ protected void setParent(ChangeLogSet parent) {
this.parent = (ChangelogSet)parent;
}

@CheckForNull
public Date getDate() {
return date;
return date != null ? (Date)date.clone() : null;
}

public void setDate(Date date) {
this.date = date;
this.date = date != null ? (Date)date.clone() : null;
}

@Override
Expand Down
22 changes: 15 additions & 7 deletions src/main/java/hudson/plugins/filesystem_scm/ChangelogSet.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package hudson.plugins.filesystem_scm;

import hudson.model.*;
import hudson.model.Run;
import hudson.scm.ChangeLogSet;
import hudson.scm.RepositoryBrowser;
import hudson.util.XStream2;
import java.util.*;
import java.io.*;
import org.apache.commons.io.IOUtils;
import org.xml.sax.SAXException;

/**
* FileSystem base SCM ChangelogSet
Expand All @@ -23,9 +26,9 @@ public class ChangelogSet extends hudson.scm.ChangeLogSet<Changelog> {
// not like other SCM, e.g. SVN, there may be 2 or 3 committed changes between builds
private List<Changelog> logs;

public ChangelogSet(AbstractBuild<?, ?> build, List<FolderDiff.Entry> changes) {
super(build);
logs = new ArrayList<Changelog>();
public ChangelogSet(Run<?, ?> build, List<FolderDiff.Entry> changes) {
super(build, new FilesystemRepositoryBrowser());
logs = new ArrayList<>();
if (!changes.isEmpty()) {
logs.add(new Changelog(this, changes));
}
Expand Down Expand Up @@ -93,9 +96,14 @@ private void initXStream() {
//xstream.omitField(ChangelogSet.ChangeLog.class, "parent");
//xstream.omitField(ChangelogSet.Path.class, "changeLog");
}

@SuppressWarnings("rawtypes")
public ChangelogSet parse(AbstractBuild build, java.io.File file) throws FileNotFoundException {

@Override
public ChangeLogSet<? extends Entry> parse(Run build, RepositoryBrowser<?> browser, File changelogFile) throws IOException, SAXException {
return parse(build, changelogFile);
}

@SuppressWarnings("rawtypes")
public ChangelogSet parse(Run<?,?> build, java.io.File file) throws FileNotFoundException {
FileInputStream in = null;
ChangelogSet out = null;
try {
Expand Down
Loading