1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.codehaus.gmavenplus.mojo;
18
19 import org.apache.maven.shared.model.fileset.FileSet;
20 import org.apache.maven.shared.model.fileset.util.FileSetManager;
21
22 import java.io.File;
23 import java.util.HashSet;
24 import java.util.Set;
25
26 import static java.util.Collections.singletonList;
27
28
29
30
31
32
33
34
35 public abstract class AbstractGroovyStubSourcesMojo extends AbstractGroovySourcesMojo {
36
37
38
39
40
41
42
43 protected Set<File> getStubs(File outputDirectory) {
44 Set<File> files = new HashSet<>();
45 FileSetManager fileSetManager = new FileSetManager();
46
47 FileSet fileSet = new FileSet();
48 fileSet.setDirectory(outputDirectory.getAbsolutePath());
49 fileSet.setIncludes(singletonList(JAVA_SOURCES_PATTERN));
50 for (String file : fileSetManager.getIncludedFiles(fileSet)) {
51 files.add(new File(outputDirectory, file));
52 }
53
54 return files;
55 }
56
57 }