13892
|
1 |
import java.nio.file.FileSystems;
|
|
2 |
import java.nio.file.Path;
|
|
3 |
import java.nio.file.SimpleFileVisitor;
|
|
4 |
import java.util.HashSet;
|
|
5 |
import java.util.Stack;
|
|
6 |
import java.util.Vector;
|
|
7 |
|
|
8 |
public class FileTreeCreator extends SimpleFileVisitor<Path>
|
|
9 |
{
|
|
10 |
Path vcProjLocation;
|
|
11 |
Path startDir;
|
|
12 |
final int startDirLength;
|
|
13 |
Stack<DirAttributes> attributes = new Stack<DirAttributes>();
|
|
14 |
Vector<BuildConfig> allConfigs;
|
|
15 |
WinGammaPlatformVC10 wg;
|
|
16 |
|
|
17 |
public FileTreeCreator(Path startDir, Vector<BuildConfig> allConfigs, WinGammaPlatformVC10 wg) {
|
|
18 |
super();
|
|
19 |
this.wg = wg;
|
|
20 |
this.allConfigs = allConfigs;
|
|
21 |
this.startDir = startDir;
|
|
22 |
startDirLength = startDir.toAbsolutePath().toString().length();
|
|
23 |
vcProjLocation = FileSystems.getDefault().getPath(allConfigs.firstElement().get("BuildSpace"));
|
|
24 |
attributes.push(new DirAttributes());
|
|
25 |
}
|
|
26 |
|
|
27 |
public class DirAttributes {
|
|
28 |
|
|
29 |
private HashSet<BuildConfig> ignores;
|
|
30 |
private HashSet<BuildConfig> disablePch;
|
|
31 |
|
|
32 |
public DirAttributes() {
|
|
33 |
ignores = new HashSet<BuildConfig>();
|
|
34 |
disablePch = new HashSet<BuildConfig>();
|
|
35 |
}
|
|
36 |
|
|
37 |
public DirAttributes(HashSet<BuildConfig> excludes2, HashSet<BuildConfig> disablePch2) {
|
|
38 |
ignores = excludes2;
|
|
39 |
disablePch = disablePch2;
|
|
40 |
}
|
|
41 |
|
|
42 |
@SuppressWarnings("unchecked")
|
|
43 |
public DirAttributes clone() {
|
|
44 |
return new DirAttributes((HashSet<BuildConfig>)this.ignores.clone(), (HashSet<BuildConfig>)this.disablePch.clone());
|
|
45 |
}
|
|
46 |
|
|
47 |
public void setIgnore(BuildConfig conf) {
|
|
48 |
ignores.add(conf);
|
|
49 |
}
|
|
50 |
|
|
51 |
public boolean hasIgnore(BuildConfig cfg) {
|
|
52 |
return ignores.contains(cfg);
|
|
53 |
}
|
|
54 |
|
|
55 |
public void removeFromIgnored(BuildConfig cfg) {
|
|
56 |
ignores.remove(cfg);
|
|
57 |
}
|
|
58 |
|
|
59 |
public void setDisablePch(BuildConfig conf) {
|
|
60 |
disablePch.add(conf);
|
|
61 |
}
|
|
62 |
|
|
63 |
public boolean hasDisablePch(BuildConfig cfg) {
|
|
64 |
return disablePch.contains(cfg);
|
|
65 |
}
|
|
66 |
|
|
67 |
public void removeFromDisablePch(BuildConfig cfg) {
|
|
68 |
disablePch.remove(cfg);
|
|
69 |
}
|
|
70 |
|
|
71 |
}
|
|
72 |
}
|