Mercurial > hg > graal-jvmci-8
comparison src/share/tools/ProjectCreator/ProjectCreator.java @ 6801:1a9b9cfcef41
7163863: Updated projectcreator
Summary: Enable source browsing for all platform dependent code
Reviewed-by: brutisso, coleenp
author | neliasso |
---|---|
date | Thu, 29 Mar 2012 16:43:21 +0200 |
parents | f95d63e2154a |
children | b9a9ed0f8eeb |
comparison
equal
deleted
inserted
replaced
6800:9191895df19d | 6801:1a9b9cfcef41 |
---|---|
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 public class ProjectCreator { | 25 public class ProjectCreator { |
26 | 26 |
27 public static void usage() { | 27 public static void usage() { |
28 System.out.println("ProjectCreator options:"); | 28 System.out.println("ProjectCreator options:"); |
29 System.err.println("WinGammaPlatform platform-specific options:"); | 29 System.err.println("WinGammaPlatform platform-specific options:"); |
30 System.err.println(" -sourceBase <path to directory (workspace) " + | 30 System.err.println(" -sourceBase <path to directory (workspace) " |
31 "containing source files; no trailing slash>"); | 31 + "containing source files; no trailing slash>"); |
32 System.err.println(" -dspFileName <full pathname to which .dsp file " + | 32 System.err.println(" -dspFileName <full pathname to which .dsp file " |
33 "will be written; all parent directories must " + | 33 + "will be written; all parent directories must " |
34 "already exist>"); | 34 + "already exist>"); |
35 System.err.println(" -envVar <environment variable to be inserted " + | 35 System.err.println(" -envVar <environment variable to be inserted " |
36 "into .dsp file, substituting for path given in " + | 36 + "into .dsp file, substituting for path given in " |
37 "-sourceBase. Example: HotSpotWorkSpace>"); | 37 + "-sourceBase. Example: HotSpotWorkSpace>"); |
38 System.err.println(" -dllLoc <path to directory in which to put " + | 38 System.err.println(" -dllLoc <path to directory in which to put " |
39 "jvm.dll and jvm_g.dll; no trailing slash>"); | 39 + "jvm.dll and jvm_g.dll; no trailing slash>"); |
40 System.err.println(" If any of the above are specified, "+ | 40 System.err.println(" If any of the above are specified, " |
41 "they must all be."); | 41 + "they must all be."); |
42 System.err.println(" Additional, optional arguments, which can be " + | 42 System.err.println(" Additional, optional arguments, which can be " |
43 "specified multiple times:"); | 43 + "specified multiple times:"); |
44 System.err.println(" -absoluteInclude <string containing absolute " + | 44 System.err.println(" -absoluteInclude <string containing absolute " |
45 "path to include directory>"); | 45 + "path to include directory>"); |
46 System.err.println(" -relativeInclude <string containing include " + | 46 System.err.println(" -relativeInclude <string containing include " |
47 "directory relative to -envVar>"); | 47 + "directory relative to -envVar>"); |
48 System.err.println(" -define <preprocessor flag to be #defined " + | 48 System.err.println(" -define <preprocessor flag to be #defined " |
49 "(note: doesn't yet support " + | 49 + "(note: doesn't yet support " + "#define (flag) (value))>"); |
50 "#define (flag) (value))>"); | 50 System.err.println(" -perFileLine <file> <line>"); |
51 System.err.println(" -perFileLine <file> <line>"); | 51 System.err.println(" -conditionalPerFileLine <file> <line for " |
52 System.err.println(" -conditionalPerFileLine <file> <line for " + | 52 + "release build> <line for debug build>"); |
53 "release build> <line for debug build>"); | 53 System.err.println(" (NOTE: To work around a bug in nmake, where " |
54 System.err.println(" (NOTE: To work around a bug in nmake, where " + | 54 + "you can't have a '#' character in a quoted " |
55 "you can't have a '#' character in a quoted " + | 55 + "string, all of the lines outputted have \"#\"" + "prepended)"); |
56 "string, all of the lines outputted have \"#\"" + | 56 System.err.println(" -startAt <subdir of sourceBase>"); |
57 "prepended)"); | 57 System.err.println(" -ignoreFile <file which won't be able to be " |
58 System.err.println(" -startAt <subdir of sourceBase>"); | 58 + "found in the sourceBase because it's generated " + "later>"); |
59 System.err.println(" -ignoreFile <file which won't be able to be " + | 59 System.err.println(" -additionalFile <file not in database but " |
60 "found in the sourceBase because it's generated " + | 60 + "which should show up in .dsp file>"); |
61 "later>"); | 61 System.err |
62 System.err.println(" -additionalFile <file not in database but " + | 62 .println(" -additionalGeneratedFile <environment variable of " |
63 "which should show up in .dsp file>"); | 63 + "generated file's location> <relative path to " |
64 System.err.println(" -additionalGeneratedFile <environment variable of " + | 64 + "directory containing file; no trailing slash> " |
65 "generated file's location> <relative path to " + | 65 + "<name of file generated later in the build process>"); |
66 "directory containing file; no trailing slash> " + | 66 System.err.println(" -prelink <build> <desc> <cmds>:"); |
67 "<name of file generated later in the build process>"); | 67 System.err |
68 System.err.println(" -prelink <build> <desc> <cmds>:"); | 68 .println(" Generate a set of prelink commands for the given BUILD"); |
69 System.err.println(" Generate a set of prelink commands for the given BUILD"); | 69 System.err |
70 System.err.println(" (\"Debug\" or \"Release\"). The prelink description and commands"); | 70 .println(" (\"Debug\" or \"Release\"). The prelink description and commands"); |
71 System.err.println(" are both quoted strings."); | 71 System.err.println(" are both quoted strings."); |
72 System.err.println(" Default includes: \".\""); | 72 System.err.println(" Default includes: \".\""); |
73 System.err.println(" Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\""); | 73 System.err |
74 } | 74 .println(" Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\""); |
75 } | |
75 | 76 |
76 public static void main(String[] args) { | 77 public static void main(String[] args) { |
77 try { | 78 try { |
78 if (args.length < 3) { | 79 if (args.length < 3) { |
79 usage(); | 80 usage(); |
80 System.exit(1); | 81 System.exit(1); |
81 } | 82 } |
82 | 83 |
83 String platformName = args[0]; | 84 String platformName = args[0]; |
84 Class platformClass = Class.forName(platformName); | 85 Class platformClass = Class.forName(platformName); |
85 WinGammaPlatform platform = (WinGammaPlatform) platformClass.newInstance(); | 86 WinGammaPlatform platform = (WinGammaPlatform) platformClass |
87 .newInstance(); | |
86 | 88 |
87 String[] platformArgs = new String[args.length - 1]; | 89 String[] platformArgs = new String[args.length - 1]; |
88 System.arraycopy(args, 1, platformArgs, 0, platformArgs.length); | 90 System.arraycopy(args, 1, platformArgs, 0, platformArgs.length); |
89 | 91 |
90 // Allow the platform to write platform-specific files | 92 // Allow the platform to write platform-specific files |
91 platform.createVcproj(platformArgs); | 93 platform.createVcproj(platformArgs); |
92 } | 94 } catch (Exception e) { |
93 catch (Exception e) { | 95 e.printStackTrace(); |
94 e.printStackTrace(); | 96 System.exit(1); |
95 System.exit(1); | 97 } |
96 } | 98 } |
97 } | |
98 } | 99 } |