Skip to content

Commit

Permalink
Merge pull request quarkusio#16761 from ia3andy/add-extra-codestarts-…
Browse files Browse the repository at this point in the history
…to-project
  • Loading branch information
ia3andy authored Apr 23, 2021
2 parents 65b8819 + 77879d1 commit 1f31d88
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ metadata:
status: "preview"
codestart:
name: "amazon-lambda"
kind: "singleton-example"
kind: "example"
languages: "java"
artifact: "io.quarkus:quarkus-project-core-extension-codestarts"
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ metadata:
status: "preview"
codestart:
name: "azure-functions-http"
kind: "singleton-example"
kind: "example"
languages: "java"
artifact: "io.quarkus:quarkus-project-core-extension-codestarts"
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ metadata:
status: "experimental"
codestart:
name: "funqy-amazon-lambda"
kind: "singleton-example"
kind: "example"
languages: "java"
artifact: "io.quarkus:quarkus-project-core-extension-codestarts"
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ metadata:
status: "experimental"
codestart:
name: "funqy-google-cloud-functions-example"
kind: "singleton-example"
kind: "example"
languages: "java"
artifact: "io.quarkus:quarkus-project-core-extension-codestarts"
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ metadata:
status: "experimental"
codestart:
name: "funqy-knative-events"
kind: "singleton-example"
kind: "example"
languages: "java"
artifact: "io.quarkus:quarkus-project-core-extension-codestarts"
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ metadata:
status: "preview"
codestart:
name: "google-cloud-functions-http"
kind: "singleton-example"
kind: "example"
languages: "java"
artifact: "io.quarkus:quarkus-project-core-extension-codestarts"
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ metadata:
status: "preview"
codestart:
name: "google-cloud-functions"
kind: "singleton-example"
kind: "example"
languages: "java"
artifact: "io.quarkus:quarkus-project-core-extension-codestarts"
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class CreateProject {
public static final String NO_BUILDTOOL_WRAPPER = ToolsUtils.dotJoin(ToolsConstants.QUARKUS, NAME, "no-buildtool-wrapper");
public static final String NO_CODE = ToolsUtils.dotJoin(ToolsConstants.QUARKUS, NAME, "no-code");
public static final String EXAMPLE = ToolsUtils.dotJoin(ToolsConstants.QUARKUS, NAME, "example");
public static final String EXTRA_CODESTARTS = ToolsUtils.dotJoin(ToolsConstants.QUARKUS, NAME, "extra-codestarts");

private static final Pattern JAVA_VERSION_PATTERN = Pattern.compile("(?:1\\.)?(\\d+)(?:\\..*)?");

Expand Down Expand Up @@ -89,6 +90,11 @@ public CreateProject sourceType(SourceType sourceType) {
return this;
}

public CreateProject extraCodestarts(Set<String> extraCodestarts) {
setValue(EXTRA_CODESTARTS, extraCodestarts);
return this;
}

public CreateProject javaTarget(String javaTarget) {
this.javaTarget = javaTarget;
return this;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.quarkus.devtools.commands.handlers;

import static io.quarkus.devtools.commands.CreateProject.EXAMPLE;
import static io.quarkus.devtools.commands.CreateProject.EXTRA_CODESTARTS;
import static io.quarkus.devtools.commands.CreateProject.NO_BUILDTOOL_WRAPPER;
import static io.quarkus.devtools.commands.CreateProject.NO_CODE;
import static io.quarkus.devtools.commands.CreateProject.NO_DOCKERFILES;
Expand Down Expand Up @@ -93,6 +94,7 @@ public QuarkusCommandOutcome execute(QuarkusCommandInvocation invocation) throws
.buildTool(invocation.getQuarkusProject().getBuildTool())
.example(invocation.getValue(EXAMPLE))
.noCode(invocation.getValue(NO_CODE, false))
.addCodestarts(invocation.getValue(EXTRA_CODESTARTS, Collections.emptySet()))
.noBuildToolWrapper(invocation.getValue(NO_BUILDTOOL_WRAPPER, false))
.noDockerfiles(invocation.getValue(NO_DOCKERFILES, false))
.addData(platformData)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ public static String getCodestartArtifact(Extension extension) {
}

public static CodestartKind getCodestartKind(Extension extension) {
if (getCodestartName(extension) == null) {
return null;
}
return getMetadataValue(extension, MD_NESTED_CODESTART_KIND).toEnum(CodestartKind.class,
CodestartKind.EXTENSION_CODESTART);
}
Expand Down

0 comments on commit 1f31d88

Please sign in to comment.