Skip to content

Commit

Permalink
feat: support for java17 and java21 runtimes
Browse files Browse the repository at this point in the history
Fixes: #935.
  • Loading branch information
meltsufin committed Sep 26, 2023
1 parent a1c92b1 commit 2965b7a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
Expand All @@ -44,7 +45,8 @@ public class AppYamlProjectStaging {

private static final String APP_YAML = "app.yaml";

private static final ImmutableSet<String> GEN2_RUNTIMES = ImmutableSet.of("java11", "java17");
private static final ImmutableSet<String> GEN2_RUNTIMES =
ImmutableSet.of("java11", "java17", "java21");

@VisibleForTesting
static final ImmutableList<String> OTHER_YAMLS =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import java.util.logging.LogRecord;
import org.junit.Assert;
import org.junit.Before;
import org.junit.ComparisonFailure;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
Expand Down Expand Up @@ -116,6 +115,11 @@ public void testStageArchive_java17StandardPath() throws IOException, AppEngineE
stageArchive_gen2StandardPath("java17");
}

@Test
public void testStageArchive_java21StandardPath() throws IOException, AppEngineException {
stageArchive_gen2StandardPath("java21");
}

private void stageArchive_gen2StandardPath(String runtime)
throws IOException, AppEngineException {
Files.write(
Expand All @@ -141,6 +145,11 @@ public void testStageArchive_java17StandardBinaryPath() throws IOException, AppE
stageArchive_gen2StandardBinaryPath("java17");
}

@Test
public void testStageArchive_java21StandardBinaryPath() throws IOException, AppEngineException {
stageArchive_gen2StandardBinaryPath("java21");
}

private void stageArchive_gen2StandardBinaryPath(String runtime)
throws IOException, AppEngineException {
config =
Expand Down Expand Up @@ -174,6 +183,11 @@ public void testStageArchive_java17BinaryWithoutEntrypoint() throws IOException
stageArchive_gen2BinaryWithoutEntrypoint("java17");
}

@Test
public void testStageArchive_java21BinaryWithoutEntrypoint() throws IOException {
stageArchive_gen2BinaryWithoutEntrypoint("java21");
}

private void stageArchive_gen2BinaryWithoutEntrypoint(String runtime) throws IOException {
Path nonJarArtifact = temporaryFolder.newFile("myscript.sh").toPath();
config =
Expand Down

0 comments on commit 2965b7a

Please sign in to comment.