Docker App in bootdash without actuator -> no automatic live hover

See: https://github.com/spring-projects/sts4/issues/716
This commit is contained in:
Kris De Volder
2022-07-26 15:50:16 -07:00
parent 35f4cc8292
commit 392d953bd9
32 changed files with 308 additions and 188 deletions

View File

@@ -53,8 +53,8 @@ import org.springframework.ide.eclipse.boot.dash.docker.exceptions.MissingBuildS
import org.springframework.ide.eclipse.boot.dash.docker.exceptions.MissingBuildTagException;
import org.springframework.ide.eclipse.boot.dash.docker.jmx.JmxSupport;
import org.springframework.ide.eclipse.boot.dash.docker.runtarget.BuildScriptLocator.BuildKind;
import org.springframework.ide.eclipse.boot.dash.docker.runtarget.DockerApp.BuildCommand;
import org.springframework.ide.eclipse.boot.dash.labels.BootDashLabels;
import org.springframework.ide.eclipse.boot.dash.model.ClasspathPropertyTester;
import org.springframework.ide.eclipse.boot.dash.model.RunState;
import org.springframework.ide.eclipse.boot.dash.model.remote.ChildBearing;
import org.springframework.ide.eclipse.boot.dash.model.remote.RefreshStateTracker;
@@ -62,7 +62,6 @@ import org.springframework.ide.eclipse.boot.dash.util.LineBasedStreamGobler;
import org.springframework.ide.eclipse.boot.launch.util.PortFinder;
import org.springframework.ide.eclipse.boot.util.JavaProjectUtil;
import org.springsource.ide.eclipse.commons.core.pstore.PropertyStoreApi;
import org.springsource.ide.eclipse.commons.core.pstore.PropertyStores;
import org.springsource.ide.eclipse.commons.frameworks.core.util.JobUtil;
import org.springsource.ide.eclipse.commons.frameworks.core.util.StringUtils;
import org.springsource.ide.eclipse.commons.livexp.core.AbstractDisposable;
@@ -528,7 +527,10 @@ Successfully tagged fui:latest
builder.addAll(Arrays.asList(props.get(key, NO_STRINGS)));
builder.add(imageId);
props.put(key, builder.build().toArray(NO_STRINGS));
props.put(DockerImage.hasDevtoolsKey(imageId), context.projectHasDevtoolsDependency() && command.builtWithDevToolsArgs);
props.put(DockerImage.storageKey(imageId, ClasspathPropertyTester.HAS_DEVTOOLS),
context.projectHasClasspathProperty(ClasspathPropertyTester.HAS_DEVTOOLS) && command.builtWithDevToolsArgs);
props.put(DockerImage.storageKey(imageId, ClasspathPropertyTester.HAS_ACTUATORS),
context.projectHasClasspathProperty(ClasspathPropertyTester.HAS_ACTUATORS));
} catch (Exception e) {
Log.log(e);
}
@@ -637,7 +639,7 @@ Successfully tagged fui:latest
}
@Override
public boolean hasDevtoolsDependency() {
return context!=null && context.projectHasDevtoolsDependency();
}
public boolean hasClasspathProperty(ClasspathPropertyTester tester) {
return context!=null && context.projectHasClasspathProperty(tester);
}
}

View File

@@ -50,6 +50,7 @@ import org.springframework.ide.eclipse.boot.dash.console.LogType;
import org.springframework.ide.eclipse.boot.dash.devtools.DevtoolsUtil;
import org.springframework.ide.eclipse.boot.dash.docker.jmx.JmxSupport;
import org.springframework.ide.eclipse.boot.dash.docker.util.Ownable;
import org.springframework.ide.eclipse.boot.dash.model.ClasspathPropertyTester;
import org.springframework.ide.eclipse.boot.dash.model.RunState;
import org.springframework.ide.eclipse.boot.dash.model.remote.RefreshStateTracker;
import org.springframework.ide.eclipse.boot.util.RetryUtil;
@@ -338,13 +339,12 @@ public class DockerContainer implements App, RunStateProvider, JmxConnectable, S
private static final boolean USE_DEDICATED_CLIENT = false;
@Override
public boolean hasDevtoolsDependency() {
public boolean hasClasspathProperty(ClasspathPropertyTester tester) {
if (context!=null) {
DockerImage image = context.getParent(DockerImage.class);
return image.hasDevtoolsDependency();
return image.hasClasspathProperty(tester);
}
return false;
}

View File

@@ -34,6 +34,7 @@ import org.springframework.ide.eclipse.boot.dash.api.ProjectRelatable;
import org.springframework.ide.eclipse.boot.dash.api.RunStateIconProvider;
import org.springframework.ide.eclipse.boot.dash.api.Styleable;
import org.springframework.ide.eclipse.boot.dash.api.TemporalBoolean;
import org.springframework.ide.eclipse.boot.dash.model.ClasspathPropertyTester;
import org.springframework.ide.eclipse.boot.dash.model.RunState;
import org.springframework.ide.eclipse.boot.dash.model.remote.ChildBearing;
import org.springframework.ide.eclipse.boot.dash.model.remote.RefreshStateTracker;
@@ -246,9 +247,10 @@ public class DockerImage implements App, ChildBearing, Styleable, ProjectRelatab
}
@Override
public boolean hasDevtoolsDependency() {
public boolean hasClasspathProperty(ClasspathPropertyTester tester) {
PropertyStoreApi props = getTarget().getPersistentProperties();
return props.get(hasDevtoolsKey(image.getId()), false);
boolean result = props.get(storageKey(image.getId(), tester), false);
return result;
}
@Override
@@ -256,7 +258,7 @@ public class DockerImage implements App, ChildBearing, Styleable, ProjectRelatab
return TemporalBoolean.NEVER;
}
public static String hasDevtoolsKey(String imageId) {
return imageId +".hasDevtoolsDependency";
public static String storageKey(String imageId, ClasspathPropertyTester tester) {
return imageId + "." + tester.getId();
}
}