All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.appengine.tools.development.DevAppServerMain Maven / Gradle / Ivy

Go to download

SDK for dev_appserver (local development) with some of the dependencies shaded (repackaged)

There is a newer version: 2.0.31
Show newest version
/*
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.appengine.tools.development;

import static java.nio.charset.StandardCharsets.UTF_8;

import com.google.appengine.tools.util.Action;
import com.google.appengine.tools.util.Option;
import com.google.appengine.tools.util.Parser;
import com.google.appengine.tools.util.Parser.ParseResult;
import com.google.apphosting.utils.config.GenerationDirectory;
import com.google.appengine.repackaged.com.google.common.annotations.VisibleForTesting;
import com.google.appengine.repackaged.com.google.common.collect.ImmutableList;
import com.google.appengine.repackaged.com.google.common.collect.ImmutableMap;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.io.Writer;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.TreeSet;

/**
 * The command-line entry point for DevAppServer.
 *
 */
public class DevAppServerMain extends SharedMain {

  public static final String GENERATE_WAR_ARG = "generate_war";
  public static final String GENERATED_WAR_DIR_ARG = "generated_war_dir";

  private static final String DEFAULT_RDBMS_PROPERTIES_FILE = ".local.rdbms.properties";
  // Keep in sync with RDBMS_PROPERTIES_FILE in
  // com.google.appengine.api.rdbms.dev.LocalRdbmsService
  private static final String RDBMS_PROPERTIES_FILE_SYSTEM_PROPERTY = "rdbms.properties.file";

  // Keep in sync with SYSTEM_PROPERTY_STATIC_MODULE_PORT_NUM_PREFIX in
  // com.google.appengine.tools.development.DevAppServerPortPropertyHelper
  private static final String SYSTEM_PROPERTY_STATIC_MODULE_PORT_NUM_PREFIX =
      "com.google.appengine.devappserver_module.";

  private final Action startAction = new StartAction();

  private String address = DevAppServer.DEFAULT_HTTP_ADDRESS;
  private int port = DevAppServer.DEFAULT_HTTP_PORT;
  private String generatedDirectory = null;
  private String defaultGcsBucketName = null;
  private String applicationId = null;

  /**
   * Returns the list of built-in {@link Option Options} for this instance of
   * {@link DevAppServerMain}.
   *
   * @return The list of built-in options
   */
  @VisibleForTesting
  List




© 2015 - 2024 Weber Informatics LLC | Privacy Policy