1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

Merge pull request #72 from 15knots/main

make the cmake error parser public API
This commit is contained in:
15knots 2022-09-14 23:44:23 +02:00 committed by GitHub
commit 9c8986b3b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 22 additions and 10 deletions

View file

@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.cdt.cmake.core.tests Bundle-SymbolicName: org.eclipse.cdt.cmake.core.tests
Bundle-Version: 1.0.0.qualifier Bundle-Version: 1.0.0.qualifier
Fragment-Host: org.eclipse.cdt.cmake.core;bundle-version="1.3.0" Fragment-Host: org.eclipse.cdt.cmake.core;bundle-version="1.5.0"
Automatic-Module-Name: org.eclipse.cdt.cmake.core.tests Automatic-Module-Name: org.eclipse.cdt.cmake.core.tests
Bundle-Vendor: %Bundle-Vendor Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright Bundle-Copyright: %Bundle-Copyright

View file

@ -9,7 +9,7 @@
* SPDX-License-Identifier: EPL-2.0 * SPDX-License-Identifier: EPL-2.0
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.cmake.core.internal; package org.eclipse.cdt.cmake.core;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %pluginName Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.cmake.core;singleton:=true Bundle-SymbolicName: org.eclipse.cdt.cmake.core;singleton:=true
Bundle-Version: 1.4.400.qualifier Bundle-Version: 1.5.0.qualifier
Bundle-Activator: org.eclipse.cdt.cmake.core.internal.Activator Bundle-Activator: org.eclipse.cdt.cmake.core.internal.Activator
Bundle-Vendor: %providerName Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime, Require-Bundle: org.eclipse.core.runtime,

View file

@ -6,7 +6,7 @@
* *
* SPDX-License-Identifier: EPL-2.0 * SPDX-License-Identifier: EPL-2.0
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.cmake.core.internal; package org.eclipse.cdt.cmake.core;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
@ -17,6 +17,7 @@ import java.util.Objects;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.eclipse.cdt.cmake.core.internal.Activator;
import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
@ -35,8 +36,9 @@ import org.eclipse.core.runtime.Status;
* </p> * </p>
* *
* @author Martin Weber * @author Martin Weber
* @since 1.5.0
*/ */
/* package */ class CMakeErrorParser implements AutoCloseable { public class CMakeErrorParser implements AutoCloseable {
/** matches the Start of a message, also ending the previous message */ /** matches the Start of a message, also ending the previous message */
private static final Pattern PTN_MSG_START; private static final Pattern PTN_MSG_START;

View file

@ -9,12 +9,14 @@
* SPDX-License-Identifier: EPL-2.0 * SPDX-License-Identifier: EPL-2.0
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.cmake.core.internal; package org.eclipse.cdt.cmake.core;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Objects; import java.util.Objects;
import org.eclipse.cdt.cmake.core.internal.Activator;
import org.eclipse.cdt.cmake.core.internal.Messages;
import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
@ -27,6 +29,7 @@ import org.eclipse.core.runtime.Status;
* Default implementation of {@code ICMakeExecutionMarkerFactory}. * Default implementation of {@code ICMakeExecutionMarkerFactory}.
* *
* @author Martin Weber * @author Martin Weber
* @since 1.5.0
*/ */
public class CMakeExecutionMarkerFactory implements ICMakeExecutionMarkerFactory { public class CMakeExecutionMarkerFactory implements ICMakeExecutionMarkerFactory {

View file

@ -9,10 +9,11 @@
* SPDX-License-Identifier: EPL-2.0 * SPDX-License-Identifier: EPL-2.0
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.cmake.core.internal; package org.eclipse.cdt.cmake.core;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.cmake.core.internal.Activator;
import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
@ -21,9 +22,10 @@ import org.eclipse.core.runtime.CoreException;
* build. * build.
* *
* @author Martin Weber * @author Martin Weber
* @since 1.5.0
*/ */
@FunctionalInterface @FunctionalInterface
interface ICMakeExecutionMarkerFactory { public interface ICMakeExecutionMarkerFactory {
/** ID for error markers related to execution of the cmake tool. /** ID for error markers related to execution of the cmake tool.
* @see IResource#createMarker(String) * @see IResource#createMarker(String)

View file

@ -9,7 +9,7 @@
* SPDX-License-Identifier: EPL-2.0 * SPDX-License-Identifier: EPL-2.0
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.cmake.core.internal; package org.eclipse.cdt.cmake.core;
import java.io.IOException; import java.io.IOException;
import java.util.Objects; import java.util.Objects;
@ -20,8 +20,9 @@ import org.eclipse.cdt.core.ConsoleOutputStream;
* Intercepts output to a console output stream and forwards it to a CMakeErrorParser for processing. * Intercepts output to a console output stream and forwards it to a CMakeErrorParser for processing.
* *
* @author Martin Weber * @author Martin Weber
* @since 1.5.0
*/ */
class ParsingConsoleOutputStream extends ConsoleOutputStream { public class ParsingConsoleOutputStream extends ConsoleOutputStream {
private final ConsoleOutputStream os; private final ConsoleOutputStream os;
private final CMakeErrorParser parser; private final CMakeErrorParser parser;

View file

@ -24,8 +24,12 @@ import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.function.Consumer; import java.util.function.Consumer;
import org.eclipse.cdt.cmake.core.CMakeErrorParser;
import org.eclipse.cdt.cmake.core.CMakeExecutionMarkerFactory;
import org.eclipse.cdt.cmake.core.ICMakeExecutionMarkerFactory;
import org.eclipse.cdt.cmake.core.ICMakeToolChainFile; import org.eclipse.cdt.cmake.core.ICMakeToolChainFile;
import org.eclipse.cdt.cmake.core.ICMakeToolChainManager; import org.eclipse.cdt.cmake.core.ICMakeToolChainManager;
import org.eclipse.cdt.cmake.core.ParsingConsoleOutputStream;
import org.eclipse.cdt.cmake.core.internal.CommandDescriptorBuilder.CommandDescriptor; import org.eclipse.cdt.cmake.core.internal.CommandDescriptorBuilder.CommandDescriptor;
import org.eclipse.cdt.cmake.core.properties.CMakeGenerator; import org.eclipse.cdt.cmake.core.properties.CMakeGenerator;
import org.eclipse.cdt.cmake.core.properties.ICMakeProperties; import org.eclipse.cdt.cmake.core.properties.ICMakeProperties;