annotate src/share/tools/MakeDeps/WinGammaPlatformVC7.java @ 659:520d43965b1f

6812297: update project creation for Visual Studio 2005-2008 Summary: Add 2 news classes to create VC8 and VC9 projects Reviewed-by: apetrusenko, xlu
author ikrylov
date Fri, 27 Mar 2009 01:35:39 -0500
parents a61af66fc99e
children bd02caa94611
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
2 * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved.
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 * have any questions.
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 import java.io.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
26 import java.util.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
27
a61af66fc99e Initial load
duke
parents:
diff changeset
28 public class WinGammaPlatformVC7 extends WinGammaPlatform {
a61af66fc99e Initial load
duke
parents:
diff changeset
29
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
30 String projectVersion() {return "7.10";};
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
31
0
a61af66fc99e Initial load
duke
parents:
diff changeset
32 public void writeProjectFile(String projectFileName, String projectName,
a61af66fc99e Initial load
duke
parents:
diff changeset
33 Vector allConfigs) throws IOException {
a61af66fc99e Initial load
duke
parents:
diff changeset
34 System.out.println();
a61af66fc99e Initial load
duke
parents:
diff changeset
35 System.out.println(" Writing .vcproj file...");
a61af66fc99e Initial load
duke
parents:
diff changeset
36 // If we got this far without an error, we're safe to actually
a61af66fc99e Initial load
duke
parents:
diff changeset
37 // write the .vcproj file
a61af66fc99e Initial load
duke
parents:
diff changeset
38 printWriter = new PrintWriter(new FileWriter(projectFileName));
a61af66fc99e Initial load
duke
parents:
diff changeset
39
a61af66fc99e Initial load
duke
parents:
diff changeset
40 printWriter.println("<?xml version=\"1.0\" encoding=\"windows-1251\"?>");
a61af66fc99e Initial load
duke
parents:
diff changeset
41 startTag(
a61af66fc99e Initial load
duke
parents:
diff changeset
42 "VisualStudioProject",
a61af66fc99e Initial load
duke
parents:
diff changeset
43 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
44 "ProjectType", "Visual C++",
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
45 "Version", projectVersion(),
0
a61af66fc99e Initial load
duke
parents:
diff changeset
46 "Name", projectName,
a61af66fc99e Initial load
duke
parents:
diff changeset
47 "ProjectGUID", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}",
a61af66fc99e Initial load
duke
parents:
diff changeset
48 "SccProjectName", "",
a61af66fc99e Initial load
duke
parents:
diff changeset
49 "SccLocalPath", ""
a61af66fc99e Initial load
duke
parents:
diff changeset
50 }
a61af66fc99e Initial load
duke
parents:
diff changeset
51 );
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 startTag("Platforms", null);
a61af66fc99e Initial load
duke
parents:
diff changeset
54 tag("Platform", new String[] {"Name", Util.os});
a61af66fc99e Initial load
duke
parents:
diff changeset
55 endTag("Platforms");
a61af66fc99e Initial load
duke
parents:
diff changeset
56
a61af66fc99e Initial load
duke
parents:
diff changeset
57 startTag("Configurations", null);
a61af66fc99e Initial load
duke
parents:
diff changeset
58
a61af66fc99e Initial load
duke
parents:
diff changeset
59 for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
60 writeConfiguration((BuildConfig)i.next());
a61af66fc99e Initial load
duke
parents:
diff changeset
61 }
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63 endTag("Configurations");
a61af66fc99e Initial load
duke
parents:
diff changeset
64
a61af66fc99e Initial load
duke
parents:
diff changeset
65 tag("References", null);
a61af66fc99e Initial load
duke
parents:
diff changeset
66
a61af66fc99e Initial load
duke
parents:
diff changeset
67 writeFiles(allConfigs);
a61af66fc99e Initial load
duke
parents:
diff changeset
68
a61af66fc99e Initial load
duke
parents:
diff changeset
69 tag("Globals", null);
a61af66fc99e Initial load
duke
parents:
diff changeset
70
a61af66fc99e Initial load
duke
parents:
diff changeset
71 endTag("VisualStudioProject");
a61af66fc99e Initial load
duke
parents:
diff changeset
72 printWriter.close();
a61af66fc99e Initial load
duke
parents:
diff changeset
73
a61af66fc99e Initial load
duke
parents:
diff changeset
74 System.out.println(" Done.");
a61af66fc99e Initial load
duke
parents:
diff changeset
75 }
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77
a61af66fc99e Initial load
duke
parents:
diff changeset
78 abstract class NameFilter {
a61af66fc99e Initial load
duke
parents:
diff changeset
79 protected String fname;
a61af66fc99e Initial load
duke
parents:
diff changeset
80
a61af66fc99e Initial load
duke
parents:
diff changeset
81 abstract boolean match(FileInfo fi);
a61af66fc99e Initial load
duke
parents:
diff changeset
82
a61af66fc99e Initial load
duke
parents:
diff changeset
83 String filterString() { return ""; }
a61af66fc99e Initial load
duke
parents:
diff changeset
84 String name() { return this.fname;}
a61af66fc99e Initial load
duke
parents:
diff changeset
85 }
a61af66fc99e Initial load
duke
parents:
diff changeset
86
a61af66fc99e Initial load
duke
parents:
diff changeset
87 class DirectoryFilter extends NameFilter {
a61af66fc99e Initial load
duke
parents:
diff changeset
88 String dir;
a61af66fc99e Initial load
duke
parents:
diff changeset
89 int baseLen, dirLen;
a61af66fc99e Initial load
duke
parents:
diff changeset
90
a61af66fc99e Initial load
duke
parents:
diff changeset
91 DirectoryFilter(String dir, String sbase) {
a61af66fc99e Initial load
duke
parents:
diff changeset
92 this.dir = dir;
a61af66fc99e Initial load
duke
parents:
diff changeset
93 this.baseLen = sbase.length();
a61af66fc99e Initial load
duke
parents:
diff changeset
94 this.dirLen = dir.length();
a61af66fc99e Initial load
duke
parents:
diff changeset
95 this.fname = dir;
a61af66fc99e Initial load
duke
parents:
diff changeset
96 }
a61af66fc99e Initial load
duke
parents:
diff changeset
97
a61af66fc99e Initial load
duke
parents:
diff changeset
98 DirectoryFilter(String fname, String dir, String sbase) {
a61af66fc99e Initial load
duke
parents:
diff changeset
99 this.dir = dir;
a61af66fc99e Initial load
duke
parents:
diff changeset
100 this.baseLen = sbase.length();
a61af66fc99e Initial load
duke
parents:
diff changeset
101 this.dirLen = dir.length();
a61af66fc99e Initial load
duke
parents:
diff changeset
102 this.fname = fname;
a61af66fc99e Initial load
duke
parents:
diff changeset
103 }
a61af66fc99e Initial load
duke
parents:
diff changeset
104
a61af66fc99e Initial load
duke
parents:
diff changeset
105
a61af66fc99e Initial load
duke
parents:
diff changeset
106 boolean match(FileInfo fi) {
a61af66fc99e Initial load
duke
parents:
diff changeset
107 return fi.full.regionMatches(true, baseLen, dir, 0, dirLen);
a61af66fc99e Initial load
duke
parents:
diff changeset
108 }
a61af66fc99e Initial load
duke
parents:
diff changeset
109 }
a61af66fc99e Initial load
duke
parents:
diff changeset
110
a61af66fc99e Initial load
duke
parents:
diff changeset
111 class TypeFilter extends NameFilter {
a61af66fc99e Initial load
duke
parents:
diff changeset
112 String[] exts;
a61af66fc99e Initial load
duke
parents:
diff changeset
113
a61af66fc99e Initial load
duke
parents:
diff changeset
114 TypeFilter(String fname, String[] exts) {
a61af66fc99e Initial load
duke
parents:
diff changeset
115 this.fname = fname;
a61af66fc99e Initial load
duke
parents:
diff changeset
116 this.exts = exts;
a61af66fc99e Initial load
duke
parents:
diff changeset
117 }
a61af66fc99e Initial load
duke
parents:
diff changeset
118
a61af66fc99e Initial load
duke
parents:
diff changeset
119 boolean match(FileInfo fi) {
a61af66fc99e Initial load
duke
parents:
diff changeset
120 for (int i=0; i<exts.length; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
121 if (fi.full.endsWith(exts[i])) {
a61af66fc99e Initial load
duke
parents:
diff changeset
122 return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
123 }
a61af66fc99e Initial load
duke
parents:
diff changeset
124 }
a61af66fc99e Initial load
duke
parents:
diff changeset
125 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
126 }
a61af66fc99e Initial load
duke
parents:
diff changeset
127
a61af66fc99e Initial load
duke
parents:
diff changeset
128 String filterString() {
a61af66fc99e Initial load
duke
parents:
diff changeset
129 return Util.join(";", exts);
a61af66fc99e Initial load
duke
parents:
diff changeset
130 }
a61af66fc99e Initial load
duke
parents:
diff changeset
131 }
a61af66fc99e Initial load
duke
parents:
diff changeset
132
a61af66fc99e Initial load
duke
parents:
diff changeset
133 class TerminatorFilter extends NameFilter {
a61af66fc99e Initial load
duke
parents:
diff changeset
134 TerminatorFilter(String fname) {
a61af66fc99e Initial load
duke
parents:
diff changeset
135 this.fname = fname;
a61af66fc99e Initial load
duke
parents:
diff changeset
136
a61af66fc99e Initial load
duke
parents:
diff changeset
137 }
a61af66fc99e Initial load
duke
parents:
diff changeset
138 boolean match(FileInfo fi) {
a61af66fc99e Initial load
duke
parents:
diff changeset
139 return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
140 }
a61af66fc99e Initial load
duke
parents:
diff changeset
141
a61af66fc99e Initial load
duke
parents:
diff changeset
142 }
a61af66fc99e Initial load
duke
parents:
diff changeset
143
a61af66fc99e Initial load
duke
parents:
diff changeset
144 class SpecificNameFilter extends NameFilter {
a61af66fc99e Initial load
duke
parents:
diff changeset
145 String pats[];
a61af66fc99e Initial load
duke
parents:
diff changeset
146
a61af66fc99e Initial load
duke
parents:
diff changeset
147 SpecificNameFilter(String fname, String[] pats) {
a61af66fc99e Initial load
duke
parents:
diff changeset
148 this.fname = fname;
a61af66fc99e Initial load
duke
parents:
diff changeset
149 this.pats = pats;
a61af66fc99e Initial load
duke
parents:
diff changeset
150 }
a61af66fc99e Initial load
duke
parents:
diff changeset
151
a61af66fc99e Initial load
duke
parents:
diff changeset
152 boolean match(FileInfo fi) {
a61af66fc99e Initial load
duke
parents:
diff changeset
153 for (int i=0; i<pats.length; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
154 if (fi.attr.shortName.matches(pats[i])) {
a61af66fc99e Initial load
duke
parents:
diff changeset
155 return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
156 }
a61af66fc99e Initial load
duke
parents:
diff changeset
157 }
a61af66fc99e Initial load
duke
parents:
diff changeset
158 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
159 }
a61af66fc99e Initial load
duke
parents:
diff changeset
160
a61af66fc99e Initial load
duke
parents:
diff changeset
161 }
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163 class ContainerFilter extends NameFilter {
a61af66fc99e Initial load
duke
parents:
diff changeset
164 Vector children;
a61af66fc99e Initial load
duke
parents:
diff changeset
165
a61af66fc99e Initial load
duke
parents:
diff changeset
166 ContainerFilter(String fname) {
a61af66fc99e Initial load
duke
parents:
diff changeset
167 this.fname = fname;
a61af66fc99e Initial load
duke
parents:
diff changeset
168 children = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
169
a61af66fc99e Initial load
duke
parents:
diff changeset
170 }
a61af66fc99e Initial load
duke
parents:
diff changeset
171 boolean match(FileInfo fi) {
a61af66fc99e Initial load
duke
parents:
diff changeset
172 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
173 }
a61af66fc99e Initial load
duke
parents:
diff changeset
174
a61af66fc99e Initial load
duke
parents:
diff changeset
175 Iterator babies() { return children.iterator(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
176
a61af66fc99e Initial load
duke
parents:
diff changeset
177 void add(NameFilter f) {
a61af66fc99e Initial load
duke
parents:
diff changeset
178 children.add(f);
a61af66fc99e Initial load
duke
parents:
diff changeset
179 }
a61af66fc99e Initial load
duke
parents:
diff changeset
180 }
a61af66fc99e Initial load
duke
parents:
diff changeset
181
a61af66fc99e Initial load
duke
parents:
diff changeset
182
a61af66fc99e Initial load
duke
parents:
diff changeset
183 void writeCustomToolConfig(Vector configs, String[] customToolAttrs) {
a61af66fc99e Initial load
duke
parents:
diff changeset
184 for (Iterator i = configs.iterator(); i.hasNext(); ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
185 startTag("FileConfiguration",
a61af66fc99e Initial load
duke
parents:
diff changeset
186 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
187 "Name", (String)i.next()
a61af66fc99e Initial load
duke
parents:
diff changeset
188 }
a61af66fc99e Initial load
duke
parents:
diff changeset
189 );
a61af66fc99e Initial load
duke
parents:
diff changeset
190 tag("Tool", customToolAttrs);
a61af66fc99e Initial load
duke
parents:
diff changeset
191
a61af66fc99e Initial load
duke
parents:
diff changeset
192 endTag("FileConfiguration");
a61af66fc99e Initial load
duke
parents:
diff changeset
193 }
a61af66fc99e Initial load
duke
parents:
diff changeset
194 }
a61af66fc99e Initial load
duke
parents:
diff changeset
195
a61af66fc99e Initial load
duke
parents:
diff changeset
196 // here we define filters, which define layout of what can be seen in 'Solution View' of MSVC
a61af66fc99e Initial load
duke
parents:
diff changeset
197 // Basically there are two types of entities - container filters and real filters
a61af66fc99e Initial load
duke
parents:
diff changeset
198 // - container filter just provides a container to group together real filters
a61af66fc99e Initial load
duke
parents:
diff changeset
199 // - real filter can select elements from the set according to some rule, put it into XML
a61af66fc99e Initial load
duke
parents:
diff changeset
200 // and remove from the list
a61af66fc99e Initial load
duke
parents:
diff changeset
201 Vector makeFilters(TreeSet files) {
a61af66fc99e Initial load
duke
parents:
diff changeset
202 Vector rv = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
203 String sbase = Util.normalize(BuildConfig.getFieldString(null, "SourceBase")+"/src/");
a61af66fc99e Initial load
duke
parents:
diff changeset
204
a61af66fc99e Initial load
duke
parents:
diff changeset
205 ContainerFilter rt = new ContainerFilter("Runtime");
a61af66fc99e Initial load
duke
parents:
diff changeset
206 rt.add(new DirectoryFilter("share/vm/prims", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
207 rt.add(new DirectoryFilter("share/vm/runtime", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
208 rt.add(new DirectoryFilter("share/vm/oops", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
209 rv.add(rt);
a61af66fc99e Initial load
duke
parents:
diff changeset
210
a61af66fc99e Initial load
duke
parents:
diff changeset
211 ContainerFilter gc = new ContainerFilter("GC");
a61af66fc99e Initial load
duke
parents:
diff changeset
212 gc.add(new DirectoryFilter("share/vm/memory", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
213 gc.add(new DirectoryFilter("share/vm/gc_interface", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
214
a61af66fc99e Initial load
duke
parents:
diff changeset
215 ContainerFilter gc_impl = new ContainerFilter("Implementations");
a61af66fc99e Initial load
duke
parents:
diff changeset
216 gc_impl.add(new DirectoryFilter("CMS",
a61af66fc99e Initial load
duke
parents:
diff changeset
217 "share/vm/gc_implementation/concurrentMarkSweep",
a61af66fc99e Initial load
duke
parents:
diff changeset
218 sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
219 gc_impl.add(new DirectoryFilter("Parallel Scavenge",
a61af66fc99e Initial load
duke
parents:
diff changeset
220 "share/vm/gc_implementation/parallelScavenge",
a61af66fc99e Initial load
duke
parents:
diff changeset
221 sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
222 gc_impl.add(new DirectoryFilter("Shared",
a61af66fc99e Initial load
duke
parents:
diff changeset
223 "share/vm/gc_implementation/shared",
a61af66fc99e Initial load
duke
parents:
diff changeset
224 sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
225 // for all leftovers
a61af66fc99e Initial load
duke
parents:
diff changeset
226 gc_impl.add(new DirectoryFilter("Misc",
a61af66fc99e Initial load
duke
parents:
diff changeset
227 "share/vm/gc_implementation",
a61af66fc99e Initial load
duke
parents:
diff changeset
228 sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
229
a61af66fc99e Initial load
duke
parents:
diff changeset
230 gc.add(gc_impl);
a61af66fc99e Initial load
duke
parents:
diff changeset
231 rv.add(gc);
a61af66fc99e Initial load
duke
parents:
diff changeset
232
a61af66fc99e Initial load
duke
parents:
diff changeset
233 rv.add(new DirectoryFilter("C1", "share/vm/c1", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
234
a61af66fc99e Initial load
duke
parents:
diff changeset
235 ContainerFilter c2 = new ContainerFilter("C2");
a61af66fc99e Initial load
duke
parents:
diff changeset
236 //c2.add(new DirectoryFilter("share/vm/adlc", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
237 c2.add(new DirectoryFilter("share/vm/opto", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
238 c2.add(new SpecificNameFilter("Generated", new String[] {"^ad_.+", "^dfa_.+", "^adGlobals.+"}));
a61af66fc99e Initial load
duke
parents:
diff changeset
239 rv.add(c2);
a61af66fc99e Initial load
duke
parents:
diff changeset
240
a61af66fc99e Initial load
duke
parents:
diff changeset
241 ContainerFilter comp = new ContainerFilter("Compiler Common");
a61af66fc99e Initial load
duke
parents:
diff changeset
242 comp.add(new DirectoryFilter("share/vm/asm", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
243 comp.add(new DirectoryFilter("share/vm/ci", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
244 comp.add(new DirectoryFilter("share/vm/code", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
245 comp.add(new DirectoryFilter("share/vm/compiler", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
246 rv.add(comp);
a61af66fc99e Initial load
duke
parents:
diff changeset
247
a61af66fc99e Initial load
duke
parents:
diff changeset
248 rv.add(new DirectoryFilter("Interpreter",
a61af66fc99e Initial load
duke
parents:
diff changeset
249 "share/vm/interpreter",
a61af66fc99e Initial load
duke
parents:
diff changeset
250 sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
251
a61af66fc99e Initial load
duke
parents:
diff changeset
252 ContainerFilter misc = new ContainerFilter("Misc");
a61af66fc99e Initial load
duke
parents:
diff changeset
253 //misc.add(new DirectoryFilter("share/vm/launch", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
254 misc.add(new DirectoryFilter("share/vm/libadt", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
255 misc.add(new DirectoryFilter("share/vm/services", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
256 misc.add(new DirectoryFilter("share/vm/utilities", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
257 rv.add(misc);
a61af66fc99e Initial load
duke
parents:
diff changeset
258
a61af66fc99e Initial load
duke
parents:
diff changeset
259 rv.add(new DirectoryFilter("os_cpu", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
260
a61af66fc99e Initial load
duke
parents:
diff changeset
261 rv.add(new DirectoryFilter("cpu", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
262
a61af66fc99e Initial load
duke
parents:
diff changeset
263 rv.add(new DirectoryFilter("os", sbase));
a61af66fc99e Initial load
duke
parents:
diff changeset
264
a61af66fc99e Initial load
duke
parents:
diff changeset
265 rv.add(new SpecificNameFilter("JVMTI Generated", new String[] {"^jvmti.+"}));
a61af66fc99e Initial load
duke
parents:
diff changeset
266
a61af66fc99e Initial load
duke
parents:
diff changeset
267 rv.add(new SpecificNameFilter("C++ Interpreter Generated", new String[] {"^bytecodeInterpreterWithChecks.+"}));
a61af66fc99e Initial load
duke
parents:
diff changeset
268
a61af66fc99e Initial load
duke
parents:
diff changeset
269 rv.add(new SpecificNameFilter("Include DBs", new String[] {"^includeDB_.+"}));
a61af66fc99e Initial load
duke
parents:
diff changeset
270
a61af66fc99e Initial load
duke
parents:
diff changeset
271 // this one is to catch files not caught by other filters
a61af66fc99e Initial load
duke
parents:
diff changeset
272 //rv.add(new TypeFilter("Header Files", new String[] {"h", "hpp", "hxx", "hm", "inl", "fi", "fd"}));
a61af66fc99e Initial load
duke
parents:
diff changeset
273 rv.add(new TerminatorFilter("Source Files"));
a61af66fc99e Initial load
duke
parents:
diff changeset
274
a61af66fc99e Initial load
duke
parents:
diff changeset
275 return rv;
a61af66fc99e Initial load
duke
parents:
diff changeset
276 }
a61af66fc99e Initial load
duke
parents:
diff changeset
277
a61af66fc99e Initial load
duke
parents:
diff changeset
278 void writeFiles(Vector allConfigs) {
a61af66fc99e Initial load
duke
parents:
diff changeset
279
a61af66fc99e Initial load
duke
parents:
diff changeset
280 Hashtable allFiles = computeAttributedFiles(allConfigs);
a61af66fc99e Initial load
duke
parents:
diff changeset
281
a61af66fc99e Initial load
duke
parents:
diff changeset
282 Vector allConfigNames = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
283 for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
284 allConfigNames.add(((BuildConfig)i.next()).get("Name"));
a61af66fc99e Initial load
duke
parents:
diff changeset
285 }
a61af66fc99e Initial load
duke
parents:
diff changeset
286
a61af66fc99e Initial load
duke
parents:
diff changeset
287 TreeSet sortedFiles = sortFiles(allFiles);
a61af66fc99e Initial load
duke
parents:
diff changeset
288
a61af66fc99e Initial load
duke
parents:
diff changeset
289 startTag("Files", null);
a61af66fc99e Initial load
duke
parents:
diff changeset
290
a61af66fc99e Initial load
duke
parents:
diff changeset
291 for (Iterator i = makeFilters(sortedFiles).iterator(); i.hasNext(); ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
292 doWriteFiles(sortedFiles, allConfigNames, (NameFilter)i.next());
a61af66fc99e Initial load
duke
parents:
diff changeset
293 }
a61af66fc99e Initial load
duke
parents:
diff changeset
294
a61af66fc99e Initial load
duke
parents:
diff changeset
295
a61af66fc99e Initial load
duke
parents:
diff changeset
296 startTag("Filter",
a61af66fc99e Initial load
duke
parents:
diff changeset
297 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
298 "Name", "Resource Files",
a61af66fc99e Initial load
duke
parents:
diff changeset
299 "Filter", "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
a61af66fc99e Initial load
duke
parents:
diff changeset
300 }
a61af66fc99e Initial load
duke
parents:
diff changeset
301 );
a61af66fc99e Initial load
duke
parents:
diff changeset
302 endTag("Filter");
a61af66fc99e Initial load
duke
parents:
diff changeset
303
a61af66fc99e Initial load
duke
parents:
diff changeset
304 endTag("Files");
a61af66fc99e Initial load
duke
parents:
diff changeset
305 }
a61af66fc99e Initial load
duke
parents:
diff changeset
306
a61af66fc99e Initial load
duke
parents:
diff changeset
307 void doWriteFiles(TreeSet allFiles, Vector allConfigNames, NameFilter filter) {
a61af66fc99e Initial load
duke
parents:
diff changeset
308 startTag("Filter",
a61af66fc99e Initial load
duke
parents:
diff changeset
309 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
310 "Name", filter.name(),
a61af66fc99e Initial load
duke
parents:
diff changeset
311 "Filter", filter.filterString()
a61af66fc99e Initial load
duke
parents:
diff changeset
312 }
a61af66fc99e Initial load
duke
parents:
diff changeset
313 );
a61af66fc99e Initial load
duke
parents:
diff changeset
314
a61af66fc99e Initial load
duke
parents:
diff changeset
315 if (filter instanceof ContainerFilter) {
a61af66fc99e Initial load
duke
parents:
diff changeset
316
a61af66fc99e Initial load
duke
parents:
diff changeset
317 Iterator i = ((ContainerFilter)filter).babies();
a61af66fc99e Initial load
duke
parents:
diff changeset
318 while (i.hasNext()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
319 doWriteFiles(allFiles, allConfigNames, (NameFilter)i.next());
a61af66fc99e Initial load
duke
parents:
diff changeset
320 }
a61af66fc99e Initial load
duke
parents:
diff changeset
321
a61af66fc99e Initial load
duke
parents:
diff changeset
322 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
323
a61af66fc99e Initial load
duke
parents:
diff changeset
324 Iterator i = allFiles.iterator();
a61af66fc99e Initial load
duke
parents:
diff changeset
325 while (i.hasNext()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
326 FileInfo fi = (FileInfo)i.next();
a61af66fc99e Initial load
duke
parents:
diff changeset
327
a61af66fc99e Initial load
duke
parents:
diff changeset
328 if (!filter.match(fi)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
329 continue;
a61af66fc99e Initial load
duke
parents:
diff changeset
330 }
a61af66fc99e Initial load
duke
parents:
diff changeset
331
a61af66fc99e Initial load
duke
parents:
diff changeset
332 startTag("File",
a61af66fc99e Initial load
duke
parents:
diff changeset
333 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
334 "RelativePath", fi.full.replace('/', '\\')
a61af66fc99e Initial load
duke
parents:
diff changeset
335 }
a61af66fc99e Initial load
duke
parents:
diff changeset
336 );
a61af66fc99e Initial load
duke
parents:
diff changeset
337
a61af66fc99e Initial load
duke
parents:
diff changeset
338 FileAttribute a = fi.attr;
a61af66fc99e Initial load
duke
parents:
diff changeset
339 if (a.pchRoot) {
a61af66fc99e Initial load
duke
parents:
diff changeset
340 writeCustomToolConfig(allConfigNames,
a61af66fc99e Initial load
duke
parents:
diff changeset
341 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
342 "Name", "VCCLCompilerTool",
a61af66fc99e Initial load
duke
parents:
diff changeset
343 "UsePrecompiledHeader", "1"
a61af66fc99e Initial load
duke
parents:
diff changeset
344 });
a61af66fc99e Initial load
duke
parents:
diff changeset
345 }
a61af66fc99e Initial load
duke
parents:
diff changeset
346
a61af66fc99e Initial load
duke
parents:
diff changeset
347 if (a.noPch) {
a61af66fc99e Initial load
duke
parents:
diff changeset
348 writeCustomToolConfig(allConfigNames,
a61af66fc99e Initial load
duke
parents:
diff changeset
349 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
350 "Name", "VCCLCompilerTool",
a61af66fc99e Initial load
duke
parents:
diff changeset
351 "UsePrecompiledHeader", "0"
a61af66fc99e Initial load
duke
parents:
diff changeset
352 });
a61af66fc99e Initial load
duke
parents:
diff changeset
353 }
a61af66fc99e Initial load
duke
parents:
diff changeset
354
a61af66fc99e Initial load
duke
parents:
diff changeset
355 if (a.configs != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
356 for (Iterator j=allConfigNames.iterator(); j.hasNext();) {
a61af66fc99e Initial load
duke
parents:
diff changeset
357 String cfg = (String)j.next();
a61af66fc99e Initial load
duke
parents:
diff changeset
358 if (!a.configs.contains(cfg)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
359 startTag("FileConfiguration",
a61af66fc99e Initial load
duke
parents:
diff changeset
360 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
361 "Name", cfg,
a61af66fc99e Initial load
duke
parents:
diff changeset
362 "ExcludedFromBuild", "TRUE"
a61af66fc99e Initial load
duke
parents:
diff changeset
363 });
a61af66fc99e Initial load
duke
parents:
diff changeset
364 tag("Tool", new String[] {"Name", "VCCLCompilerTool"});
a61af66fc99e Initial load
duke
parents:
diff changeset
365 endTag("FileConfiguration");
a61af66fc99e Initial load
duke
parents:
diff changeset
366
a61af66fc99e Initial load
duke
parents:
diff changeset
367 }
a61af66fc99e Initial load
duke
parents:
diff changeset
368 }
a61af66fc99e Initial load
duke
parents:
diff changeset
369 }
a61af66fc99e Initial load
duke
parents:
diff changeset
370
a61af66fc99e Initial load
duke
parents:
diff changeset
371 endTag("File");
a61af66fc99e Initial load
duke
parents:
diff changeset
372
a61af66fc99e Initial load
duke
parents:
diff changeset
373 // we not gonna look at this file anymore
a61af66fc99e Initial load
duke
parents:
diff changeset
374 i.remove();
a61af66fc99e Initial load
duke
parents:
diff changeset
375 }
a61af66fc99e Initial load
duke
parents:
diff changeset
376 }
a61af66fc99e Initial load
duke
parents:
diff changeset
377
a61af66fc99e Initial load
duke
parents:
diff changeset
378 endTag("Filter");
a61af66fc99e Initial load
duke
parents:
diff changeset
379 }
a61af66fc99e Initial load
duke
parents:
diff changeset
380
a61af66fc99e Initial load
duke
parents:
diff changeset
381
a61af66fc99e Initial load
duke
parents:
diff changeset
382 void writeConfiguration(BuildConfig cfg) {
a61af66fc99e Initial load
duke
parents:
diff changeset
383 startTag("Configuration",
a61af66fc99e Initial load
duke
parents:
diff changeset
384 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
385 "Name", cfg.get("Name"),
a61af66fc99e Initial load
duke
parents:
diff changeset
386 "OutputDirectory", cfg.get("OutputDir"),
a61af66fc99e Initial load
duke
parents:
diff changeset
387 "IntermediateDirectory", cfg.get("OutputDir"),
a61af66fc99e Initial load
duke
parents:
diff changeset
388 "ConfigurationType", "2",
a61af66fc99e Initial load
duke
parents:
diff changeset
389 "UseOfMFC", "0",
a61af66fc99e Initial load
duke
parents:
diff changeset
390 "ATLMinimizesCRunTimeLibraryUsage", "FALSE"
a61af66fc99e Initial load
duke
parents:
diff changeset
391 }
a61af66fc99e Initial load
duke
parents:
diff changeset
392 );
a61af66fc99e Initial load
duke
parents:
diff changeset
393
a61af66fc99e Initial load
duke
parents:
diff changeset
394
a61af66fc99e Initial load
duke
parents:
diff changeset
395
a61af66fc99e Initial load
duke
parents:
diff changeset
396 tagV("Tool", cfg.getV("CompilerFlags"));
a61af66fc99e Initial load
duke
parents:
diff changeset
397
a61af66fc99e Initial load
duke
parents:
diff changeset
398 tag("Tool",
a61af66fc99e Initial load
duke
parents:
diff changeset
399 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
400 "Name", "VCCustomBuildTool"
a61af66fc99e Initial load
duke
parents:
diff changeset
401 }
a61af66fc99e Initial load
duke
parents:
diff changeset
402 );
a61af66fc99e Initial load
duke
parents:
diff changeset
403
a61af66fc99e Initial load
duke
parents:
diff changeset
404 tagV("Tool", cfg.getV("LinkerFlags"));
a61af66fc99e Initial load
duke
parents:
diff changeset
405
a61af66fc99e Initial load
duke
parents:
diff changeset
406 tag("Tool",
a61af66fc99e Initial load
duke
parents:
diff changeset
407 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
408 "Name", "VCPostBuildEventTool"
a61af66fc99e Initial load
duke
parents:
diff changeset
409 }
a61af66fc99e Initial load
duke
parents:
diff changeset
410 );
a61af66fc99e Initial load
duke
parents:
diff changeset
411
a61af66fc99e Initial load
duke
parents:
diff changeset
412 tag("Tool",
a61af66fc99e Initial load
duke
parents:
diff changeset
413 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
414 "Name", "VCPreBuildEventTool"
a61af66fc99e Initial load
duke
parents:
diff changeset
415 }
a61af66fc99e Initial load
duke
parents:
diff changeset
416 );
a61af66fc99e Initial load
duke
parents:
diff changeset
417
a61af66fc99e Initial load
duke
parents:
diff changeset
418 tag("Tool",
a61af66fc99e Initial load
duke
parents:
diff changeset
419 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
420 "Name", "VCPreLinkEventTool",
a61af66fc99e Initial load
duke
parents:
diff changeset
421 "Description", BuildConfig.getFieldString(null, "PrelinkDescription"),
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
422 //Caution: String.replace(String,String) is available from JDK5 onwards only
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
423 "CommandLine", cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand").replace
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
424 ("\t", "&#x0D;&#x0A;"))
0
a61af66fc99e Initial load
duke
parents:
diff changeset
425 }
a61af66fc99e Initial load
duke
parents:
diff changeset
426 );
a61af66fc99e Initial load
duke
parents:
diff changeset
427
a61af66fc99e Initial load
duke
parents:
diff changeset
428 tag("Tool",
a61af66fc99e Initial load
duke
parents:
diff changeset
429 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
430 "Name", "VCResourceCompilerTool",
a61af66fc99e Initial load
duke
parents:
diff changeset
431 // XXX???
a61af66fc99e Initial load
duke
parents:
diff changeset
432 "PreprocessorDefinitions", "NDEBUG",
a61af66fc99e Initial load
duke
parents:
diff changeset
433 "Culture", "1033"
a61af66fc99e Initial load
duke
parents:
diff changeset
434 }
a61af66fc99e Initial load
duke
parents:
diff changeset
435 );
a61af66fc99e Initial load
duke
parents:
diff changeset
436 tag("Tool",
a61af66fc99e Initial load
duke
parents:
diff changeset
437 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
438 "Name", "VCWebServiceProxyGeneratorTool"
a61af66fc99e Initial load
duke
parents:
diff changeset
439 }
a61af66fc99e Initial load
duke
parents:
diff changeset
440 );
a61af66fc99e Initial load
duke
parents:
diff changeset
441
a61af66fc99e Initial load
duke
parents:
diff changeset
442 tag ("Tool",
a61af66fc99e Initial load
duke
parents:
diff changeset
443 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
444 "Name", "VCXMLDataGeneratorTool"
a61af66fc99e Initial load
duke
parents:
diff changeset
445 }
a61af66fc99e Initial load
duke
parents:
diff changeset
446 );
a61af66fc99e Initial load
duke
parents:
diff changeset
447
a61af66fc99e Initial load
duke
parents:
diff changeset
448 tag("Tool",
a61af66fc99e Initial load
duke
parents:
diff changeset
449 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
450 "Name", "VCWebDeploymentTool"
a61af66fc99e Initial load
duke
parents:
diff changeset
451 }
a61af66fc99e Initial load
duke
parents:
diff changeset
452 );
a61af66fc99e Initial load
duke
parents:
diff changeset
453 tag("Tool",
a61af66fc99e Initial load
duke
parents:
diff changeset
454 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
455 "Name", "VCManagedWrapperGeneratorTool"
a61af66fc99e Initial load
duke
parents:
diff changeset
456 }
a61af66fc99e Initial load
duke
parents:
diff changeset
457 );
a61af66fc99e Initial load
duke
parents:
diff changeset
458 tag("Tool",
a61af66fc99e Initial load
duke
parents:
diff changeset
459 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
460 "Name", "VCAuxiliaryManagedWrapperGeneratorTool"
a61af66fc99e Initial load
duke
parents:
diff changeset
461 }
a61af66fc99e Initial load
duke
parents:
diff changeset
462 );
a61af66fc99e Initial load
duke
parents:
diff changeset
463
a61af66fc99e Initial load
duke
parents:
diff changeset
464 tag("Tool",
a61af66fc99e Initial load
duke
parents:
diff changeset
465 new String[] {
a61af66fc99e Initial load
duke
parents:
diff changeset
466 "Name", "VCMIDLTool",
a61af66fc99e Initial load
duke
parents:
diff changeset
467 "PreprocessorDefinitions", "NDEBUG",
a61af66fc99e Initial load
duke
parents:
diff changeset
468 "MkTypLibCompatible", "TRUE",
a61af66fc99e Initial load
duke
parents:
diff changeset
469 "SuppressStartupBanner", "TRUE",
a61af66fc99e Initial load
duke
parents:
diff changeset
470 "TargetEnvironment", "1",
a61af66fc99e Initial load
duke
parents:
diff changeset
471 "TypeLibraryName", cfg.get("OutputDir") + Util.sep + "vm.tlb",
a61af66fc99e Initial load
duke
parents:
diff changeset
472 "HeaderFileName", ""
a61af66fc99e Initial load
duke
parents:
diff changeset
473 }
a61af66fc99e Initial load
duke
parents:
diff changeset
474 );
a61af66fc99e Initial load
duke
parents:
diff changeset
475
a61af66fc99e Initial load
duke
parents:
diff changeset
476 endTag("Configuration");
a61af66fc99e Initial load
duke
parents:
diff changeset
477 }
a61af66fc99e Initial load
duke
parents:
diff changeset
478
a61af66fc99e Initial load
duke
parents:
diff changeset
479 int indent;
a61af66fc99e Initial load
duke
parents:
diff changeset
480
a61af66fc99e Initial load
duke
parents:
diff changeset
481 private void startTagPrim(String name,
a61af66fc99e Initial load
duke
parents:
diff changeset
482 String[] attrs,
a61af66fc99e Initial load
duke
parents:
diff changeset
483 boolean close) {
a61af66fc99e Initial load
duke
parents:
diff changeset
484 doIndent();
a61af66fc99e Initial load
duke
parents:
diff changeset
485 printWriter.print("<"+name);
a61af66fc99e Initial load
duke
parents:
diff changeset
486 indent++;
a61af66fc99e Initial load
duke
parents:
diff changeset
487
a61af66fc99e Initial load
duke
parents:
diff changeset
488 if (attrs != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
489 printWriter.println();
a61af66fc99e Initial load
duke
parents:
diff changeset
490 for (int i=0; i<attrs.length; i+=2) {
a61af66fc99e Initial load
duke
parents:
diff changeset
491 doIndent();
a61af66fc99e Initial load
duke
parents:
diff changeset
492 printWriter.println(" " + attrs[i]+"=\""+attrs[i+1]+"\"");
a61af66fc99e Initial load
duke
parents:
diff changeset
493 }
a61af66fc99e Initial load
duke
parents:
diff changeset
494 }
a61af66fc99e Initial load
duke
parents:
diff changeset
495
a61af66fc99e Initial load
duke
parents:
diff changeset
496 if (close) {
a61af66fc99e Initial load
duke
parents:
diff changeset
497 indent--;
a61af66fc99e Initial load
duke
parents:
diff changeset
498 //doIndent();
a61af66fc99e Initial load
duke
parents:
diff changeset
499 printWriter.println("/>");
a61af66fc99e Initial load
duke
parents:
diff changeset
500 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
501 //doIndent();
a61af66fc99e Initial load
duke
parents:
diff changeset
502 printWriter.println(">");
a61af66fc99e Initial load
duke
parents:
diff changeset
503 }
a61af66fc99e Initial load
duke
parents:
diff changeset
504 }
a61af66fc99e Initial load
duke
parents:
diff changeset
505
a61af66fc99e Initial load
duke
parents:
diff changeset
506 void startTag(String name, String[] attrs) {
a61af66fc99e Initial load
duke
parents:
diff changeset
507 startTagPrim(name, attrs, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
508 }
a61af66fc99e Initial load
duke
parents:
diff changeset
509
a61af66fc99e Initial load
duke
parents:
diff changeset
510 void startTagV(String name, Vector attrs) {
a61af66fc99e Initial load
duke
parents:
diff changeset
511 String s[] = new String [attrs.size()];
a61af66fc99e Initial load
duke
parents:
diff changeset
512 for (int i=0; i<attrs.size(); i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
513 s[i] = (String)attrs.elementAt(i);
a61af66fc99e Initial load
duke
parents:
diff changeset
514 }
a61af66fc99e Initial load
duke
parents:
diff changeset
515 startTagPrim(name, s, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
516 }
a61af66fc99e Initial load
duke
parents:
diff changeset
517
a61af66fc99e Initial load
duke
parents:
diff changeset
518 void endTag(String name) {
a61af66fc99e Initial load
duke
parents:
diff changeset
519 indent--;
a61af66fc99e Initial load
duke
parents:
diff changeset
520 doIndent();
a61af66fc99e Initial load
duke
parents:
diff changeset
521 printWriter.println("</"+name+">");
a61af66fc99e Initial load
duke
parents:
diff changeset
522 }
a61af66fc99e Initial load
duke
parents:
diff changeset
523
a61af66fc99e Initial load
duke
parents:
diff changeset
524 void tag(String name, String[] attrs) {
a61af66fc99e Initial load
duke
parents:
diff changeset
525 startTagPrim(name, attrs, true);
a61af66fc99e Initial load
duke
parents:
diff changeset
526 }
a61af66fc99e Initial load
duke
parents:
diff changeset
527
a61af66fc99e Initial load
duke
parents:
diff changeset
528 void tagV(String name, Vector attrs) {
a61af66fc99e Initial load
duke
parents:
diff changeset
529 String s[] = new String [attrs.size()];
a61af66fc99e Initial load
duke
parents:
diff changeset
530 for (int i=0; i<attrs.size(); i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
531 s[i] = (String)attrs.elementAt(i);
a61af66fc99e Initial load
duke
parents:
diff changeset
532 }
a61af66fc99e Initial load
duke
parents:
diff changeset
533 startTagPrim(name, s, true);
a61af66fc99e Initial load
duke
parents:
diff changeset
534 }
a61af66fc99e Initial load
duke
parents:
diff changeset
535
a61af66fc99e Initial load
duke
parents:
diff changeset
536
a61af66fc99e Initial load
duke
parents:
diff changeset
537 void doIndent() {
a61af66fc99e Initial load
duke
parents:
diff changeset
538 for (int i=0; i<indent; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
539 printWriter.print(" ");
a61af66fc99e Initial load
duke
parents:
diff changeset
540 }
a61af66fc99e Initial load
duke
parents:
diff changeset
541 }
a61af66fc99e Initial load
duke
parents:
diff changeset
542
a61af66fc99e Initial load
duke
parents:
diff changeset
543 protected String getProjectExt() {
a61af66fc99e Initial load
duke
parents:
diff changeset
544 return ".vcproj";
a61af66fc99e Initial load
duke
parents:
diff changeset
545 }
a61af66fc99e Initial load
duke
parents:
diff changeset
546 }
a61af66fc99e Initial load
duke
parents:
diff changeset
547
a61af66fc99e Initial load
duke
parents:
diff changeset
548 class CompilerInterfaceVC7 extends CompilerInterface {
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
549 void getBaseCompilerFlags_common(Vector defines, Vector includes, String outDir,Vector rv) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
550
a61af66fc99e Initial load
duke
parents:
diff changeset
551 // advanced M$ IDE (2003) can only recognize name if it's first or
a61af66fc99e Initial load
duke
parents:
diff changeset
552 // second attribute in the tag - go guess
a61af66fc99e Initial load
duke
parents:
diff changeset
553 addAttr(rv, "Name", "VCCLCompilerTool");
a61af66fc99e Initial load
duke
parents:
diff changeset
554 addAttr(rv, "AdditionalIncludeDirectories", Util.join(",", includes));
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
555 addAttr(rv, "PreprocessorDefinitions",
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
556 Util.join(";", defines).replace("\"","&quot;"));
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
557 addAttr(rv, "PrecompiledHeaderThrough",
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
558 "incls"+Util.sep+"_precompiled.incl");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
559 addAttr(rv, "PrecompiledHeaderFile", outDir+Util.sep+"vm.pch");
a61af66fc99e Initial load
duke
parents:
diff changeset
560 addAttr(rv, "AssemblerListingLocation", outDir);
a61af66fc99e Initial load
duke
parents:
diff changeset
561 addAttr(rv, "ObjectFile", outDir+Util.sep);
a61af66fc99e Initial load
duke
parents:
diff changeset
562 addAttr(rv, "ProgramDataBaseFileName", outDir+Util.sep+"vm.pdb");
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
563 // Set /nologo optin
0
a61af66fc99e Initial load
duke
parents:
diff changeset
564 addAttr(rv, "SuppressStartupBanner", "TRUE");
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
565 // Surpass the default /Tc or /Tp. 0 is compileAsDefault
0
a61af66fc99e Initial load
duke
parents:
diff changeset
566 addAttr(rv, "CompileAs", "0");
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
567 // Set /W3 option. 3 is warningLevel_3
0
a61af66fc99e Initial load
duke
parents:
diff changeset
568 addAttr(rv, "WarningLevel", "3");
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
569 // Set /WX option,
0
a61af66fc99e Initial load
duke
parents:
diff changeset
570 addAttr(rv, "WarnAsError", "TRUE");
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
571 // Set /GS option
0
a61af66fc99e Initial load
duke
parents:
diff changeset
572 addAttr(rv, "BufferSecurityCheck", "FALSE");
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
573 // Set /Zi option. 3 is debugEnabled
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
574 addAttr(rv, "DebugInformationFormat", "3");
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
575 }
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
576 Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir) {
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
577 Vector rv = new Vector();
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
578
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
579 getBaseCompilerFlags_common(defines,includes, outDir, rv);
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
580 // Set /Yu option. 3 is pchUseUsingSpecific
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
581 // Note: Starting VC8 pchUseUsingSpecific is 2 !!!
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
582 addAttr(rv, "UsePrecompiledHeader", "3");
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
583 // Set /EHsc- option
0
a61af66fc99e Initial load
duke
parents:
diff changeset
584 addAttr(rv, "ExceptionHandling", "FALSE");
a61af66fc99e Initial load
duke
parents:
diff changeset
585
a61af66fc99e Initial load
duke
parents:
diff changeset
586 return rv;
a61af66fc99e Initial load
duke
parents:
diff changeset
587 }
a61af66fc99e Initial load
duke
parents:
diff changeset
588
a61af66fc99e Initial load
duke
parents:
diff changeset
589 Vector getBaseLinkerFlags(String outDir, String outDll) {
a61af66fc99e Initial load
duke
parents:
diff changeset
590 Vector rv = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
591
a61af66fc99e Initial load
duke
parents:
diff changeset
592 addAttr(rv, "Name", "VCLinkerTool");
a61af66fc99e Initial load
duke
parents:
diff changeset
593 addAttr(rv, "AdditionalOptions",
a61af66fc99e Initial load
duke
parents:
diff changeset
594 "/export:JNI_GetDefaultJavaVMInitArgs " +
a61af66fc99e Initial load
duke
parents:
diff changeset
595 "/export:JNI_CreateJavaVM " +
a61af66fc99e Initial load
duke
parents:
diff changeset
596 "/export:JNI_GetCreatedJavaVMs "+
a61af66fc99e Initial load
duke
parents:
diff changeset
597 "/export:jio_snprintf /export:jio_printf "+
a61af66fc99e Initial load
duke
parents:
diff changeset
598 "/export:jio_fprintf /export:jio_vfprintf "+
a61af66fc99e Initial load
duke
parents:
diff changeset
599 "/export:jio_vsnprintf ");
a61af66fc99e Initial load
duke
parents:
diff changeset
600 addAttr(rv, "AdditionalDependencies", "Wsock32.lib winmm.lib");
a61af66fc99e Initial load
duke
parents:
diff changeset
601 addAttr(rv, "OutputFile", outDll);
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
602 // Set /INCREMENTAL option. 1 is linkIncrementalNo
0
a61af66fc99e Initial load
duke
parents:
diff changeset
603 addAttr(rv, "LinkIncremental", "1");
a61af66fc99e Initial load
duke
parents:
diff changeset
604 addAttr(rv, "SuppressStartupBanner", "TRUE");
a61af66fc99e Initial load
duke
parents:
diff changeset
605 addAttr(rv, "ModuleDefinitionFile", outDir+Util.sep+"vm.def");
a61af66fc99e Initial load
duke
parents:
diff changeset
606 addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"vm.pdb");
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
607 // Set /SUBSYSTEM option. 2 is subSystemWindows
0
a61af66fc99e Initial load
duke
parents:
diff changeset
608 addAttr(rv, "SubSystem", "2");
a61af66fc99e Initial load
duke
parents:
diff changeset
609 addAttr(rv, "BaseAddress", "0x8000000");
a61af66fc99e Initial load
duke
parents:
diff changeset
610 addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib");
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
611 // Set /MACHINE option. 1 is machineX86
0
a61af66fc99e Initial load
duke
parents:
diff changeset
612 addAttr(rv, "TargetMachine", "1");
a61af66fc99e Initial load
duke
parents:
diff changeset
613
a61af66fc99e Initial load
duke
parents:
diff changeset
614 return rv;
a61af66fc99e Initial load
duke
parents:
diff changeset
615 }
a61af66fc99e Initial load
duke
parents:
diff changeset
616
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
617 void getDebugCompilerFlags_common(String opt,Vector rv) {
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
618
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
619 // Set /On option
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
620 addAttr(rv, "Optimization", opt);
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
621 // Set /FR option. 1 is brAllInfo
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
622 addAttr(rv, "BrowseInformation", "1");
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
623 addAttr(rv, "BrowseInformationFile", "$(IntDir)" + Util.sep);
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
624 // Set /MD option. 2 is rtMultiThreadedDLL
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
625 addAttr(rv, "RuntimeLibrary", "2");
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
626 // Set /Oy- option
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
627 addAttr(rv, "OmitFramePointers", "FALSE");
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
628
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
629 }
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
630
0
a61af66fc99e Initial load
duke
parents:
diff changeset
631 Vector getDebugCompilerFlags(String opt) {
a61af66fc99e Initial load
duke
parents:
diff changeset
632 Vector rv = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
633
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
634 getDebugCompilerFlags_common(opt,rv);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
635
a61af66fc99e Initial load
duke
parents:
diff changeset
636 return rv;
a61af66fc99e Initial load
duke
parents:
diff changeset
637 }
a61af66fc99e Initial load
duke
parents:
diff changeset
638
a61af66fc99e Initial load
duke
parents:
diff changeset
639 Vector getDebugLinkerFlags() {
a61af66fc99e Initial load
duke
parents:
diff changeset
640 Vector rv = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
641
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
642 addAttr(rv, "GenerateDebugInformation", "TRUE"); // == /DEBUG option
0
a61af66fc99e Initial load
duke
parents:
diff changeset
643
a61af66fc99e Initial load
duke
parents:
diff changeset
644 return rv;
a61af66fc99e Initial load
duke
parents:
diff changeset
645 }
a61af66fc99e Initial load
duke
parents:
diff changeset
646
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
647 void getProductCompilerFlags_common(Vector rv) {
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
648 // Set /O2 option. 2 is optimizeMaxSpeed
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
649 addAttr(rv, "Optimization", "2");
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
650 // Set /Oy- option
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
651 addAttr(rv, "OmitFramePointers", "FALSE");
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
652 }
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
653
0
a61af66fc99e Initial load
duke
parents:
diff changeset
654 Vector getProductCompilerFlags() {
a61af66fc99e Initial load
duke
parents:
diff changeset
655 Vector rv = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
656
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
657 getProductCompilerFlags_common(rv);
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
658 // Set /Ob option. 1 is expandOnlyInline
0
a61af66fc99e Initial load
duke
parents:
diff changeset
659 addAttr(rv, "InlineFunctionExpansion", "1");
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
660 // Set /GF option.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
661 addAttr(rv, "StringPooling", "TRUE");
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
662 // Set /MD option. 2 is rtMultiThreadedDLL
0
a61af66fc99e Initial load
duke
parents:
diff changeset
663 addAttr(rv, "RuntimeLibrary", "2");
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
664 // Set /Gy option
0
a61af66fc99e Initial load
duke
parents:
diff changeset
665 addAttr(rv, "EnableFunctionLevelLinking", "TRUE");
a61af66fc99e Initial load
duke
parents:
diff changeset
666
a61af66fc99e Initial load
duke
parents:
diff changeset
667 return rv;
a61af66fc99e Initial load
duke
parents:
diff changeset
668 }
a61af66fc99e Initial load
duke
parents:
diff changeset
669
a61af66fc99e Initial load
duke
parents:
diff changeset
670 Vector getProductLinkerFlags() {
a61af66fc99e Initial load
duke
parents:
diff changeset
671 Vector rv = new Vector();
a61af66fc99e Initial load
duke
parents:
diff changeset
672
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
673 // Set /OPT:REF option. 2 is optReferences
0
a61af66fc99e Initial load
duke
parents:
diff changeset
674 addAttr(rv, "OptimizeReferences", "2");
659
520d43965b1f 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 0
diff changeset
675 // Set /OPT:optFolding option. 2 is optFolding
0
a61af66fc99e Initial load
duke
parents:
diff changeset
676 addAttr(rv, "EnableCOMDATFolding", "2");
a61af66fc99e Initial load
duke
parents:
diff changeset
677
a61af66fc99e Initial load
duke
parents:
diff changeset
678 return rv;
a61af66fc99e Initial load
duke
parents:
diff changeset
679 }
a61af66fc99e Initial load
duke
parents:
diff changeset
680
a61af66fc99e Initial load
duke
parents:
diff changeset
681 String getOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
682 return "2";
a61af66fc99e Initial load
duke
parents:
diff changeset
683 }
a61af66fc99e Initial load
duke
parents:
diff changeset
684
a61af66fc99e Initial load
duke
parents:
diff changeset
685 String getNoOptFlag() {
a61af66fc99e Initial load
duke
parents:
diff changeset
686 return "0";
a61af66fc99e Initial load
duke
parents:
diff changeset
687 }
a61af66fc99e Initial load
duke
parents:
diff changeset
688
a61af66fc99e Initial load
duke
parents:
diff changeset
689 String makeCfgName(String flavourBuild) {
a61af66fc99e Initial load
duke
parents:
diff changeset
690 return flavourBuild + "|" + Util.os;
a61af66fc99e Initial load
duke
parents:
diff changeset
691 }
a61af66fc99e Initial load
duke
parents:
diff changeset
692 }