FileDocCategorySizeDatePackage
Win32IDETool.javaAPI DocphoneME MR2 API (J2ME)63397Wed May 02 17:59:48 BST 2007makedep

Win32IDETool

public class Win32IDETool extends IDETool
Win32IDETool creates a cldc_vm.dsw project file for building the VM inside Visual Studio 6.0. To get started:
  • Change to the build\win32_i386_ide subdirectory of this VM source distribution;
  • Type "idetool create" in the Command Prompt.
Output structure: $(BuildSpace)/cldc_vm.dsw $(BuildSpace)/javaapi/javaapi.dsp jcc.zip classes.zip NativesTable.cpp $(BuildSpace)/loopgen/loopgen.dsp Debug/loopgen.exe $(BuildSpace)/loop/loop.dsp $(BuildSpace)/romgen/romgen.dsp $(BuildSpace)/romgen/Release/romgen.exe $(BuildSpace)/romimage/romimage.dsp $(BuildSpace)/romimage/ROMImage.cpp $(BuildSpace)/cldc_vm/cldc_vm.dsp $(BuildSpace)/cldc_vm/Debug/Interpreter_i386.asm $(BuildSpace)/cldc_vm/Debug/OopMaps.cpp Debug/cldc_vm.exe Release/cldc_vm.exe Product/cldc_vm.exe

Fields Summary
public static String
DEBUG_LOOPGEN
public static String
DEBUG_ROMGEN
Constructors Summary
Methods Summary
public voidexecute(java.lang.String[] args)

        parseArguments(args);
        initConfigurator(); // in IDETool
        setUserSettings(queryUserSettings());

        VC6WorkSpace vc6ws = new VC6WorkSpace(this);

        // (1) API project
        VC6JavaAPIProject apiProject = new VC6JavaAPIProject(this);

        // (2) Loop generator project
        VC6VMProject loopgenProject =
            new VC6VMProject(this, "loopgen", "i386", VC6VMProject.LOOPGEN);
        loopgenProject.addDependency(apiProject);

        // (2) Interpreter Loop project
        VC6LoopProject loopProject = null;
        loopProject = new VC6LoopProject(this);
        loopProject.addDependency(loopgenProject);

        VC6VMProject romgenProject = null;
        VC6ROMImageProject romimageProject = null;

        if (isRomizing()) {
            // (3) ROM generator project
            romgenProject =
                new VC6VMProject(this, "romgen", "i386", VC6VMProject.ROMGEN);
            romgenProject.addDependency(apiProject);
            romgenProject.addDependency(loopgenProject);
            romgenProject.addDependency(loopProject);

            romimageProject = new VC6ROMImageProject(this);
            romimageProject.addDependency(romgenProject);
        }

        // (5) Target project
        VC6VMProject targetProject =
            new VC6VMProject(this, "cldc_vm", "i386", VC6VMProject.TARGET);
        targetProject.addDependency(apiProject);
        targetProject.addDependency(loopgenProject);

        if (isRomizing()) {
            targetProject.addDependency(romimageProject);
        }

        vc6ws.addProject(apiProject);
        vc6ws.addProject(loopgenProject);
        vc6ws.addProject(loopProject);
        if (isRomizing()) {
            vc6ws.addProject(romgenProject);
            vc6ws.addProject(romimageProject);
        }
        vc6ws.addProject(targetProject);

        vc6ws.write();
        System.exit(0);
    
java.util.VectorgetBuildOptions()

        Vector v = new Vector();
        v.addElement("ROMIZING");
        Vector enableFlags = configurator.getFlagNames();
        for (int i=0; i<enableFlags.size(); i++) {
            v.addElement((String)enableFlags.elementAt(i));
        }

        return v;
    
public java.lang.StringgetExecutablePath(java.lang.String name)

        Object path = getUserSettings().get(name);
        if (path != null && (path instanceof String)) {
            String result = getAbsolutePath((String)path);
            //System.out.println(name + " = " + result);
            return result;
        } else {
            return name;
        }
    
java.util.VectorgetGeneratorOptions()

        Vector v = new Vector();
        v.addElement(DEBUG_LOOPGEN);
        v.addElement(DEBUG_ROMGEN);

        return v;
    
java.util.VectorgetPaths()

        Vector v = new Vector();
        v.addElement("javac.exe");
        v.addElement("java.exe");
        v.addElement("jar.exe");
        v.addElement("ml.exe");
        v.addElement("preverify.exe");

        return v;
    
public booleanisRomizing()

        return isOptionEnabled("ROMIZING");
    
public static voidmain(java.lang.String[] args)


         
        Win32IDETool tool = new Win32IDETool();
        try {
            tool.execute(args);
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    
public intparseOneArgument(java.lang.String[] args, int i)

        return super.parseOneArgument(args, i);
    
java.util.PropertiesqueryUserSettings()
Read user settings from $BuildSpace/prefs.props, then pop up a dialog to ask for user modification

        Properties props = new Properties();

        // Put default settings
        Vector v = getBuildOptions();
        for (int i=0; i<v.size(); i++) {
            String name = (String)v.elementAt(i);
            if (name.equals("ROMIZING")) {
                props.put(v.elementAt(i), "true");
            } else {
                props.put(v.elementAt(i), "default");
            }
        }

        props.put(DEBUG_LOOPGEN, "true");
        props.put(DEBUG_ROMGEN,  "false");

        String workspace = getWorkSpaceArg();
        String preverify = workspace + "/build/share/bin/win32_i386/" +
                           "preverify.exe";
        preverify = preverify.replace('/", File.separatorChar);

        props.put("javac.exe",     "");
        props.put("java.exe",      "");
        props.put("jar.exe",       "");
        props.put("ml.exe",        "");
        props.put("preverify.exe", preverify);

        String prefsFile = getOutputFileFullPath("prefs.props");
        try {
            // Load from saved values
            FileInputStream in = new FileInputStream(prefsFile);
            props.load(in);
            in.close();
        } catch (IOException e) {
            // ignore it
        }

        Win32IDESettingsDialog dialog = new Win32IDESettingsDialog();


        // The following call blocks until the user has finished with
        // dialog.
        dialog.getUserInput(props, getBuildOptions(),
                            getGeneratorOptions(),
                            getPaths());

        try {
            FileOutputStream out = new FileOutputStream(prefsFile);
            props.store(out, "");
            out.close();
        } catch (IOException e) {
            // ignore it
        }

        return props;