diff --git a/Launch Buildship.launch b/Launch Buildship.launch
index 0cc0ea2da..525a768a3 100644
--- a/Launch Buildship.launch
+++ b/Launch Buildship.launch
@@ -18,11 +18,12 @@
+
-
+
-
+
diff --git a/gradle.properties b/gradle.properties
index f0f0c3c63..2a5154459 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,5 +1,5 @@
# production library version numbers
-toolingApiVersion=8.1.1
+toolingApiVersion=8.6-rc-3
# testing library version numbers
guavaVersion=33.0.0
diff --git a/org.eclipse.buildship.compat/META-INF/MANIFEST.MF b/org.eclipse.buildship.compat/META-INF/MANIFEST.MF
index 6e3838d8c..c2669c964 100644
--- a/org.eclipse.buildship.compat/META-INF/MANIFEST.MF
+++ b/org.eclipse.buildship.compat/META-INF/MANIFEST.MF
@@ -6,5 +6,5 @@ Bundle-Version: 3.1.10.qualifier
Bundle-Vendor: Eclipse Buildship
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
-Require-Bundle: org.gradle.toolingapi;bundle-version="[8.1.1,8.2.0)";visibility:=reexport
+Require-Bundle: org.gradle.toolingapi;bundle-version="[8.6.0,8.7.0)";visibility:=reexport
Export-Package: org.eclipse.buildship.core.internal.workspace
diff --git a/org.eclipse.buildship.core/META-INF/MANIFEST.MF b/org.eclipse.buildship.core/META-INF/MANIFEST.MF
index 5005bf19f..9ec540f6d 100644
--- a/org.eclipse.buildship.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.buildship.core/META-INF/MANIFEST.MF
@@ -16,7 +16,7 @@ Require-Bundle: org.eclipse.core.expressions,
org.eclipse.jdt.junit.core,
org.eclipse.jdt.launching,
org.eclipse.debug.core,
- org.gradle.toolingapi;bundle-version="[8.1.1,8.2.0)";visibility:=reexport,
+ org.gradle.toolingapi;bundle-version="[8.6.0,8.7.0)";visibility:=reexport,
com.google.guava;bundle-version="33.0.0",
com.google.gson;bundle-version="[2.7.0,3.0.0)",
org.eclipse.buildship.compat;visibility:=reexport
diff --git a/org.eclipse.buildship.core/plugin.xml b/org.eclipse.buildship.core/plugin.xml
index d054f1e1e..29ec081e4 100644
--- a/org.eclipse.buildship.core/plugin.xml
+++ b/org.eclipse.buildship.core/plugin.xml
@@ -104,12 +104,14 @@
+
+
withSystemProperties(Map systemPro
this.delegate.withSystemProperties(systemProperties);
return this;
}
+
+ @Override
+ public void setStreamedValueListener(StreamedValueListener listener) {
+ this.delegate.setStreamedValueListener(listener);
+ }
}
diff --git a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/DefaultGradleBuild.java b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/DefaultGradleBuild.java
index cc7eda97b..0a774cdc9 100644
--- a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/DefaultGradleBuild.java
+++ b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/DefaultGradleBuild.java
@@ -328,7 +328,7 @@ public GradleConnectionOperation(Function action
@Override
public void runInToolingApi(CancellationTokenSource tokenSource, IProgressMonitor monitor) throws Exception {
// TODO (donat) use AutoCloseable once we update to Tooling API 5.0
- ProjectConnection connection = IdeAttachedProjectConnection.newInstance(tokenSource, getGradleArguments(), monitor);
+ ProjectConnection connection = IdeAttachedProjectConnection.newInstance(tokenSource, getGradleArguments(), DefaultGradleBuild.this, monitor);
if (isSynchronizing()) {
connection = new CachingProjectConnection(connection, DefaultGradleBuild.this.projectConnectionCache);
}
diff --git a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/gradle/GradleProgressAttributes.java b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/gradle/GradleProgressAttributes.java
index e1f4ee31f..4b6ea4450 100644
--- a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/gradle/GradleProgressAttributes.java
+++ b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/gradle/GradleProgressAttributes.java
@@ -32,6 +32,8 @@
import org.eclipse.buildship.core.internal.console.ProcessStreamsProvider;
import org.eclipse.buildship.core.internal.util.progress.CancellationForwardingListener;
import org.eclipse.buildship.core.internal.util.progress.DelegatingProgressListener;
+import org.eclipse.buildship.core.internal.util.progress.ProblemsReportingProgressListener;
+import org.eclipse.buildship.core.internal.workspace.InternalGradleBuild;
/**
* Holds attributes that are commonly used to handle progress in each Gradle invocation.
@@ -98,8 +100,8 @@ public void close() {
this.streams.close();
}
- public static final GradleProgressAttributesBuilder builder(CancellationTokenSource tokenSource, IProgressMonitor monitor) {
- return new GradleProgressAttributesBuilder(tokenSource, monitor);
+ public static final GradleProgressAttributesBuilder builder(CancellationTokenSource tokenSource, InternalGradleBuild gradleBuild, IProgressMonitor monitor) {
+ return new GradleProgressAttributesBuilder(tokenSource, gradleBuild, monitor);
}
/**
@@ -114,9 +116,11 @@ public static class GradleProgressAttributesBuilder {
private ProcessDescription processDescription = null;
private boolean isInteractive = true;
private ProgressListener delegatingListener = null;
+ private final InternalGradleBuild gradleBuild;
- public GradleProgressAttributesBuilder(CancellationTokenSource tokenSource, IProgressMonitor monitor) {
+ public GradleProgressAttributesBuilder(CancellationTokenSource tokenSource, InternalGradleBuild gradleBuild, IProgressMonitor monitor) {
this.tokenSource = tokenSource;
+ this.gradleBuild = gradleBuild;
this.monitor = monitor;
}
@@ -158,6 +162,7 @@ public GradleProgressAttributes build() {
CancellationForwardingListener cancellationListener = new CancellationForwardingListener(this.monitor, this.tokenSource);
progressListeners.add(cancellationListener);
progressEventListeners.add(cancellationListener);
+ progressEventListeners.add(new ProblemsReportingProgressListener(this.gradleBuild));
return new GradleProgressAttributes(streams, this.tokenSource.token(), progressListeners.build(), progressEventListeners.build(), this.isInteractive);
}
diff --git a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/launch/BaseLaunchRequestJob.java b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/launch/BaseLaunchRequestJob.java
index 0d8b3d5c6..e5146278c 100644
--- a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/launch/BaseLaunchRequestJob.java
+++ b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/launch/BaseLaunchRequestJob.java
@@ -23,6 +23,7 @@
import org.eclipse.buildship.core.internal.console.ProcessDescription;
import org.eclipse.buildship.core.internal.event.Event;
import org.eclipse.buildship.core.internal.gradle.GradleProgressAttributes;
+import org.eclipse.buildship.core.internal.marker.GradleMarkerManager;
import org.eclipse.buildship.core.internal.operation.ToolingApiJob;
import org.eclipse.buildship.core.internal.workspace.InternalGradleBuild;
@@ -52,12 +53,13 @@ protected final void executeLaunch(CancellationTokenSource tokenSource, final IP
ProcessDescription processDescription = createProcessDescription();
BaseRunConfiguration runConfig = getRunConfig();
InternalGradleBuild gradleBuild = CorePlugin.internalGradleWorkspace().getGradleBuild(runConfig.getProjectConfiguration().getBuildConfiguration());
- GradleProgressAttributes attributes = GradleProgressAttributes.builder(tokenSource, monitor)
+ GradleProgressAttributes attributes = GradleProgressAttributes.builder(tokenSource, gradleBuild, monitor)
.forDedicatedProcess(processDescription)
.withFullProgress()
.build();
T launcher = createLaunch(gradleBuild, attributes, processDescription);
+ GradleMarkerManager.clear(gradleBuild);
writeExtraConfigInfo(attributes);
Event event = new DefaultExecuteLaunchRequestEvent(processDescription, launcher);
diff --git a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/marker/GradleErrorMarker.java b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/marker/GradleErrorMarker.java
index 1d05eec2b..309df899b 100644
--- a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/marker/GradleErrorMarker.java
+++ b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/marker/GradleErrorMarker.java
@@ -9,6 +9,9 @@
******************************************************************************/
package org.eclipse.buildship.core.internal.marker;
+import java.util.List;
+import java.util.stream.Collectors;
+
import com.google.common.base.Throwables;
import org.eclipse.core.resources.IMarker;
@@ -19,7 +22,7 @@
import org.eclipse.buildship.core.internal.workspace.InternalGradleBuild;
/**
- * Describes Gradle error marker.
+ * Describes a Gradle problem marker.
*
* @author Donat Csikos
*/
@@ -28,6 +31,10 @@ public class GradleErrorMarker {
public static String ID = CorePlugin.PLUGIN_ID + ".errormarker";
public static String ATTRIBUTE_STACKTRACE = "stacktrace";
public static String ATTRIBUTE_ROOT_DIR = "rootdir";
+ public static String ATTRIBUTE_PROBLEM_CATEGORY = "problem.category";
+ public static String ATTRIBUTE_PROBLEM_SOLUTIONS = "problem.solutions";
+ public static String ATTRIBUTE_DOCUMENTATION_LINK = "problem.documentationlink";
+
private GradleErrorMarker() {
}
@@ -38,7 +45,7 @@ public static boolean belongsToBuild(IMarker marker, InternalGradleBuild build)
}
public static void createError(IResource resource, InternalGradleBuild gradleBuild, String message, Throwable exception, int lineNumber) {
- createMarker(IMarker.SEVERITY_ERROR, resource, gradleBuild, message, exception,lineNumber);
+ createMarker(IMarker.SEVERITY_ERROR, resource, gradleBuild, message, exception, lineNumber);
}
public static void createWarning(IResource resource, InternalGradleBuild gradleBuild, String message, Throwable exception, int lineNumber) {
@@ -46,6 +53,11 @@ public static void createWarning(IResource resource, InternalGradleBuild gradleB
}
private static void createMarker(int severity, IResource resource, InternalGradleBuild gradleBuild, String message, Throwable exception, int lineNumber) {
+ createMarker(severity, resource, gradleBuild, message, exception, lineNumber, null, null, null);
+ }
+
+ public static void createMarker(int severity, IResource resource, InternalGradleBuild gradleBuild, String message, Throwable exception, int lineNumber, String category,
+ List solutions, String documentationLink) {
try {
IMarker marker = resource.createMarker(GradleErrorMarker.ID);
@@ -61,6 +73,16 @@ private static void createMarker(int severity, IResource resource, InternalGradl
String stackTrace = Throwables.getStackTraceAsString(exception);
marker.setAttribute(GradleErrorMarker.ATTRIBUTE_STACKTRACE, stackTrace);
}
+ if (category != null) {
+ marker.setAttribute(ATTRIBUTE_PROBLEM_CATEGORY, category);
+ }
+ if (solutions != null) {
+ String solutionsString = solutions.stream().collect(Collectors.joining(System.getProperty("line.separator")));
+ marker.setAttribute(ATTRIBUTE_PROBLEM_SOLUTIONS, solutionsString);
+ }
+ if (documentationLink != null) {
+ marker.setAttribute(ATTRIBUTE_DOCUMENTATION_LINK, documentationLink);
+ }
} catch (CoreException e) {
CorePlugin.logger().warn("Cannot create Gradle error marker", e);
}
diff --git a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/util/gradle/CompatProjectConnection.java b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/util/gradle/CompatProjectConnection.java
index ee6436f06..0cf3c4075 100644
--- a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/util/gradle/CompatProjectConnection.java
+++ b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/util/gradle/CompatProjectConnection.java
@@ -29,6 +29,7 @@
import org.gradle.tooling.ProgressListener;
import org.gradle.tooling.ProjectConnection;
import org.gradle.tooling.ResultHandler;
+import org.gradle.tooling.StreamedValueListener;
import org.gradle.tooling.TestLauncher;
import org.gradle.tooling.events.OperationType;
import org.gradle.tooling.model.eclipse.EclipseProject;
@@ -433,6 +434,11 @@ public BuildActionExecuter withSystemProperties(Map systemPro
this.delegate.withSystemProperties(systemProperties);
return this;
}
+
+ @Override
+ public void setStreamedValueListener(StreamedValueListener listener) {
+ this.delegate.setStreamedValueListener(listener);
+ }
}
private static class CompatIntermediateResultHander implements IntermediateResultHandler {
diff --git a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/util/gradle/CompatTask.java b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/util/gradle/CompatTask.java
index 74ea47b5c..639445bc3 100644
--- a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/util/gradle/CompatTask.java
+++ b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/util/gradle/CompatTask.java
@@ -90,4 +90,14 @@ public boolean isPublic() {
}
}
+ @Override
+ public String getBuildTreePath() {
+ // returns true for Gradle versions < 2.1
+ try {
+ return this.delegate.getBuildTreePath();
+ } catch (Exception ignore) {
+ return getPath();
+ }
+ }
+
}
diff --git a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/util/gradle/IdeAttachedProjectConnection.java b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/util/gradle/IdeAttachedProjectConnection.java
index 1ede3e01e..19a91f584 100644
--- a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/util/gradle/IdeAttachedProjectConnection.java
+++ b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/util/gradle/IdeAttachedProjectConnection.java
@@ -29,8 +29,10 @@
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.buildship.core.internal.DefaultGradleBuild;
import org.eclipse.buildship.core.internal.configuration.GradleArguments;
import org.eclipse.buildship.core.internal.gradle.GradleProgressAttributes;
+import org.eclipse.buildship.core.internal.workspace.InternalGradleBuild;
public final class IdeAttachedProjectConnection implements ProjectConnection {
@@ -96,12 +98,12 @@ public void notifyDaemonsAboutChangedPaths(List changedPaths) {
this.delegate.notifyDaemonsAboutChangedPaths(changedPaths);
}
- public static ProjectConnection newInstance(CancellationTokenSource tokenSource, GradleArguments gradleArguments, IProgressMonitor monitor) {
+ public static ProjectConnection newInstance(CancellationTokenSource tokenSource, GradleArguments gradleArguments, InternalGradleBuild gradleBuild, IProgressMonitor monitor) {
GradleConnector connector = GradleConnector.newConnector();
gradleArguments.applyTo(connector);
ProjectConnection connection = new CompatProjectConnection(connector.connect());
- GradleProgressAttributes progressAttributes = GradleProgressAttributes.builder(tokenSource, monitor)
+ GradleProgressAttributes progressAttributes = GradleProgressAttributes.builder(tokenSource, gradleBuild, monitor)
.forBackgroundProcess()
.withFullProgress()
.build();
diff --git a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/util/progress/ProblemsReportingProgressListener.java b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/util/progress/ProblemsReportingProgressListener.java
new file mode 100644
index 000000000..5e7a5e675
--- /dev/null
+++ b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/util/progress/ProblemsReportingProgressListener.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2023 Gradle Inc. and others
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ ******************************************************************************/
+package org.eclipse.buildship.core.internal.util.progress;
+
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import org.gradle.tooling.events.ProgressEvent;
+import org.gradle.tooling.events.ProgressListener;
+import org.gradle.tooling.events.problems.BaseProblemDescriptor;
+import org.gradle.tooling.events.problems.FileLocation;
+import org.gradle.tooling.events.problems.LineInFileLocation;
+import org.gradle.tooling.events.problems.ProblemAggregation;
+import org.gradle.tooling.events.problems.ProblemAggregationDescriptor;
+import org.gradle.tooling.events.problems.ProblemDescriptor;
+import org.gradle.tooling.events.problems.ProblemEvent;
+import org.gradle.tooling.events.problems.Solution;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+
+import org.eclipse.buildship.core.internal.CorePlugin;
+import org.eclipse.buildship.core.internal.marker.GradleErrorMarker;
+import org.eclipse.buildship.core.internal.util.gradle.Pair;
+import org.eclipse.buildship.core.internal.workspace.InternalGradleBuild;
+
+public class ProblemsReportingProgressListener implements ProgressListener {
+
+ private InternalGradleBuild gradleBuild;
+
+ public ProblemsReportingProgressListener(InternalGradleBuild gradleBuild) {
+ this.gradleBuild = gradleBuild;
+ }
+
+ @Override
+ public void statusChanged(ProgressEvent event) {
+ if (event instanceof ProblemEvent) {
+ ProblemEvent problemEvent = (ProblemEvent) event;
+ BaseProblemDescriptor eventDescriptor = problemEvent.getDescriptor();
+ try {
+ if (eventDescriptor instanceof ProblemDescriptor) {
+ reportProblem((ProblemDescriptor) eventDescriptor);
+ } else if (eventDescriptor instanceof ProblemAggregationDescriptor) {
+ for (ProblemAggregation aggregation : ((ProblemAggregationDescriptor) eventDescriptor).getAggregations()) {
+ for (ProblemDescriptor descriptor : aggregation.getProblemDescriptors()) {
+ reportProblem(descriptor);
+ }
+ }
+ }
+ } catch (Exception e) {
+ CorePlugin.logger().warn("Cannot report problem " + problemEvent, e);
+ }
+ }
+ }
+
+ private void reportProblem(ProblemDescriptor descriptor) {
+ Optional> location = resourceAndFileNumberOfFirstFileLocation(descriptor);
+ if (location.isPresent()) {
+ GradleErrorMarker.createMarker(
+ toMarkerSeverity(descriptor.getSeverity()),
+ location.get().getFirst(), this.gradleBuild,
+ descriptor.getLabel().getLabel(),
+ null, // TODO (donat) Gradle 8.7 descriptor.getException().getException(),
+ location.get().getSecond(),
+ toPath(descriptor.getCategory()),
+ descriptor.getSolutions().stream().map(Solution::getSolution).collect(Collectors.toList()),
+ descriptor.getDocumentationLink().getUrl()
+ );
+ } else {
+ GradleErrorMarker.createMarker(
+ toMarkerSeverity(descriptor.getSeverity()),
+ ResourcesPlugin.getWorkspace().getRoot(),
+ this.gradleBuild,
+ descriptor.getLabel().getLabel(),
+ null, // TODO (donat) Gradle 8.7 descriptor.getException().getException(),
+ -1,
+ toPath(descriptor.getCategory()),
+ descriptor.getSolutions().stream().map(Solution::getSolution).collect(Collectors.toList()),
+ descriptor.getDocumentationLink().getUrl()
+ );
+ }
+ }
+
+ private static String toPath(org.gradle.tooling.events.problems.ProblemCategory problemCategory) {
+ StringBuilder sb = new StringBuilder();
+ sb.append(problemCategory.getNamespace());
+ sb.append(':');
+ sb.append(problemCategory.getCategory());
+ for (String sc : problemCategory.getSubcategories()) {
+ sb.append(':');
+ sb.append(sc);
+ }
+ return sb.toString();
+ }
+
+ public Optional firstFileLocation(ProblemDescriptor descriptor) {
+ return descriptor.getLocations().stream().filter(FileLocation.class::isInstance).map(FileLocation.class::cast).findFirst();
+ }
+
+ public Optional> resourceAndFileNumberOfFirstFileLocation(ProblemDescriptor descriptor) {
+ return firstFileLocation(descriptor).map(location -> new Pair<>(toResource(location), lineNumberOf(location)));
+ }
+
+ private static IResource toResource(FileLocation location) {
+ IPath absolutePath = Path.fromOSString(location.getPath());
+ IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
+ IFile workspacePath = workspaceRoot.getFileForLocation(absolutePath);
+ if (workspacePath.exists()) {
+ return workspacePath;
+ }
+ return ResourcesPlugin.getWorkspace().getRoot();
+ }
+
+ private static Integer lineNumberOf(FileLocation location) {
+ if (location instanceof LineInFileLocation) {
+ if (((LineInFileLocation) location).getLine() > 0) {
+ return ((LineInFileLocation) location).getLine();
+ }
+ }
+ return -1;
+ }
+
+ public int toMarkerSeverity(org.gradle.tooling.events.problems.Severity severity) {
+ if (severity == org.gradle.tooling.events.problems.Severity.ERROR) {
+ return IMarker.SEVERITY_ERROR;
+ } else if (severity == org.gradle.tooling.events.problems.Severity.ADVICE) {
+ return IMarker.SEVERITY_INFO;
+ } else {
+ return IMarker.SEVERITY_WARNING;
+ }
+ }
+}
diff --git a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/workspace/InitializeNewProjectOperation.java b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/workspace/InitializeNewProjectOperation.java
index 59ba145cc..e6ee9cbef 100644
--- a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/workspace/InitializeNewProjectOperation.java
+++ b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/workspace/InitializeNewProjectOperation.java
@@ -58,7 +58,7 @@ private static void initProjectIfNotExists(BuildConfiguration buildConfig, Cance
if (projectDir.mkdir()) {
InternalGradleBuild gradleBuild = CorePlugin.internalGradleWorkspace().getGradleBuild(buildConfig);
RunConfiguration runConfiguration = CorePlugin.configurationManager().createDefaultRunConfiguration(buildConfig);
- GradleProgressAttributes progressAttributes = GradleProgressAttributes.builder(tokenSource, monitor)
+ GradleProgressAttributes progressAttributes = GradleProgressAttributes.builder(tokenSource, gradleBuild, monitor)
.forNonInteractiveBackgroundProcess()
.withFilteredProgress()
.build();
diff --git a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/workspace/RunOnImportTasksOperation.java b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/workspace/RunOnImportTasksOperation.java
index 1be713d5c..f5563524a 100644
--- a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/workspace/RunOnImportTasksOperation.java
+++ b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/workspace/RunOnImportTasksOperation.java
@@ -106,11 +106,12 @@ private boolean isIncludedProject(EclipseProject eclipseProject) {
private void runTasks(final List tasksToRun, IProgressMonitor monitor, CancellationTokenSource tokenSource) {
RunConfiguration runConfiguration = CorePlugin.configurationManager().createDefaultRunConfiguration(this.buildConfig);
- GradleProgressAttributes progressAttributes = GradleProgressAttributes.builder(tokenSource, monitor)
+ InternalGradleBuild gradleBuild = CorePlugin.internalGradleWorkspace().getGradleBuild(this.buildConfig);
+ GradleProgressAttributes progressAttributes = GradleProgressAttributes.builder(tokenSource, gradleBuild, monitor)
.forBackgroundProcess()
.withFilteredProgress()
.build();
- BuildLauncher launcher = CorePlugin.internalGradleWorkspace().getGradleBuild(this.buildConfig).newBuildLauncher(runConfiguration, progressAttributes);
+ BuildLauncher launcher = gradleBuild.newBuildLauncher(runConfiguration, progressAttributes);
launcher.forTasks(tasksToRun.toArray(new String[tasksToRun.size()])).run();
}
}
diff --git a/org.eclipse.buildship.ui.test/META-INF/MANIFEST.MF b/org.eclipse.buildship.ui.test/META-INF/MANIFEST.MF
index a43d22472..db0b2ed9c 100644
--- a/org.eclipse.buildship.ui.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.buildship.ui.test/META-INF/MANIFEST.MF
@@ -22,7 +22,8 @@ Require-Bundle: org.eclipse.swtbot.eclipse.finder,
junit-platform-suite-engine,
org.apache.log4j,
org.eclipse.jdt.launching,
- org.hamcrest.core;bundle-version="1.3.0"
+ org.hamcrest.core;bundle-version="1.3.0",
+ org.eclipse.e4.ui.model.workbench;resolution:=optional
Bundle-ClassPath: .,
lib/ant-1.10.12.jar,
lib/ant-antlr-1.10.12.jar,
diff --git a/org.eclipse.buildship.ui/META-INF/MANIFEST.MF b/org.eclipse.buildship.ui/META-INF/MANIFEST.MF
index ba58568d8..8bb2997aa 100644
--- a/org.eclipse.buildship.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.buildship.ui/META-INF/MANIFEST.MF
@@ -22,7 +22,7 @@ Require-Bundle: org.eclipse.buildship.core,
org.eclipse.jface.text,
com.ibm.icu,
com.google.guava;bundle-version="33.0.0",
- org.gradle.toolingapi;bundle-version="[8.1.1,8.2.0)",
+ org.gradle.toolingapi;bundle-version="[8.6.0,8.7.0)",
org.eclipse.ui.workbench.texteditor
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
diff --git a/org.eclipse.buildship.ui/src/main/java/org/eclipse/buildship/ui/internal/marker/MarkersPropertyPage.java b/org.eclipse.buildship.ui/src/main/java/org/eclipse/buildship/ui/internal/marker/MarkersPropertyPage.java
index ff1e7bc35..07be0ffd5 100644
--- a/org.eclipse.buildship.ui/src/main/java/org/eclipse/buildship/ui/internal/marker/MarkersPropertyPage.java
+++ b/org.eclipse.buildship.ui/src/main/java/org/eclipse/buildship/ui/internal/marker/MarkersPropertyPage.java
@@ -9,21 +9,37 @@
******************************************************************************/
package org.eclipse.buildship.ui.internal.marker;
+import java.net.MalformedURLException;
+import java.net.URL;
+
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.PropertyPage;
+import org.eclipse.ui.wizards.IWizardDescriptor;
+import org.eclipse.buildship.core.internal.CorePlugin;
+import org.eclipse.buildship.core.internal.GradlePluginsRuntimeException;
import org.eclipse.buildship.core.internal.marker.GradleErrorMarker;
+import org.eclipse.buildship.ui.internal.UiPluginConstants;
+import org.eclipse.buildship.ui.internal.view.task.TaskViewMessages;
/**
* Property page displaying details of Gradle problem markers.
@@ -32,7 +48,6 @@
*/
public class MarkersPropertyPage extends PropertyPage {
-
public MarkersPropertyPage() {
super();
noDefaultAndApplyButton();
@@ -73,6 +88,50 @@ private void doCreateContents(Composite parent) {
GridDataFactory.fillDefaults().hint(100, 100).grab(true, true).applyTo(stacktraceAreaText);
stacktraceAreaText.setText(stacktrace);
+
+ String category = marker.getAttribute(GradleErrorMarker.ATTRIBUTE_PROBLEM_CATEGORY, "(no category provided)");
+
+ Label categoryLabel = new Label(parent, SWT.NONE);
+ categoryLabel.setText("Category:");
+ GridDataFactory.swtDefaults().align(SWT.LEFT, SWT.TOP).applyTo(categoryLabel);
+
+ Text categoryAreaText = new Text(parent, SWT.MULTI | SWT.READ_ONLY | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+ GridDataFactory.fillDefaults().hint(100, 1).grab(true, false).applyTo(categoryAreaText);
+
+ categoryAreaText.setText(category);
+
+ String solutions = marker.getAttribute(GradleErrorMarker.ATTRIBUTE_PROBLEM_SOLUTIONS, "(no solutions provided)");
+ if (solutions.equals("")) {
+ solutions = "(no solutions provided)";
+ }
+ Label solutionsLabel = new Label(parent, SWT.NONE);
+ solutionsLabel.setText("Solutions:");
+ GridDataFactory.swtDefaults().align(SWT.LEFT, SWT.TOP).applyTo(solutionsLabel);
+
+ Text solutionsAreaText = new Text(parent, SWT.MULTI | SWT.READ_ONLY | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+ GridDataFactory.fillDefaults().hint(100, 1).grab(true, false).applyTo(solutionsAreaText);
+
+ solutionsAreaText.setText(solutions);
+
+ String documentationLink = marker.getAttribute(GradleErrorMarker.ATTRIBUTE_DOCUMENTATION_LINK, "(no documentation link provided)");
+ Label documentationLabel = new Label(parent, SWT.NONE);
+ documentationLabel.setText("Documentation:");
+ GridDataFactory.swtDefaults().align(SWT.LEFT, SWT.TOP).applyTo(documentationLabel);
+
+ Link documentationAreaText = new Link(parent, SWT.BORDER | SWT.READ_ONLY);
+ GridDataFactory.fillDefaults().hint(100, 1).grab(true, false).applyTo(documentationAreaText);
+
+ documentationAreaText.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ try {
+ PlatformUI.getWorkbench().getBrowserSupport().createBrowser(null).openURL(new URL(documentationLink));
+ } catch (Exception e) {
+ CorePlugin.logger().warn("Cannot open URL + " + documentationLink, e);
+ }
+ }
+ });
+ documentationAreaText.setText("" + documentationLink + "");
}
public static int countLines(String str) {
diff --git a/org.gradle.toolingapi/.classpath b/org.gradle.toolingapi/.classpath
index c50ab5d99..ed70d9150 100644
--- a/org.gradle.toolingapi/.classpath
+++ b/org.gradle.toolingapi/.classpath
@@ -2,5 +2,5 @@
-
+
diff --git a/org.gradle.toolingapi/META-INF/MANIFEST.MF b/org.gradle.toolingapi/META-INF/MANIFEST.MF
index b648a3f83..ee3bb84da 100644
--- a/org.gradle.toolingapi/META-INF/MANIFEST.MF
+++ b/org.gradle.toolingapi/META-INF/MANIFEST.MF
@@ -3,30 +3,33 @@ Bundle-ManifestVersion: 2
Bundle-Name: Gradle Tooling API
Bundle-Vendor: Gradle Inc.
Bundle-SymbolicName: org.gradle.toolingapi
-Bundle-ClassPath: org.gradle.toolingapi_8.1.1.jar
+Bundle-ClassPath: org.gradle.toolingapi_8.6.0.jar
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.slf4j;version="1.7.2"
-Export-Package: org.gradle.api;version="8.1.1",
- org.gradle.cache;version="8.1.1",
- org.gradle.cli;version="8.1.1",
- org.gradle.scripts;version="8.1.1",
- org.gradle.tooling;version="8.1.1",
- org.gradle.tooling.events;version="8.1.1",
- org.gradle.tooling.events.configuration;version="8.1.1",
- org.gradle.tooling.events.download;version="8.1.1",
- org.gradle.tooling.events.lifecycle;version="8.1.1",
- org.gradle.tooling.events.task;version="8.1.1",
- org.gradle.tooling.events.task.java;version="8.1.1",
- org.gradle.tooling.events.test;version="8.1.1",
- org.gradle.tooling.events.transform;version="8.1.1",
- org.gradle.tooling.events.work;version="8.1.1",
- org.gradle.tooling.exceptions;version="8.1.1",
- org.gradle.tooling.model;version="8.1.1",
- org.gradle.tooling.model.build;version="8.1.1",
- org.gradle.tooling.model.cpp;version="8.1.1",
- org.gradle.tooling.model.eclipse;version="8.1.1",
- org.gradle.tooling.model.gradle;version="8.1.1",
- org.gradle.tooling.model.idea;version="8.1.1",
- org.gradle.tooling.model.java;version="8.1.1",
- org.gradle.tooling.model.kotlin.dsl;version="8.1.1"
-Bundle-Version: 3.1.10.qualifier
+Export-Package: org.gradle.api;version="8.6.0",
+ org.gradle.cache;version="8.6.0",
+ org.gradle.cli;version="8.6.0",
+ org.gradle.problems;version="8.6.0",
+ org.gradle.problems.buildtree;version="8.6.0",
+ org.gradle.scripts;version="8.6.0",
+ org.gradle.tooling;version="8.6.0",
+ org.gradle.tooling.events;version="8.6.0",
+ org.gradle.tooling.events.configuration;version="8.6.0",
+ org.gradle.tooling.events.download;version="8.6.0",
+ org.gradle.tooling.events.lifecycle;version="8.6.0",
+ org.gradle.tooling.events.problems;version="8.6.0",
+ org.gradle.tooling.events.task;version="8.6.0",
+ org.gradle.tooling.events.task.java;version="8.6.0",
+ org.gradle.tooling.events.test;version="8.6.0",
+ org.gradle.tooling.events.transform;version="8.6.0",
+ org.gradle.tooling.events.work;version="8.6.0",
+ org.gradle.tooling.exceptions;version="8.6.0",
+ org.gradle.tooling.model;version="8.6.0",
+ org.gradle.tooling.model.build;version="8.6.0",
+ org.gradle.tooling.model.cpp;version="8.6.0",
+ org.gradle.tooling.model.eclipse;version="8.6.0",
+ org.gradle.tooling.model.gradle;version="8.6.0",
+ org.gradle.tooling.model.idea;version="8.6.0",
+ org.gradle.tooling.model.java;version="8.6.0",
+ org.gradle.tooling.model.kotlin.dsl;version="8.6.0"
+Bundle-Version: 8.6.0.qualifier
diff --git a/org.gradle.toolingapi/org.gradle.toolingapi.source_8.1.1.jar b/org.gradle.toolingapi/org.gradle.toolingapi.source_8.6.0.jar
similarity index 71%
rename from org.gradle.toolingapi/org.gradle.toolingapi.source_8.1.1.jar
rename to org.gradle.toolingapi/org.gradle.toolingapi.source_8.6.0.jar
index 435bc7a07..d418032b4 100644
Binary files a/org.gradle.toolingapi/org.gradle.toolingapi.source_8.1.1.jar and b/org.gradle.toolingapi/org.gradle.toolingapi.source_8.6.0.jar differ
diff --git a/org.gradle.toolingapi/org.gradle.toolingapi_8.1.1.jar b/org.gradle.toolingapi/org.gradle.toolingapi_8.1.1.jar
deleted file mode 100644
index 8ca9fc5a8..000000000
Binary files a/org.gradle.toolingapi/org.gradle.toolingapi_8.1.1.jar and /dev/null differ
diff --git a/org.gradle.toolingapi/org.gradle.toolingapi_8.6.0.jar b/org.gradle.toolingapi/org.gradle.toolingapi_8.6.0.jar
new file mode 100644
index 000000000..3fe1c5461
Binary files /dev/null and b/org.gradle.toolingapi/org.gradle.toolingapi_8.6.0.jar differ