src/share/tools/ProjectCreator/ProjectCreator.java

Wed, 27 Apr 2016 01:25:04 +0800

author
aoqi
date
Wed, 27 Apr 2016 01:25:04 +0800
changeset 0
f90c822e73f8
child 6876
710a3c8b516e
permissions
-rw-r--r--

Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/
changeset: 6782:28b50d07f6f8
tag: jdk8u25-b17

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation.
aoqi@0 8 *
aoqi@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 * accompanied this code).
aoqi@0 14 *
aoqi@0 15 * You should have received a copy of the GNU General Public License version
aoqi@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 *
aoqi@0 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 * or visit www.oracle.com if you need additional information or have any
aoqi@0 21 * questions.
aoqi@0 22 *
aoqi@0 23 */
aoqi@0 24
aoqi@0 25 public class ProjectCreator {
aoqi@0 26
aoqi@0 27 public static void usage() {
aoqi@0 28 System.out.println("ProjectCreator options:");
aoqi@0 29 System.err.println("WinGammaPlatform platform-specific options:");
aoqi@0 30 System.err.println(" -sourceBase <path to directory (workspace) "
aoqi@0 31 + "containing source files; no trailing slash>");
aoqi@0 32 System.err.println(" -dspFileName <full pathname to which .dsp file "
aoqi@0 33 + "will be written; all parent directories must "
aoqi@0 34 + "already exist>");
aoqi@0 35 System.err.println(" -envVar <environment variable to be inserted "
aoqi@0 36 + "into .dsp file, substituting for path given in "
aoqi@0 37 + "-sourceBase. Example: HotSpotWorkSpace>");
aoqi@0 38 System.err.println(" -dllLoc <path to directory in which to put "
aoqi@0 39 + "jvm.dll; no trailing slash>");
aoqi@0 40 System.err.println(" If any of the above are specified, "
aoqi@0 41 + "they must all be.");
aoqi@0 42 System.err.println(" Note: if '-altRelativeInclude' option below is "
aoqi@0 43 + "used, then the '-relativeAltSrcInclude' option must be used "
aoqi@0 44 + "to specify the alternate source dir, e.g., 'src\\closed'");
aoqi@0 45 System.err.println(" Additional, optional arguments, which can be "
aoqi@0 46 + "specified multiple times:");
aoqi@0 47 System.err.println(" -absoluteInclude <string containing absolute "
aoqi@0 48 + "path to include directory>");
aoqi@0 49 System.err.println(" -altRelativeInclude <string containing "
aoqi@0 50 + "alternate include directory relative to -envVar>");
aoqi@0 51 System.err.println(" -relativeInclude <string containing include "
aoqi@0 52 + "directory relative to -envVar>");
aoqi@0 53 System.err.println(" -define <preprocessor flag to be #defined "
aoqi@0 54 + "(note: doesn't yet support " + "#define (flag) (value))>");
aoqi@0 55 System.err.println(" -perFileLine <file> <line>");
aoqi@0 56 System.err.println(" -conditionalPerFileLine <file> <line for "
aoqi@0 57 + "release build> <line for debug build>");
aoqi@0 58 System.err.println(" (NOTE: To work around a bug in nmake, where "
aoqi@0 59 + "you can't have a '#' character in a quoted "
aoqi@0 60 + "string, all of the lines outputted have \"#\"" + "prepended)");
aoqi@0 61 System.err.println(" -startAt <subdir of sourceBase>");
aoqi@0 62 System.err.println(" -ignoreFile <file which won't be able to be "
aoqi@0 63 + "found in the sourceBase because it's generated " + "later>");
aoqi@0 64 System.err.println(" -additionalFile <file not in database but "
aoqi@0 65 + "which should show up in .dsp file>");
aoqi@0 66 System.err
aoqi@0 67 .println(" -additionalGeneratedFile <environment variable of "
aoqi@0 68 + "generated file's location> <relative path to "
aoqi@0 69 + "directory containing file; no trailing slash> "
aoqi@0 70 + "<name of file generated later in the build process>");
aoqi@0 71 System.err.println(" -prelink <build> <desc> <cmds>:");
aoqi@0 72 System.err
aoqi@0 73 .println(" Generate a set of prelink commands for the given BUILD");
aoqi@0 74 System.err
aoqi@0 75 .println(" (\"Debug\" or \"Release\"). The prelink description and commands");
aoqi@0 76 System.err.println(" are both quoted strings.");
aoqi@0 77 System.err.println(" Default includes: \".\"");
aoqi@0 78 System.err
aoqi@0 79 .println(" Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\"");
aoqi@0 80 }
aoqi@0 81
aoqi@0 82 public static void main(String[] args) {
aoqi@0 83 try {
aoqi@0 84 if (args.length < 3) {
aoqi@0 85 usage();
aoqi@0 86 System.exit(1);
aoqi@0 87 }
aoqi@0 88
aoqi@0 89 String platformName = args[0];
aoqi@0 90 Class platformClass = Class.forName(platformName);
aoqi@0 91 WinGammaPlatform platform = (WinGammaPlatform) platformClass
aoqi@0 92 .newInstance();
aoqi@0 93
aoqi@0 94 String[] platformArgs = new String[args.length - 1];
aoqi@0 95 System.arraycopy(args, 1, platformArgs, 0, platformArgs.length);
aoqi@0 96
aoqi@0 97 // Allow the platform to write platform-specific files
aoqi@0 98 platform.createVcproj(platformArgs);
aoqi@0 99 } catch (Exception e) {
aoqi@0 100 e.printStackTrace();
aoqi@0 101 System.exit(1);
aoqi@0 102 }
aoqi@0 103 }
aoqi@0 104 }

mercurial