/* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. * */ import java.io.*; import java.util.*; public class WinGammaPlatformVC7 extends WinGammaPlatform { String projectVersion() {return "7.10";}; public void writeProjectFile(String projectFileName, String projectName, Vector allConfigs) throws IOException { System.out.println(); System.out.println(" Writing .vcproj file..."); // If we got this far without an error, we're safe to actually // write the .vcproj file printWriter = new PrintWriter(new FileWriter(projectFileName)); printWriter.println(""); startTag( "VisualStudioProject", new String[] { "ProjectType", "Visual C++", "Version", projectVersion(), "Name", projectName, "ProjectGUID", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}", "SccProjectName", "", "SccLocalPath", "" } ); startTag("Platforms", null); tag("Platform", new String[] {"Name", Util.os}); endTag("Platforms"); startTag("Configurations", null); for (Iterator i = allConfigs.iterator(); i.hasNext(); ) { writeConfiguration((BuildConfig)i.next()); } endTag("Configurations"); tag("References", null); writeFiles(allConfigs); tag("Globals", null); endTag("VisualStudioProject"); printWriter.close(); System.out.println(" Done."); } abstract class NameFilter { protected String fname; abstract boolean match(FileInfo fi); String filterString() { return ""; } String name() { return this.fname;} } class DirectoryFilter extends NameFilter { String dir; int baseLen, dirLen; DirectoryFilter(String dir, String sbase) { this.dir = dir; this.baseLen = sbase.length(); this.dirLen = dir.length(); this.fname = dir; } DirectoryFilter(String fname, String dir, String sbase) { this.dir = dir; this.baseLen = sbase.length(); this.dirLen = dir.length(); this.fname = fname; } boolean match(FileInfo fi) { return fi.full.regionMatches(true, baseLen, dir, 0, dirLen); } } class TypeFilter extends NameFilter { String[] exts; TypeFilter(String fname, String[] exts) { this.fname = fname; this.exts = exts; } boolean match(FileInfo fi) { for (int i=0; i"); } else { //doIndent(); printWriter.println(">"); } } void startTag(String name, String[] attrs) { startTagPrim(name, attrs, false); } void startTagV(String name, Vector attrs) { String s[] = new String [attrs.size()]; for (int i=0; i"); } void tag(String name, String[] attrs) { startTagPrim(name, attrs, true); } void tagV(String name, Vector attrs) { String s[] = new String [attrs.size()]; for (int i=0; i