duke@435: /* stefank@2314: * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. duke@435: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@435: * duke@435: * This code is free software; you can redistribute it and/or modify it duke@435: * under the terms of the GNU General Public License version 2 only, as duke@435: * published by the Free Software Foundation. duke@435: * duke@435: * This code is distributed in the hope that it will be useful, but WITHOUT duke@435: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@435: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@435: * version 2 for more details (a copy is included in the LICENSE file that duke@435: * accompanied this code). duke@435: * duke@435: * You should have received a copy of the GNU General Public License version duke@435: * 2 along with this work; if not, write to the Free Software Foundation, duke@435: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@435: * trims@1907: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA trims@1907: * or visit www.oracle.com if you need additional information or have any trims@1907: * questions. duke@435: * duke@435: */ duke@435: stefank@2314: public class ProjectCreator { duke@435: neliasso@4112: public static void usage() { neliasso@4112: System.out.println("ProjectCreator options:"); neliasso@4112: System.err.println("WinGammaPlatform platform-specific options:"); neliasso@4112: System.err.println(" -sourceBase "); neliasso@4112: System.err.println(" -dspFileName "); neliasso@4112: System.err.println(" -envVar "); neliasso@4112: System.err.println(" -dllLoc "); neliasso@4112: System.err.println(" If any of the above are specified, " neliasso@4112: + "they must all be."); neliasso@4112: System.err.println(" Additional, optional arguments, which can be " neliasso@4112: + "specified multiple times:"); neliasso@4112: System.err.println(" -absoluteInclude "); neliasso@4112: System.err.println(" -relativeInclude "); neliasso@4112: System.err.println(" -define "); neliasso@4112: System.err.println(" -perFileLine "); neliasso@4112: System.err.println(" -conditionalPerFileLine "); neliasso@4112: System.err.println(" (NOTE: To work around a bug in nmake, where " neliasso@4112: + "you can't have a '#' character in a quoted " neliasso@4112: + "string, all of the lines outputted have \"#\"" + "prepended)"); neliasso@4112: System.err.println(" -startAt "); neliasso@4112: System.err.println(" -ignoreFile "); neliasso@4112: System.err.println(" -additionalFile "); neliasso@4112: System.err neliasso@4112: .println(" -additionalGeneratedFile " neliasso@4112: + ""); neliasso@4112: System.err.println(" -prelink :"); neliasso@4112: System.err neliasso@4112: .println(" Generate a set of prelink commands for the given BUILD"); neliasso@4112: System.err neliasso@4112: .println(" (\"Debug\" or \"Release\"). The prelink description and commands"); neliasso@4112: System.err.println(" are both quoted strings."); neliasso@4112: System.err.println(" Default includes: \".\""); neliasso@4112: System.err neliasso@4112: .println(" Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\""); neliasso@4112: } duke@435: neliasso@4112: public static void main(String[] args) { neliasso@4112: try { neliasso@4112: if (args.length < 3) { neliasso@4112: usage(); neliasso@4112: System.exit(1); neliasso@4112: } duke@435: neliasso@4112: String platformName = args[0]; neliasso@4112: Class platformClass = Class.forName(platformName); neliasso@4112: WinGammaPlatform platform = (WinGammaPlatform) platformClass neliasso@4112: .newInstance(); duke@435: neliasso@4112: String[] platformArgs = new String[args.length - 1]; neliasso@4112: System.arraycopy(args, 1, platformArgs, 0, platformArgs.length); duke@435: neliasso@4112: // Allow the platform to write platform-specific files neliasso@4112: platform.createVcproj(platformArgs); neliasso@4112: } catch (Exception e) { neliasso@4112: e.printStackTrace(); neliasso@4112: System.exit(1); neliasso@4112: } neliasso@4112: } duke@435: }