src/edu/clemson/resolve/jetbrains/actions/RunRESOLVEOnLanguageFile.java
/**
     * Run RESOLVE on file according to preferences in intellij for this file.
     * Writes set of generated files or empty set if error.
     */
Run RESOLVE on file according to preferences in intellij for this file.
Writes set of generated files or empty set if error.
Run RESOLVE on file according to preferences in intellij for this file . Writes set of generated files or empty set if error .
public Boolean resolve(String targetFilePath) {
        if (targetFilePath == null) return false;
        LOG.info("resolve(\"" + targetFilePath + "\")");
        LOG.info("args: " + Utils.join(args, " "));
        this.compiler = new RESOLVECompiler(args.toArray(new String[args.size()]));
        ConsoleView console = RESOLVEPluginController.getInstance(project).getConsole();
        RESOLVEPluginController.getInstance(project).console.clear(); 
        String timeStamp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime());
        console.print(timeStamp + ": resolve " + Utils.join(args, " ") + "\n", ConsoleViewContentType.SYSTEM_OUTPUT);
        compiler.removeListeners();
        RunRESOLVEListener defaultListener = new RunRESOLVEListener(compiler, console);
        compiler.addListener(defaultListener);
        if (!listeners.isEmpty()) {
            for (RESOLVECompilerListener l : listeners) {
                compiler.addListener(l);
            }
        }
        try {
            compiler.processCommandLineTargets();
        } catch (Throwable e) {
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);
            e.printStackTrace(pw);
            String msg = sw.toString();
            Notification notification =
                    new Notification(groupDisplayId, "failed to execute " + targetFilePath,
                            e.toString(),
                            NotificationType.INFORMATION);
            Notifications.Bus.notify(notification, project);
            console.print(timeStamp + ": resolve " + msg + "\n", ConsoleViewContentType.SYSTEM_OUTPUT);
            defaultListener.hasOutput = true; 
        }
        if (defaultListener.hasOutput) {
            RESOLVEPluginController.showConsoleWindow(project);
        }
        return compiler.errMgr.getErrorCount() == 0;
    }
public Boolean resolve ( String targetFilePath ) { if ( targetFilePath == null ) return false ; LOG . info ( "resolve(\"" + targetFilePath + "\")" ) ; LOG . info ( "args: " + Utils . join ( args , " " ) ) ; this . compiler = new RESOLVECompiler ( args . toArray ( new String [ args . size ( ) ] ) ) ; ConsoleView console = RESOLVEPluginController . getInstance ( project ) . getConsole ( ) ; RESOLVEPluginController . getInstance ( project ) . console . clear ( ) ; String timeStamp = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) . format ( Calendar . getInstance ( ) . getTime ( ) ) ; console . print ( timeStamp + ": resolve " + Utils . join ( args , " " ) + "\n" , ConsoleViewContentType . SYSTEM_OUTPUT ) ; compiler . removeListeners ( ) ; RunRESOLVEListener defaultListener = new RunRESOLVEListener ( compiler , console ) ; compiler . addListener ( defaultListener ) ; if ( ! listeners . isEmpty ( ) ) { for ( RESOLVECompilerListener l : listeners ) { compiler . addListener ( l ) ; } } try { compiler . processCommandLineTargets ( ) ; } catch ( Throwable e ) { StringWriter sw = new StringWriter ( ) ; PrintWriter pw = new PrintWriter ( sw ) ; e . printStackTrace ( pw ) ; String msg = sw . toString ( ) ; Notification notification = new Notification ( groupDisplayId , "failed to execute " + targetFilePath , e . toString ( ) , NotificationType . INFORMATION ) ; Notifications . Bus . notify ( notification , project ) ; console . print ( timeStamp + ": resolve " + msg + "\n" , ConsoleViewContentType . SYSTEM_OUTPUT ) ; defaultListener . hasOutput = true ; } if ( defaultListener . hasOutput ) { RESOLVEPluginController . showConsoleWindow ( project ) ; } return compiler . errMgr . getErrorCount ( ) == 0 ; }
Run RESOLVE on file according to preferences in intellij for this file.
Run RESOLVE on file according to preferences in intellij for this file .
// String sourcePath = ConfigRESOLVEPerLanguageFile.getParentDir(vfile); //clear it for the current run //add any additional listeners specified // show console below