annotate src/share/tools/ProjectCreator/FileTreeCreatorVC10.java @ 12021:bd0e82136b03

8022740: Visual 2008 IDE build is broken Summary: Fixed project generation code, and added warning to upgrade to VS 2008 SP1. Reviewed-by: dcubed, ccheung
author iklam
date Sat, 10 Aug 2013 10:56:27 -0700
parents 31f3b1e1c5e5
children 3cce976666d9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12014
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
1 /*
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
2 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
4 *
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
7 * published by the Free Software Foundation.
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
8 *
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
13 * accompanied this code).
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
14 *
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
15 * You should have received a copy of the GNU General Public License version
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
18 *
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
21 * questions.
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
22 *
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
23 */
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
24
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
25 import static java.nio.file.FileVisitResult.CONTINUE;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
26
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
27 import java.io.IOException;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
28 import java.nio.file.FileSystems;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
29 import java.nio.file.FileVisitResult;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
30 import java.nio.file.Files;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
31 import java.nio.file.Path;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
32 import java.nio.file.attribute.BasicFileAttributes;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
33 import java.util.Stack;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
34 import java.util.Vector;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
35
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
36 public class FileTreeCreatorVC10 extends FileTreeCreator {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
37
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
38 public FileTreeCreatorVC10(Path startDir, Vector<BuildConfig> allConfigs, WinGammaPlatformVC10 wg) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
39 super(startDir, allConfigs, wg);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
40 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
41
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
42 @Override
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
43 public FileVisitResult visitFile(Path file, BasicFileAttributes attr) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
44 DirAttributes currentFileAttr = attributes.peek().clone();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
45 boolean usePch = false;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
46 boolean disablePch = false;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
47 boolean useIgnore = false;
12014
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
48 boolean isAltSrc = false; // only needed as a debugging crumb
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
49 boolean isReplacedByAltSrc = false;
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
50 String fileName = file.getFileName().toString();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
51
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
52 // TODO hideFile
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
53
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
54 // usePch applies to all configs for a file.
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
55 if (fileName.equals(BuildConfig.getFieldString(null, "UseToGeneratePch"))) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
56 usePch = true;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
57 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
58
12014
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
59 String fileLoc = vcProjLocation.relativize(file).toString();
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
60
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
61 // isAltSrc and isReplacedByAltSrc applies to all configs for a file
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
62 if (BuildConfig.matchesRelativeAltSrcInclude(
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
63 file.toAbsolutePath().toString())) {
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
64 // current file is an alternate source file so track it
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
65 isAltSrc = true;
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
66 BuildConfig.trackRelativeAltSrcFile(
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
67 file.toAbsolutePath().toString());
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
68 } else if (BuildConfig.matchesRelativeAltSrcFile(
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
69 file.toAbsolutePath().toString())) {
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
70 // current file is a regular file that matches an alternate
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
71 // source file so yack about replacing the regular file
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
72 isReplacedByAltSrc = true;
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
73 System.out.println("INFO: alternate source file '" +
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
74 BuildConfig.getMatchingRelativeAltSrcFile(
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
75 file.toAbsolutePath().toString()) +
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
76 "' replaces '" + fileLoc + "'");
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
77 }
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
78
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
79 for (BuildConfig cfg : allConfigs) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
80 if (cfg.lookupHashFieldInContext("IgnoreFile", fileName) != null) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
81 useIgnore = true;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
82 currentFileAttr.setIgnore(cfg);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
83 } else if (cfg.matchesIgnoredPath(file.toAbsolutePath().toString())) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
84 useIgnore = true;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
85 currentFileAttr.setIgnore(cfg);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
86 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
87
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
88 if (cfg.lookupHashFieldInContext("DisablePch", fileName) != null) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
89 disablePch = true;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
90 currentFileAttr.setDisablePch(cfg);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
91 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
92
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
93 Vector<String> rv = new Vector<String>();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
94 cfg.collectRelevantVectors(rv, "AdditionalFile");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
95 for(String addFile : rv) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
96 if (addFile.equals(fileName)) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
97 // supress any ignore
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
98 // TODO - may need some adjustments
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
99 if (file.toAbsolutePath().toString().contains(cfg.get("Flavour"))) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
100 currentFileAttr.removeFromIgnored(cfg);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
101 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
102 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
103 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
104 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
105
12021
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 12014
diff changeset
106 String tagName = wg10.getFileTagFromSuffix(fileName);
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
107
12014
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
108 if (!useIgnore && !disablePch && !usePch && !isReplacedByAltSrc) {
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
109 wg.tag(tagName, new String[] { "Include", fileLoc});
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
110 } else {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
111 wg.startTag(
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
112 tagName,
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
113 new String[] { "Include", fileLoc});
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
114
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
115 for (BuildConfig cfg : allConfigs) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
116 boolean ignore = currentFileAttr.hasIgnore(cfg);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
117 if (ignore) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
118 wg.tagData("ExcludedFromBuild", "true", "Condition", "'$(Configuration)|$(Platform)'=='" + cfg.get("Name") + "'");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
119 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
120 if (usePch) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
121 wg.tagData("PrecompiledHeader", "Create", "Condition", "'$(Configuration)|$(Platform)'=='" + cfg.get("Name") + "'");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
122 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
123 if (disablePch) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
124 wg.tag("PrecompiledHeader", "Condition", "'$(Configuration)|$(Platform)'=='" + cfg.get("Name") + "'");
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
125 }
12014
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
126 if (isReplacedByAltSrc) {
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
127 wg.tagData("ExcludedFromBuild", "true", "Condition",
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
128 "'$(Configuration)|$(Platform)'=='" +
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
129 cfg.get("Name") + "'");
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
130 }
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
131 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
132 wg.endTag();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
133 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
134
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
135 String filter = startDir.relativize(file.getParent().toAbsolutePath()).toString();
12021
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 12014
diff changeset
136 wg10.addFilterDependency(fileLoc, filter);
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
137
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
138 return CONTINUE;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
139 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
140
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
141 @Override
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
142 public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes attrs)
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
143 throws IOException {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
144 Boolean hide = false;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
145 // TODO remove attrs, if path is matched in this dir, then it is too in every subdir.
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
146 // And we will check anyway
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
147 DirAttributes newAttr = attributes.peek().clone();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
148
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
149 // check per config ignorePaths!
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
150 for (BuildConfig cfg : allConfigs) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
151 if (cfg.matchesIgnoredPath(path.toAbsolutePath().toString())) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
152 newAttr.setIgnore(cfg);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
153 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
154
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
155 // Hide is always on all configs. And additional files are never hiddden
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
156 if (cfg.matchesHidePath(path.toAbsolutePath().toString())) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
157 hide = true;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
158 break;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
159 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
160 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
161
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
162 if (!hide) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
163 String name = startDir.relativize(path.toAbsolutePath()).toString();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
164 if (!"".equals(name)) {
12021
bd0e82136b03 8022740: Visual 2008 IDE build is broken
iklam
parents: 12014
diff changeset
165 wg10.addFilter(name);
6801
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
166 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
167
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
168 attributes.push(newAttr);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
169 return super.preVisitDirectory(path, attrs);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
170 } else {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
171 return FileVisitResult.SKIP_SUBTREE;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
172 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
173 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
174
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
175 @Override
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
176 public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
177 //end matching attributes set by ignorepath
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
178 attributes.pop();
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
179 return CONTINUE;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
180 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
181
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
182 @Override
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
183 public FileVisitResult visitFileFailed(Path file, IOException exc) {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
184 return CONTINUE;
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
185 }
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
186
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
187 public void writeFileTree() throws IOException {
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
188 Files.walkFileTree(this.startDir, this);
1a9b9cfcef41 7163863: Updated projectcreator
neliasso
parents:
diff changeset
189 }
12014
31f3b1e1c5e5 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 6801
diff changeset
190 }