author | duke |
Wed, 05 Jul 2017 22:53:30 +0200 | |
changeset 43880 | b5015f742ba6 |
parent 38247 | 6ff550a6307e |
permissions | -rw-r--r-- |
38247
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
1 |
/* |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
2 |
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
4 |
* |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
7 |
* published by the Free Software Foundation. |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
8 |
* |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
13 |
* accompanied this code). |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
14 |
* |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
18 |
* |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
21 |
* questions. |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
22 |
* |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
23 |
*/ |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
24 |
|
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
25 |
package build.tools.projectcreator; |
6ff550a6307e
8156018: Hotspot visual studio project generation broken
erikj
parents:
19277
diff
changeset
|
26 |
|
13892 | 27 |
import java.nio.file.FileSystems; |
28 |
import java.nio.file.Path; |
|
29 |
import java.nio.file.SimpleFileVisitor; |
|
30 |
import java.util.HashSet; |
|
31 |
import java.util.Stack; |
|
32 |
import java.util.Vector; |
|
33 |
||
34 |
public class FileTreeCreator extends SimpleFileVisitor<Path> |
|
35 |
{ |
|
36 |
Path vcProjLocation; |
|
37 |
Path startDir; |
|
38 |
final int startDirLength; |
|
39 |
Stack<DirAttributes> attributes = new Stack<DirAttributes>(); |
|
40 |
Vector<BuildConfig> allConfigs; |
|
19277 | 41 |
WinGammaPlatform wg; |
42 |
WinGammaPlatformVC10 wg10; |
|
13892 | 43 |
|
19277 | 44 |
public FileTreeCreator(Path startDir, Vector<BuildConfig> allConfigs, WinGammaPlatform wg) { |
13892 | 45 |
super(); |
46 |
this.wg = wg; |
|
19277 | 47 |
if (wg instanceof WinGammaPlatformVC10) { |
48 |
wg10 = (WinGammaPlatformVC10)wg; |
|
49 |
} |
|
13892 | 50 |
this.allConfigs = allConfigs; |
51 |
this.startDir = startDir; |
|
52 |
startDirLength = startDir.toAbsolutePath().toString().length(); |
|
53 |
vcProjLocation = FileSystems.getDefault().getPath(allConfigs.firstElement().get("BuildSpace")); |
|
54 |
attributes.push(new DirAttributes()); |
|
55 |
} |
|
56 |
||
57 |
public class DirAttributes { |
|
58 |
||
59 |
private HashSet<BuildConfig> ignores; |
|
60 |
private HashSet<BuildConfig> disablePch; |
|
61 |
||
62 |
public DirAttributes() { |
|
63 |
ignores = new HashSet<BuildConfig>(); |
|
64 |
disablePch = new HashSet<BuildConfig>(); |
|
65 |
} |
|
66 |
||
67 |
public DirAttributes(HashSet<BuildConfig> excludes2, HashSet<BuildConfig> disablePch2) { |
|
68 |
ignores = excludes2; |
|
69 |
disablePch = disablePch2; |
|
70 |
} |
|
71 |
||
72 |
@SuppressWarnings("unchecked") |
|
73 |
public DirAttributes clone() { |
|
74 |
return new DirAttributes((HashSet<BuildConfig>)this.ignores.clone(), (HashSet<BuildConfig>)this.disablePch.clone()); |
|
75 |
} |
|
76 |
||
77 |
public void setIgnore(BuildConfig conf) { |
|
78 |
ignores.add(conf); |
|
79 |
} |
|
80 |
||
81 |
public boolean hasIgnore(BuildConfig cfg) { |
|
82 |
return ignores.contains(cfg); |
|
83 |
} |
|
84 |
||
85 |
public void removeFromIgnored(BuildConfig cfg) { |
|
86 |
ignores.remove(cfg); |
|
87 |
} |
|
88 |
||
89 |
public void setDisablePch(BuildConfig conf) { |
|
90 |
disablePch.add(conf); |
|
91 |
} |
|
92 |
||
93 |
public boolean hasDisablePch(BuildConfig cfg) { |
|
94 |
return disablePch.contains(cfg); |
|
95 |
} |
|
96 |
||
97 |
public void removeFromDisablePch(BuildConfig cfg) { |
|
98 |
disablePch.remove(cfg); |
|
99 |
} |
|
100 |
||
101 |
} |
|
102 |
} |