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

Ref #930: camel-debugger - Allow to find the source file by file name #931

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
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 @@ -644,6 +644,7 @@ private static void addCamelDebuggerProperties(ParametersList parametersList) {
*/
private static void addCamelDebuggerEnvironmentVariable(JavaParameters parameters) {
parameters.getEnv().put("CAMEL_DEBUGGER_SUSPEND", "true");
parameters.getEnv().put("CAMEL_MAIN_DEBUGGING", "true");
}

/**
Expand Down Expand Up @@ -711,7 +712,10 @@ void configureCamelDebugger(JavaParameters parameters) {

@Override
void addRequiredParameters(JavaParameters parameters) {
super.addRequiredMavenGoals(parameters);
// Avoid to compile as it can prevent the automatic addition of the Camel Debugger from working properly
// Indeed otherwise, the addition of the Camel Debugger to a custom pom file is simply ignored
parameters.getProgramParametersList().addAt(0, "clean");
parameters.getProgramParametersList().addAt(1, runtime.getPluginGoal());
}

@Override
Expand Down Expand Up @@ -845,7 +849,7 @@ void autoAddCamelDebugger(Project project, JavaParameters parameters, String ver
/**
* The corresponding Camel Runtime.
*/
private final CamelRuntime runtime;
protected final CamelRuntime runtime;

/**
* Constructs a {@code ExecutionMode} with the given Camel Runtime.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,7 @@ private String getBreakpointId(@NotNull PsiElement breakpointTag) {
if (basePath != null && url.startsWith(basePath)) {
sourceLocations.add(String.format("file:%s", url.substring(basePath.length() + 1))); // file:file.xml
}
sourceLocations.add(virtualFile.getName()); // file.xml
} else { //Then it must be a Jar
sourceLocations = List.of(String.format("classpath:%s", url.substring(url.lastIndexOf("!") + 2)));
}
Expand All @@ -897,8 +898,9 @@ private String getBreakpointId(@NotNull PsiElement breakpointTag) {
} else {
relativePath = virtualFile.getName();
}
sourceLocations.add(relativePath); // file.xml
sourceLocations.add(String.format("file:%s", relativePath)); // file:file.xml
sourceLocations.add(relativePath); // file.java
sourceLocations.add(String.format("file:%s", relativePath)); // file:file.java
sourceLocations.add(virtualFile.getName()); // file.java
}
break;
default: // noop
Expand Down
1 change: 1 addition & 0 deletions camel-idea-plugin/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<change-notes><![CDATA[
v.1.1.1
<ul>
<li>Camel-Debugger: Improve the support of Camel Quarkus</li>
<li>Bug fixes</li>
</ul>
]]>
Expand Down
Loading