Skip to content

Commit

Permalink
Add support for java8 in standard staging. (#160)
Browse files Browse the repository at this point in the history
* allow passing runtime = 'java' to bypass the AppCfg restriction to Java 7
  • Loading branch information
loosebazooka authored and meltsufin committed Jul 11, 2016
1 parent b144e56 commit cc9e793
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class DefaultStageStandardConfiguration implements StageStandardConfigura
private Boolean deleteJsps;
private Boolean enableJarClasses;
private Boolean disableJarJsps;
private String runtime;

@Override
public File getSourceDirectory() {
Expand Down Expand Up @@ -133,4 +134,13 @@ public Boolean getDisableJarJsps() {
public void setDisableJarJsps(Boolean disableJarJsps) {
this.disableJarJsps = disableJarJsps;
}

@Override
public String getRuntime() {
return runtime;
}

public void setRuntime(String runtime) {
this.runtime = runtime;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@ public interface StageStandardConfiguration {
Boolean getEnableJarClasses();

Boolean getDisableJarJsps();

String getRuntime();
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ public void stageStandard(StageStandardConfiguration config) throws AppEngineExc
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().toPath().toString());
arguments.add(config.getStagingDirectory().toPath().toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@

import com.google.cloud.tools.appengine.api.AppEngineException;
import com.google.cloud.tools.appengine.api.deploy.DefaultStageStandardConfiguration;
import com.google.cloud.tools.appengine.cloudsdk.CloudSdkAppEngineStandardStaging;
import com.google.cloud.tools.appengine.cloudsdk.internal.process.ProcessRunnerException;
import com.google.cloud.tools.appengine.cloudsdk.CloudSdk;
import com.google.common.collect.ImmutableList;

import org.junit.Before;
Expand Down Expand Up @@ -88,11 +86,13 @@ public void testCheckFlags_allFlags()
configuration.setDeleteJsps(true);
configuration.setEnableJarClasses(true);
configuration.setDisableJarJsps(true);
configuration.setRuntime("java");

List<String> expected = ImmutableList
.of("--enable_quickstart", "--disable_update_check", "--enable_jar_splitting",
"--jar_splitting_excludes=suffix1,suffix2", "--compile_encoding=UTF8", "--delete_jsps",
"--enable_jar_classes", "--disable_jar_jsps", "stage",
"--enable_jar_classes", "--disable_jar_jsps", "--allow_any_runtime", "--runtime=java",
"stage",
source.toPath().toString(),
destination.toPath().toString());

Expand Down

0 comments on commit cc9e793

Please sign in to comment.