-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integration testing finish quarkus:run and integration tests quarkus:run gradle cli run command implement deploy afk rebase' azf deploy azf deploy working azf more fixes
- Loading branch information
1 parent
aee982d
commit 6a9c680
Showing
40 changed files
with
2,290 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
core/deployment/src/main/java/io/quarkus/deployment/cmd/DeployCommandActionBuildItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.quarkus.deployment.cmd; | ||
|
||
import io.quarkus.builder.item.MultiBuildItem; | ||
|
||
public final class DeployCommandActionBuildItem extends MultiBuildItem { | ||
private final String commandName; | ||
private final boolean successful; | ||
|
||
public DeployCommandActionBuildItem(String commandName, boolean successful) { | ||
this.commandName = commandName; | ||
this.successful = successful; | ||
} | ||
|
||
public String getCommandName() { | ||
return commandName; | ||
} | ||
|
||
public boolean isSuccessful() { | ||
return successful; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...eployment/src/main/java/io/quarkus/deployment/cmd/DeployCommandActionResultBuildItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.quarkus.deployment.cmd; | ||
|
||
import java.util.List; | ||
|
||
import io.quarkus.builder.item.SimpleBuildItem; | ||
|
||
public final class DeployCommandActionResultBuildItem extends SimpleBuildItem { | ||
private final List<DeployCommandActionBuildItem> commands; | ||
|
||
public DeployCommandActionResultBuildItem(List<DeployCommandActionBuildItem> commands) { | ||
this.commands = commands; | ||
} | ||
|
||
public List<DeployCommandActionBuildItem> getCommands() { | ||
return commands; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...deployment/src/main/java/io/quarkus/deployment/cmd/DeployCommandDeclarationBuildItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.quarkus.deployment.cmd; | ||
|
||
import io.quarkus.builder.item.MultiBuildItem; | ||
|
||
/** | ||
* Way for maven and gradle plugins to discover if any declared extensions | ||
* support quarkus deploy | ||
*/ | ||
public final class DeployCommandDeclarationBuildItem extends MultiBuildItem { | ||
private final String name; | ||
|
||
public DeployCommandDeclarationBuildItem(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
core/deployment/src/main/java/io/quarkus/deployment/cmd/DeployCommandDeclarationHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.quarkus.deployment.cmd; | ||
|
||
import java.util.List; | ||
import java.util.function.BiConsumer; | ||
import java.util.function.Consumer; | ||
|
||
import io.quarkus.builder.BuildResult; | ||
|
||
public class DeployCommandDeclarationHandler implements BiConsumer<Object, BuildResult> { | ||
|
||
@Override | ||
public void accept(Object o, BuildResult buildResult) { | ||
DeployCommandDeclarationResultBuildItem result = buildResult.consume(DeployCommandDeclarationResultBuildItem.class); | ||
|
||
// FYI: AugmentAction.performCustomBuild runs in its own classloader | ||
// so we can only pass back instances of those classes in the system classloader | ||
|
||
Consumer<List<String>> consumer = (Consumer<List<String>>) o; | ||
consumer.accept(result.getCommands()); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...ment/src/main/java/io/quarkus/deployment/cmd/DeployCommandDeclarationResultBuildItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.quarkus.deployment.cmd; | ||
|
||
import java.util.List; | ||
|
||
import io.quarkus.builder.item.SimpleBuildItem; | ||
|
||
public final class DeployCommandDeclarationResultBuildItem extends SimpleBuildItem { | ||
private final List<String> commands; | ||
|
||
public DeployCommandDeclarationResultBuildItem(List<String> commands) { | ||
this.commands = commands; | ||
} | ||
|
||
public List<String> getCommands() { | ||
return commands; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
core/deployment/src/main/java/io/quarkus/deployment/cmd/DeployCommandHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.quarkus.deployment.cmd; | ||
|
||
import java.util.function.BiConsumer; | ||
import java.util.function.Consumer; | ||
|
||
import io.quarkus.builder.BuildResult; | ||
|
||
public class DeployCommandHandler implements BiConsumer<Object, BuildResult> { | ||
|
||
@Override | ||
public void accept(Object o, BuildResult buildResult) { | ||
DeployCommandActionResultBuildItem result = buildResult.consume(DeployCommandActionResultBuildItem.class); | ||
|
||
// FYI: AugmentAction.performCustomBuild runs in its own classloader | ||
// so we can only pass back instances of those classes in the system classloader | ||
|
||
Consumer<Boolean> consumer = (Consumer<Boolean>) o; | ||
if (result.getCommands().isEmpty()) { | ||
consumer.accept(false); | ||
} else { | ||
consumer.accept(true); | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
core/deployment/src/main/java/io/quarkus/deployment/cmd/DeployCommandProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.quarkus.deployment.cmd; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
import io.quarkus.deployment.annotations.BuildStep; | ||
|
||
public class DeployCommandProcessor { | ||
@BuildStep | ||
public DeployCommandDeclarationResultBuildItem commandDeclaration(List<DeployCommandDeclarationBuildItem> cmds) { | ||
if (cmds == null || cmds.isEmpty()) { | ||
return new DeployCommandDeclarationResultBuildItem(Collections.emptyList()); | ||
} | ||
return new DeployCommandDeclarationResultBuildItem( | ||
cmds.stream().map(item -> item.getName()).collect(Collectors.toList())); | ||
} | ||
|
||
@BuildStep | ||
public DeployCommandActionResultBuildItem commandExecution(List<DeployCommandActionBuildItem> cmds) { | ||
if (cmds == null || cmds.isEmpty()) { | ||
return new DeployCommandActionResultBuildItem(Collections.emptyList()); | ||
} | ||
return new DeployCommandActionResultBuildItem(cmds); | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
core/deployment/src/main/java/io/quarkus/deployment/cmd/DeployConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.quarkus.deployment.cmd; | ||
|
||
import java.util.Optional; | ||
|
||
import io.quarkus.runtime.annotations.ConfigItem; | ||
import io.quarkus.runtime.annotations.ConfigPhase; | ||
import io.quarkus.runtime.annotations.ConfigRoot; | ||
|
||
@ConfigRoot(phase = ConfigPhase.BUILD_TIME) | ||
public class DeployConfig { | ||
/** | ||
* Deployment target | ||
*/ | ||
@ConfigItem | ||
public Optional<String> target; | ||
|
||
public boolean isEnabled(String t) { | ||
return target.isEmpty() || target.get().equals(t); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
core/deployment/src/main/java/io/quarkus/deployment/cmd/RunCommandActionBuildItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package io.quarkus.deployment.cmd; | ||
|
||
import java.nio.file.Path; | ||
import java.util.List; | ||
|
||
import io.quarkus.builder.item.MultiBuildItem; | ||
|
||
public final class RunCommandActionBuildItem extends MultiBuildItem { | ||
private final String commandName; | ||
private final List<String> args; | ||
private Path workingDirectory; | ||
private String startedExpression; | ||
private Path logFile; | ||
private boolean needsLogfile; | ||
|
||
public RunCommandActionBuildItem(String commandName, List<String> args, Path workingDirectory, String startedExpression, | ||
Path logFile, | ||
boolean needsLogfile) { | ||
this.args = args; | ||
this.commandName = commandName; | ||
this.workingDirectory = workingDirectory; | ||
this.startedExpression = startedExpression; | ||
this.logFile = logFile; | ||
this.needsLogfile = needsLogfile; | ||
} | ||
|
||
public String getCommandName() { | ||
return commandName; | ||
} | ||
|
||
public String getStartedExpression() { | ||
return startedExpression; | ||
} | ||
|
||
public Path getWorkingDirectory() { | ||
return workingDirectory; | ||
} | ||
|
||
public List<String> getArgs() { | ||
return args; | ||
} | ||
|
||
public Path getLogFile() { | ||
return logFile; | ||
} | ||
|
||
public boolean isNeedsLogfile() { | ||
return needsLogfile; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
core/deployment/src/main/java/io/quarkus/deployment/cmd/RunCommandActionResultBuildItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.quarkus.deployment.cmd; | ||
|
||
import java.util.List; | ||
|
||
import io.quarkus.builder.item.SimpleBuildItem; | ||
|
||
public final class RunCommandActionResultBuildItem extends SimpleBuildItem { | ||
private final List<RunCommandActionBuildItem> commands; | ||
|
||
public RunCommandActionResultBuildItem(List<RunCommandActionBuildItem> commands) { | ||
this.commands = commands; | ||
} | ||
|
||
public List<RunCommandActionBuildItem> getCommands() { | ||
return commands; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
core/deployment/src/main/java/io/quarkus/deployment/cmd/RunCommandHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package io.quarkus.deployment.cmd; | ||
|
||
import java.util.HashMap; | ||
import java.util.LinkedList; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.function.BiConsumer; | ||
import java.util.function.Consumer; | ||
|
||
import io.quarkus.builder.BuildResult; | ||
|
||
public class RunCommandHandler implements BiConsumer<Object, BuildResult> { | ||
|
||
@Override | ||
public void accept(Object o, BuildResult buildResult) { | ||
RunCommandActionResultBuildItem result = buildResult.consume(RunCommandActionResultBuildItem.class); | ||
|
||
// FYI: AugmentAction.performCustomBuild runs in its own classloader | ||
// so we can only pass back instances of those classes in the system classloader | ||
|
||
Consumer<Map<String, List>> consumer = (Consumer<Map<String, List>>) o; | ||
Map<String, List> entries = new HashMap<>(); | ||
for (RunCommandActionBuildItem item : result.getCommands()) { | ||
LinkedList itemList = new LinkedList(); | ||
addLaunchCommand(itemList, item); | ||
entries.put(item.getCommandName(), itemList); | ||
} | ||
consumer.accept(entries); | ||
} | ||
|
||
private void addLaunchCommand(List list, RunCommandActionBuildItem item) { | ||
list.add(item.getArgs()); | ||
list.add(item.getWorkingDirectory()); | ||
list.add(item.getStartedExpression()); | ||
list.add(item.isNeedsLogfile()); | ||
list.add(item.getLogFile()); | ||
} | ||
} |
Oops, something went wrong.