Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.

Commit

Permalink
Disable hot code replace when docker app has devtools
Browse files Browse the repository at this point in the history
Signed-off-by: Kris De Volder <kdevolder@pivotal.io>
  • Loading branch information
kdvolder committed Sep 16, 2020
1 parent a393442 commit 943f48a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.e4.ui.css.swt.theme,
org.eclipse.lsp4e,
org.eclipse.lsp4j,
com.google.gson
com.google.gson,
org.eclipse.jdt.debug
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,28 @@
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jdt.launching.JavaRuntime;
import org.springframework.ide.eclipse.boot.core.BootPropertyTester;
import org.springframework.ide.eclipse.boot.dash.model.RunState;
import org.springframework.ide.eclipse.boot.util.RetryUtil;
import org.springsource.ide.eclipse.commons.livexp.util.Log;

import org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;

import org.eclipse.debug.core.Launch;

@SuppressWarnings("restriction")
public class RemoteJavaLaunchUtil {

public static final String DISABLE_HCR_LAUNCH_ATTRIBUTE = "disable.hcr"; //$NON-NLS-1$
//should be same value as org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager.DISABLE_HCR_LAUNCH_ATTRIBUTE
//We don't refer to that constant directly because it will only exist in Eclipse 4.18 (assuming PR is accepted)
//See: https://github.com/eclipse/eclipse.jdt.debug/pull/28
//In the mean time, we can already set this attrbute, it will do no harm (has no effect).


public static void cleanupOldLaunchConfigs(Collection<GenericRemoteAppElement> existinginElements) {
//TODO: implement this and find a good place and time to call it from.
Set<String> validIds = new HashSet<>();
Expand All @@ -54,6 +65,9 @@ public static void cleanupOldLaunchConfigs(Collection<GenericRemoteAppElement> e
public synchronized static void synchronizeWith(GenericRemoteAppElement app) {
if (isDebuggable(app)) {
ILaunch l = ensureDebuggerAttached(app);
if (app.hasDevtoolsDependency()) {
l.setAttribute(DISABLE_HCR_LAUNCH_ATTRIBUTE, "true");
}
if (l!=null) {
terminationListener().add(l, app);
}
Expand Down

0 comments on commit 943f48a

Please sign in to comment.