annotate src/share/tools/ProjectCreator/ProjectCreator.java @ 6273:4c8f2a12e757 hs24-b20

Merge
author twisti
date Fri, 10 Aug 2012 17:50:24 -0700
parents f95d63e2154a
children 06f017f7daa7 1a9b9cfcef41
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
0
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 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 public class ProjectCreator {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 public static void usage() {
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 System.out.println("ProjectCreator options:");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
29 System.err.println("WinGammaPlatform platform-specific options:");
a61af66fc99e Initial load
duke
parents:
diff changeset
30 System.err.println(" -sourceBase <path to directory (workspace) " +
a61af66fc99e Initial load
duke
parents:
diff changeset
31 "containing source files; no trailing slash>");
a61af66fc99e Initial load
duke
parents:
diff changeset
32 System.err.println(" -dspFileName <full pathname to which .dsp file " +
a61af66fc99e Initial load
duke
parents:
diff changeset
33 "will be written; all parent directories must " +
a61af66fc99e Initial load
duke
parents:
diff changeset
34 "already exist>");
a61af66fc99e Initial load
duke
parents:
diff changeset
35 System.err.println(" -envVar <environment variable to be inserted " +
a61af66fc99e Initial load
duke
parents:
diff changeset
36 "into .dsp file, substituting for path given in " +
a61af66fc99e Initial load
duke
parents:
diff changeset
37 "-sourceBase. Example: HotSpotWorkSpace>");
a61af66fc99e Initial load
duke
parents:
diff changeset
38 System.err.println(" -dllLoc <path to directory in which to put " +
a61af66fc99e Initial load
duke
parents:
diff changeset
39 "jvm.dll and jvm_g.dll; no trailing slash>");
a61af66fc99e Initial load
duke
parents:
diff changeset
40 System.err.println(" If any of the above are specified, "+
a61af66fc99e Initial load
duke
parents:
diff changeset
41 "they must all be.");
a61af66fc99e Initial load
duke
parents:
diff changeset
42 System.err.println(" Additional, optional arguments, which can be " +
a61af66fc99e Initial load
duke
parents:
diff changeset
43 "specified multiple times:");
a61af66fc99e Initial load
duke
parents:
diff changeset
44 System.err.println(" -absoluteInclude <string containing absolute " +
a61af66fc99e Initial load
duke
parents:
diff changeset
45 "path to include directory>");
a61af66fc99e Initial load
duke
parents:
diff changeset
46 System.err.println(" -relativeInclude <string containing include " +
a61af66fc99e Initial load
duke
parents:
diff changeset
47 "directory relative to -envVar>");
a61af66fc99e Initial load
duke
parents:
diff changeset
48 System.err.println(" -define <preprocessor flag to be #defined " +
a61af66fc99e Initial load
duke
parents:
diff changeset
49 "(note: doesn't yet support " +
a61af66fc99e Initial load
duke
parents:
diff changeset
50 "#define (flag) (value))>");
a61af66fc99e Initial load
duke
parents:
diff changeset
51 System.err.println(" -perFileLine <file> <line>");
a61af66fc99e Initial load
duke
parents:
diff changeset
52 System.err.println(" -conditionalPerFileLine <file> <line for " +
a61af66fc99e Initial load
duke
parents:
diff changeset
53 "release build> <line for debug build>");
a61af66fc99e Initial load
duke
parents:
diff changeset
54 System.err.println(" (NOTE: To work around a bug in nmake, where " +
a61af66fc99e Initial load
duke
parents:
diff changeset
55 "you can't have a '#' character in a quoted " +
a61af66fc99e Initial load
duke
parents:
diff changeset
56 "string, all of the lines outputted have \"#\"" +
a61af66fc99e Initial load
duke
parents:
diff changeset
57 "prepended)");
a61af66fc99e Initial load
duke
parents:
diff changeset
58 System.err.println(" -startAt <subdir of sourceBase>");
a61af66fc99e Initial load
duke
parents:
diff changeset
59 System.err.println(" -ignoreFile <file which won't be able to be " +
a61af66fc99e Initial load
duke
parents:
diff changeset
60 "found in the sourceBase because it's generated " +
a61af66fc99e Initial load
duke
parents:
diff changeset
61 "later>");
a61af66fc99e Initial load
duke
parents:
diff changeset
62 System.err.println(" -additionalFile <file not in database but " +
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
63 "which should show up in .dsp file>");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
64 System.err.println(" -additionalGeneratedFile <environment variable of " +
a61af66fc99e Initial load
duke
parents:
diff changeset
65 "generated file's location> <relative path to " +
a61af66fc99e Initial load
duke
parents:
diff changeset
66 "directory containing file; no trailing slash> " +
a61af66fc99e Initial load
duke
parents:
diff changeset
67 "<name of file generated later in the build process>");
a61af66fc99e Initial load
duke
parents:
diff changeset
68 System.err.println(" -prelink <build> <desc> <cmds>:");
a61af66fc99e Initial load
duke
parents:
diff changeset
69 System.err.println(" Generate a set of prelink commands for the given BUILD");
a61af66fc99e Initial load
duke
parents:
diff changeset
70 System.err.println(" (\"Debug\" or \"Release\"). The prelink description and commands");
a61af66fc99e Initial load
duke
parents:
diff changeset
71 System.err.println(" are both quoted strings.");
a61af66fc99e Initial load
duke
parents:
diff changeset
72 System.err.println(" Default includes: \".\"");
a61af66fc99e Initial load
duke
parents:
diff changeset
73 System.err.println(" Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\"");
a61af66fc99e Initial load
duke
parents:
diff changeset
74 }
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 public static void main(String[] args) {
a61af66fc99e Initial load
duke
parents:
diff changeset
77 try {
a61af66fc99e Initial load
duke
parents:
diff changeset
78 if (args.length < 3) {
a61af66fc99e Initial load
duke
parents:
diff changeset
79 usage();
a61af66fc99e Initial load
duke
parents:
diff changeset
80 System.exit(1);
a61af66fc99e Initial load
duke
parents:
diff changeset
81 }
a61af66fc99e Initial load
duke
parents:
diff changeset
82
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
83 String platformName = args[0];
0
a61af66fc99e Initial load
duke
parents:
diff changeset
84 Class platformClass = Class.forName(platformName);
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
85 WinGammaPlatform platform = (WinGammaPlatform) platformClass.newInstance();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
86
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
87 String[] platformArgs = new String[args.length - 1];
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
88 System.arraycopy(args, 1, platformArgs, 0, platformArgs.length);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
89
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
90 // Allow the platform to write platform-specific files
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
91 platform.createVcproj(platformArgs);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
92 }
a61af66fc99e Initial load
duke
parents:
diff changeset
93 catch (Exception e) {
a61af66fc99e Initial load
duke
parents:
diff changeset
94 e.printStackTrace();
a61af66fc99e Initial load
duke
parents:
diff changeset
95 System.exit(1);
a61af66fc99e Initial load
duke
parents:
diff changeset
96 }
a61af66fc99e Initial load
duke
parents:
diff changeset
97 }
a61af66fc99e Initial load
duke
parents:
diff changeset
98 }