Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor logic when creating extension via CLI #1300

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public class QuarkusCliClient {
public static final String COMMAND_LOG_FILE = "quarkus-cli-command.out";
public static final String DEV_MODE_LOG_FILE = "quarkus-cli-dev.out";

private static final String QUARKUS_VERSION_PROPERTY_NAME = "quarkus.version";
private static final String QUARKUS_UPSTREAM_VERSION = "999-SNAPSHOT";
private static final String BUILD = "build";
private static final PropertyLookup COMMAND = new PropertyLookup("ts.quarkus.cli.cmd", "quarkus");
Expand All @@ -53,9 +52,6 @@ public Result run(String... args) {
public Result buildApplicationOnJvm(Path serviceFolder, String... extraArgs) {
List<String> args = new ArrayList<>();
args.add(BUILD);
if (isUpstream()) {
args.add("-D" + QUARKUS_VERSION_PROPERTY_NAME + "=" + QuarkusProperties.getVersion());
}
args.addAll(Arrays.asList(extraArgs));
return runCliAndWait(serviceFolder, args.toArray(new String[args.size()]));
}
Expand All @@ -64,9 +60,6 @@ public Result buildApplicationOnNative(Path serviceFolder, String... extraArgs)
List<String> args = new ArrayList<>();
args.add(BUILD);
args.add("--native");
if (isUpstream()) {
args.add("-D" + QUARKUS_VERSION_PROPERTY_NAME + "=" + QuarkusProperties.getVersion());
}
args.addAll(Arrays.asList(extraArgs));
return runCliAndWait(serviceFolder, args.toArray(new String[args.size()]));
}
Expand Down Expand Up @@ -389,7 +382,7 @@ public CreateExtensionRequest withExtraArgs(String... extraArgs) {

public static CreateExtensionRequest defaults() {
if (isUpstream()) {
return new CreateExtensionRequest();
return new CreateExtensionRequest().withCurrentPlatformBom();
}
// set fixed stream because if tested stream is not the latest stream, we would create app with wrong version
return new CreateExtensionRequest().withStream(getFixedStreamVersion());
Expand Down