public void stageStandard()

in appengine-plugins-core/src/main/java/com/google/cloud/tools/appengine/operations/AppEngineWebXmlProjectStaging.java [49:99]


  public void stageStandard(AppEngineWebXmlProjectStageConfiguration config)
      throws AppEngineException {
    Preconditions.checkNotNull(config);
    Preconditions.checkNotNull(config.getSourceDirectory());
    Preconditions.checkNotNull(config.getStagingDirectory());

    List<String> arguments = new ArrayList<>();

    arguments.addAll(AppCfgArgs.get("enable_quickstart", config.getEnableQuickstart()));
    arguments.addAll(AppCfgArgs.get("disable_update_check", config.getDisableUpdateCheck()));
    arguments.addAll(AppCfgArgs.get("enable_jar_splitting", config.getEnableJarSplitting()));
    arguments.addAll(AppCfgArgs.get("jar_splitting_excludes", config.getJarSplittingExcludes()));
    arguments.addAll(AppCfgArgs.get("compile_encoding", config.getCompileEncoding()));
    arguments.addAll(AppCfgArgs.get("delete_jsps", config.getDeleteJsps()));
    arguments.addAll(AppCfgArgs.get("enable_jar_classes", config.getEnableJarClasses()));
    arguments.addAll(AppCfgArgs.get("disable_jar_jsps", config.getDisableJarJsps()));
    if (config.getRuntime() != null) {
      // currently only java7 is allowed without --allow_any_runtime
      arguments.addAll(AppCfgArgs.get("allow_any_runtime", true));
      arguments.addAll(AppCfgArgs.get("runtime", config.getRuntime()));
    }
    arguments.add("stage");
    arguments.add(config.getSourceDirectory().toString());
    arguments.add(config.getStagingDirectory().toString());

    Path dockerfile = config.getDockerfile();

    try {

      if (dockerfile != null && Files.exists(dockerfile)) {
        Files.copy(
            dockerfile,
            config.getSourceDirectory().resolve(dockerfile.getFileName()),
            StandardCopyOption.REPLACE_EXISTING);
      }

      runner.run(arguments);

      // TODO : Move this fix up the chain (appcfg)
      if (config.getRuntime() != null && config.getRuntime().equals("java")) {
        Path appYaml = config.getStagingDirectory().resolve("app.yaml");
        Files.write(
            appYaml,
            "\nruntime_config:\n  jdk: openjdk8\n".getBytes(StandardCharsets.UTF_8),
            StandardOpenOption.APPEND);
      }

    } catch (IOException | ProcessHandlerException e) {
      throw new AppEngineException(e);
    }
  }