Methods Summary |
---|
public static void | fatal(java.lang.String message)
System.out.println("Error: " + message);
System.exit(1);
|
java.util.Vector | findAPISources()
Vector v = new Vector();
String s = File.separator;
String cldc_ver;
if (isOptionEnabled("ENABLE_REFLECTION")) {
cldc_ver = "cldc1.1plus";
} else if (isOptionEnabled("ENABLE_CLDC_11")) {
cldc_ver = "cldc1.1";
} else {
cldc_ver = "cldc1.0";
}
findSources(v, workspace + s + "src" + s + "javaapi" + s + cldc_ver,
".java");
findSources(v, workspace + s + "src" + s + "javaapi" + s + "share",
".java");
return v;
|
java.util.Vector | findJccSources()
Vector v = new Vector();
String s = File.separator;
findSources(v, workspace + s + "src" + s + "tools" + s + "jcc",
".java");
return v;
|
void | findSources(java.util.Vector v, java.lang.String path, java.lang.String extension)
File dir = new File(path);
if (dir.isDirectory()) {
if (path.endsWith("SCCS")) {
return;
}
if (path.endsWith("CVS")) {
return;
}
String files[] = dir.list();
for (int i=0; i<files.length; i++) {
findSources(v, path + File.separator + files[i], extension);
}
} else {
if (extension.equals(".java")) {
if (!isOptionEnabled("ENABLE_ISOLATES") &&
(path.indexOf("isolate") != -1 ||
path.endsWith("Reflect.java"))) {
return;
}
if (!isOptionEnabled("ENABLE_DYNUPDATE") &&
path.indexOf("dynupdate") != -1) {
return;
}
if (!isOptionEnabled("ENABLE_METHOD_TRAPS") &&
path.endsWith("MethodTrap.java")) {
return;
}
if (!isOptionEnabled("ENABLE_JAVA_DEBUGGER") &&
path.endsWith("DebuggerInvoke.java")) {
return;
}
}
if (path.endsWith(extension)) {
v.addElement(path);
}
}
|
public java.util.Vector | getAPISources()
if (apiSources == null) {
apiSources = findAPISources();
}
return apiSources;
|
public java.lang.String | getAbsolutePath(java.lang.String path)
File file = new File(path);
if (!file.isAbsolute()) {
path = pwd + File.separator + path;
}
while (path.indexOf("..") >= 0) {
Vector v = splitPath(path);
removeOneDotDot(v);
path = joinPath(v);
}
return path;
|
public java.lang.String | getBuildSpaceArg()
return buildspace;
|
public java.lang.String | getDatabaseArg()
return database;
|
public abstract java.lang.String | getExecutablePath(java.lang.String name)
|
public java.util.Vector | getJccSources()
if (jccSources == null) {
jccSources = findJccSources();
}
return jccSources;
|
java.lang.String | getOutputFileFullPath(java.lang.String f)
// IMPL_NOTE: allow different name than "win32_i386_ide"
return buildspace + File.separator +
"win32_i386_ide" + File.separator + f;
|
public java.lang.String | getPlatformArg()
return platform;
|
public java.lang.String | getProductArg()
return product;
|
public java.util.Properties | getUserSettings()
return userSettings;
|
public java.lang.String | getWorkSpaceArg()
return workspace;
|
void | initConfigurator()
configurator = new Configurator();
String workspace = getWorkSpaceArg();
String input = workspace + "/src/vm/share/utilities/BuildFlags.hpp";
configurator.readProductFile(product);
configurator.readPlatformFile(platform);
configurator.readInputFile(input);
|
public boolean | isDefaultBuildspace()
return workspace.equals("..\\..") && buildspace.equals("..");
|
public boolean | isOptionEnabled(java.lang.String name)
String value = (String)getUserSettings().get(name);
if ("default".equals(value)) {
value = configurator.getDefaultValue(name);
}
return "true".equals(value);
|
static java.lang.String | joinPath(java.util.Vector v)
String sep = "";
StringBuffer sbuf = new StringBuffer();
for (int i=0; i<v.size(); i++) {
sbuf.append(sep);
sbuf.append(v.elementAt(i));
sep = File.separator;
}
return sbuf.toString();
|
void | makeDirExist(java.lang.String dirName)
dirName = getOutputFileFullPath(dirName);
File dir = new File(dirName);
if (dir.exists()) {
if (!dir.isDirectory()) {
fatal("not a directory: " + dir);
}
} else {
if (!dir.mkdir()) {
fatal("failed to create directory: "+ dir);
}
}
|
public java.io.PrintWriter | openOutputFile(java.lang.String fileName)
fileName = getOutputFileFullPath(fileName);
File file = new File(fileName);
File dir = file.getParentFile();
if (!dir.exists()) {
dir.mkdir();
}
return new PrintWriter(new FileWriter(fileName));
|
public void | parseArguments(java.lang.String[] args)
for (int i=0; i<args.length; ) {
try {
int n = parseOneArgument(args, i);
if (n <= 0) {
fatal("unknown argument " + args[i]);
} else {
i += n;
}
} catch (ArrayIndexOutOfBoundsException e) {
fatal("parameter missing for argument " + args[i]);
}
}
if (getWorkSpaceArg().indexOf(' ") >= 0) {
fatal("workspace name \"" + getWorkSpaceArg() +
"\" may not contain space character");
}
if (getBuildSpaceArg().indexOf(' ") >= 0) {
fatal("buildspace name \"" + getBuildSpaceArg() +
"\" may not contain space character");
}
|
public int | parseOneArgument(java.lang.String[] args, int i)Override this method in a subclass if you want to parse extra arguments.
int starting_i = i;
String arg = args[i++];
if (arg.equals("-buildspace")) {
this.buildspace = args[i++];
}
else if (arg.equals("-product")) {
this.product = args[i++];
}
else if (arg.equals("-platform")) {
this.platform = args[i++];
}
else if (arg.equals("-database")) {
this.database = args[i++];
}
else if (arg.equals("-workspace")) {
this.workspace = args[i++];
}
else {
// unknown argument
return -1;
}
return i - starting_i;
|
static void | removeOneDotDot(java.util.Vector v)
for (int i=0; i<v.size()-1; i++) {
if (v.elementAt(i+1).equals("..")) {
v.removeElementAt(i);
v.removeElementAt(i);
return;
}
}
|
public void | setUserSettings(java.util.Properties s)Sets this.userSettings, which contains the preferences of the user.
If the user does not specify a value for a certain build option,
a default value is taken. See Configurator.java for details.
userSettings = s;
|
static java.util.Vector | splitPath(java.lang.String path)
Vector v = new Vector();
StringTokenizer st = new StringTokenizer(path, File.separator);
while (st.hasMoreTokens()) {
String f = st.nextToken();
v.addElement(f);
}
return v;
|