예제 #1
0
  private void performAction(Project... projects) {
    projectMediator.saveAllFiles();
    for (final Project project : projects) {
      final TmcProjectInfo projectInfo = projectMediator.wrapProject(project);
      eventBus.post(new InvokedEvent(projectInfo));
      BgTask.start(
          "Compiling project",
          startCompilingProject(projectInfo),
          new BgTaskListener<Integer>() {
            @Override
            public void bgTaskReady(Integer result) {
              if (result == 0) {
                startRunningTests(projectInfo);
              } else {
                dialogDisplayer.displayError("The code did not compile.");
              }
            }

            @Override
            public void bgTaskFailed(Throwable ex) {
              dialogDisplayer.displayError("Failed to compile the code.");
            }

            @Override
            public void bgTaskCancelled() {}
          });
    }
  }
예제 #2
0
 private Integer getMemoryLimit(Project project) {
   Exercise ex =
       projectMediator.tryGetExerciseForProject(projectMediator.wrapProject(project), courseDb);
   if (ex != null) {
     return ex.getMemoryLimit();
   } else {
     return null;
   }
 }