Skip to content

Commit

Permalink
Merge pull request quarkusio#15764 from geoand/remote-dev-ide
Browse files Browse the repository at this point in the history
Prevent IDE related steps from ever running in remote-dev mode
  • Loading branch information
gsmet authored Mar 16, 2021
2 parents d0b3e50 + 7d94a7e commit 6e39ee8
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
import java.util.stream.Stream;

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.LaunchModeBuildItem;
import io.quarkus.deployment.pkg.builditem.BuildSystemTargetBuildItem;
import io.quarkus.dev.spi.DevModeType;
import io.quarkus.runtime.util.JavaVersionUtil;

public class IdeProcessor {
Expand Down Expand Up @@ -60,8 +62,12 @@ public class IdeProcessor {
}

@BuildStep
public EffectiveIdeBuildItem effectiveIde(IdeConfig ideConfig, IdeFileBuildItem ideFile,
public EffectiveIdeBuildItem effectiveIde(LaunchModeBuildItem launchModeBuildItem, IdeConfig ideConfig,
IdeFileBuildItem ideFile,
IdeRunningProcessBuildItem ideRunningProcess) {
if (launchModeBuildItem.getDevModeType().orElse(null) != DevModeType.LOCAL) {
return null;
}
Ide result = null;
if (ideConfig.target == IdeConfig.Target.auto) {

Expand Down Expand Up @@ -108,7 +114,11 @@ public EffectiveIdeBuildItem effectiveIde(IdeConfig ideConfig, IdeFileBuildItem
}

@BuildStep
public IdeFileBuildItem detectIdeFiles(BuildSystemTargetBuildItem buildSystemTarget) {
public IdeFileBuildItem detectIdeFiles(LaunchModeBuildItem launchModeBuildItem,
BuildSystemTargetBuildItem buildSystemTarget) {
if (launchModeBuildItem.getDevModeType().orElse(null) != DevModeType.LOCAL) {
return null;
}
Set<Ide> result = new HashSet<>(2);
Path projectRoot = buildSystemTarget.getOutputDirectory().getParent();
IDE_MARKER_FILES.forEach((file, ides) -> {
Expand All @@ -120,7 +130,10 @@ public IdeFileBuildItem detectIdeFiles(BuildSystemTargetBuildItem buildSystemTar
}

@BuildStep
public IdeRunningProcessBuildItem detectRunningIdeProcesses() {
public IdeRunningProcessBuildItem detectRunningIdeProcesses(LaunchModeBuildItem launchModeBuildItem) {
if (launchModeBuildItem.getDevModeType().orElse(null) != DevModeType.LOCAL) {
return null;
}
Set<Ide> result = new HashSet<>(4);
List<ProcessInfo> processInfos = ProcessUtil.runningProcesses();
for (ProcessInfo processInfo : processInfos) {
Expand Down

0 comments on commit 6e39ee8

Please sign in to comment.