Beispiel #1
0
  private static void generate(File config, File jar) {
    if (!config.exists()) {
      throw new RuntimeException("Simulation config not found: " + config.getAbsolutePath());
    }

    /* Load simulation */
    logger.info("Loading " + config);
    GUI.externalToolsUserSettingsFile =
        new File(System.getProperty("user.home"), GUI.EXTERNAL_TOOLS_USER_SETTINGS_FILENAME);
    Simulation s = GUI.quickStartSimulationConfig(config, false, null);
    if (s == null) {
      throw new RuntimeException("Error when creating simulation");
    }
    s.stopSimulation();

    try {
      buildExecutableJAR(s.getGUI(), jar);
    } catch (RuntimeException e) {
      logger.fatal(e.getMessage(), e);
      System.exit(1);
    }
    System.exit(0);
  }
 /**
  * Stop simulation (blocks). Calls stopSimulation(true).
  *
  * @see #stopSimulation(boolean)
  */
 public void stopSimulation() {
   stopSimulation(true);
 }