-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathCommitHashesExtractor.groovy
More file actions
33 lines (26 loc) · 969 Bytes
/
CommitHashesExtractor.groovy
File metadata and controls
33 lines (26 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package project.commitHashesExtraction
import project.Project
import static app.MiningFramework.arguments
interface CommitHashesExtractor {
class CommitHashes {
public String mergeSha
public String[] parents
CommitHashes(String mergeSha, String... parents) {
this.mergeSha = mergeSha
this.parents = parents
}
}
class Factory {
static CommitHashesExtractor build() {
if (arguments.projectCommitHashesFile != '') {
def file = new File(arguments.projectCommitHashesFile)
if (!file.exists()) {
throw new RuntimeException("File ${file.path} not found")
}
return new ProjectCommitListCommitHashesExtractor(file)
}
return new GitLogCommitHashesExtractor(arguments.sinceDate, arguments.untilDate)
}
}
List<CommitHashes> extractCommitHashes(Project project)
}