Compare commits
8 Commits
Author | SHA256 | Date | |
---|---|---|---|
88e7e22ecd | |||
a59b28acb0 | |||
a106228634 | |||
0d7a8be211 | |||
4400ba1ce9 | |||
8baaf4f372 | |||
30e7263047 | |||
090fa85313 |
226
antlr-maven-plugin-mpt4.patch
Normal file
226
antlr-maven-plugin-mpt4.patch
Normal file
@@ -0,0 +1,226 @@
|
||||
--- antlr-maven-plugin-2.2/src/main/java/org/codehaus/mojo/antlr/AbstractAntlrMojo.java 2025-03-27 08:54:38.467620775 +0100
|
||||
+++ antlr-maven-plugin-2.2/src/main/java/org/codehaus/mojo/antlr/AbstractAntlrMojo.java 2025-03-27 15:26:47.173470385 +0100
|
||||
@@ -44,6 +44,8 @@
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
+import org.apache.maven.plugins.annotations.Component;
|
||||
+import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.apache.maven.project.MavenProjectHelper;
|
||||
import org.apache.commons.exec.DefaultExecutor;
|
||||
@@ -74,24 +76,23 @@
|
||||
/**
|
||||
* Specifies the Antlr directory containing grammar files.
|
||||
*
|
||||
- * @parameter default-value="${basedir}/src/main/antlr"
|
||||
*/
|
||||
+ @Parameter( defaultValue = "${basedir}/src/main/antlr" )
|
||||
protected File sourceDirectory;
|
||||
|
||||
/**
|
||||
* The Maven Project Object
|
||||
*
|
||||
- * @parameter expression="${project}"
|
||||
- * @readonly
|
||||
*/
|
||||
+ @Parameter( property = "project",
|
||||
+ readonly = true )
|
||||
protected MavenProject project;
|
||||
|
||||
/**
|
||||
* The maven project's helper.
|
||||
*
|
||||
- * @component role="org.apache.maven.project.MavenProjectHelper"
|
||||
- * @readonly
|
||||
*/
|
||||
+ @Component( role = MavenProjectHelper.class )
|
||||
private MavenProjectHelper projectHelper;
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -103,8 +104,8 @@
|
||||
* Specifies the destination directory where Antlr should generate files. <br/>
|
||||
* See <a href="http://www.antlr2.org/doc/options.html#Command%20Line%20Options">Command Line Options</a>
|
||||
*
|
||||
- * @parameter default-value="${project.build.directory}/generated-sources/antlr"
|
||||
*/
|
||||
+ @Parameter( defaultValue = "${project.build.directory}/generated-sources/antlr" )
|
||||
protected File outputDirectory;
|
||||
|
||||
/**
|
||||
@@ -112,8 +113,8 @@
|
||||
* directory. <br/>
|
||||
* See <a href="http://www.antlr2.org/doc/options.html#Command%20Line%20Options">Command Line Options</a>
|
||||
*
|
||||
- * @parameter expression="${grammars}"
|
||||
*/
|
||||
+ @Parameter( property = "grammars" )
|
||||
protected String grammars;
|
||||
|
||||
/**
|
||||
@@ -130,56 +131,62 @@
|
||||
* </grammarDefs>
|
||||
* </pre>
|
||||
*
|
||||
- * @parameter expression="${grammarDefs}"
|
||||
*/
|
||||
+ @Parameter( property = "grammarDefs" )
|
||||
protected Grammar[] grammarDefs;
|
||||
|
||||
/**
|
||||
* Launch the ParseView debugger upon parser invocation. <br/>
|
||||
* See <a href="http://www.antlr2.org/doc/options.html#Command%20Line%20Options">Command Line Options</a>
|
||||
*
|
||||
- * @parameter expression="${debug}" default-value="false"
|
||||
*/
|
||||
+ @Parameter( property = "debug",
|
||||
+ defaultValue = "false" )
|
||||
private boolean debug;
|
||||
|
||||
/**
|
||||
* Generate a text file from your grammar with a lot of debugging info. <br/>
|
||||
* See <a href="http://www.antlr2.org/doc/options.html#Command%20Line%20Options">Command Line Options</a>
|
||||
*
|
||||
- * @parameter expression="${diagnostic}" default-value="false"
|
||||
*/
|
||||
+ @Parameter( property = "diagnostic",
|
||||
+ defaultValue = "false" )
|
||||
private boolean diagnostic;
|
||||
|
||||
/**
|
||||
* Have all rules call traceIn/traceOut. <br/>
|
||||
* See <a href="http://www.antlr2.org/doc/options.html#Command%20Line%20Options">Command Line Options</a>
|
||||
*
|
||||
- * @parameter expression="${trace}" default-value="false"
|
||||
*/
|
||||
+ @Parameter( property = "trace",
|
||||
+ defaultValue = "false" )
|
||||
private boolean trace;
|
||||
|
||||
/**
|
||||
* Have parser rules call traceIn/traceOut. <br/>
|
||||
* See <a href="http://www.antlr2.org/doc/options.html#Command%20Line%20Options">Command Line Options</a>
|
||||
*
|
||||
- * @parameter expression="${traceParser}" default-value="false"
|
||||
*/
|
||||
+ @Parameter( property = "traceParser",
|
||||
+ defaultValue = "false" )
|
||||
private boolean traceParser;
|
||||
|
||||
/**
|
||||
* Have lexer rules call traceIn/traceOut. <br/>
|
||||
* See <a href="http://www.antlr2.org/doc/options.html#Command%20Line%20Options">Command Line Options</a>
|
||||
*
|
||||
- * @parameter expression="${traceLexer}" default-value="false"
|
||||
*/
|
||||
+ @Parameter( property = "traceLexer",
|
||||
+ defaultValue = "false" )
|
||||
private boolean traceLexer;
|
||||
|
||||
/**
|
||||
* Have tree rules call traceIn/traceOut. <br/>
|
||||
* See <a href="http://www.antlr2.org/doc/options.html#Command%20Line%20Options">Command Line Options</a>
|
||||
*
|
||||
- * @parameter expression="${traceTreeParser}" default-value="false"
|
||||
*/
|
||||
+ @Parameter( property = "traceTreeParser",
|
||||
+ defaultValue = "false" )
|
||||
private boolean traceTreeParser;
|
||||
|
||||
public File getSourceDirectory()
|
||||
--- antlr-maven-plugin-2.2/src/main/java/org/codehaus/mojo/antlr/AntlrHtmlReport.java 2025-03-27 08:54:38.467721722 +0100
|
||||
+++ antlr-maven-plugin-2.2/src/main/java/org/codehaus/mojo/antlr/AntlrHtmlReport.java 2025-03-27 15:28:14.917992058 +0100
|
||||
@@ -30,6 +30,9 @@
|
||||
import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugin.MojoFailureException;
|
||||
+import org.apache.maven.plugins.annotations.Component;
|
||||
+import org.apache.maven.plugins.annotations.Mojo;
|
||||
+import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.reporting.AbstractMavenReportRenderer;
|
||||
import org.apache.maven.reporting.MavenReport;
|
||||
import org.apache.maven.reporting.MavenReportException;
|
||||
@@ -44,9 +47,9 @@
|
||||
*
|
||||
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
|
||||
* @version $Id: AntlrHtmlReport.java 13111 2010-11-16 22:16:36Z pgier $
|
||||
- * @goal html
|
||||
* @see <a href="http://www.antlr2.org/doc/options.html#Command%20Line%20Options">Command Line Options</a>
|
||||
*/
|
||||
+@Mojo( name = "html" )
|
||||
public class AntlrHtmlReport
|
||||
extends AbstractAntlrMojo
|
||||
implements MavenReport
|
||||
@@ -58,36 +61,38 @@
|
||||
/**
|
||||
* Generates the site report
|
||||
*
|
||||
- * @component
|
||||
*/
|
||||
+ @Component
|
||||
private Renderer siteRenderer;
|
||||
|
||||
/**
|
||||
* Internationalization.
|
||||
*
|
||||
- * @component
|
||||
*/
|
||||
+ @Component
|
||||
protected I18N i18n;
|
||||
|
||||
/**
|
||||
* Specifies the destination directory where Antlr generates HTML files.
|
||||
*
|
||||
- * @parameter default-value="${project.build.directory}/generated-site/antlr"
|
||||
*/
|
||||
+ @Parameter( defaultValue = "${project.build.directory}/generated-site/antlr" )
|
||||
private File reportOutputDirectory;
|
||||
|
||||
/**
|
||||
* The name of the Antlr report.
|
||||
*
|
||||
- * @parameter expression="${name}" default-value="Antlr Grammars"
|
||||
*/
|
||||
+ @Parameter( property = "name",
|
||||
+ defaultValue = "Antlr Grammars" )
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* The description of the Antlr report.
|
||||
*
|
||||
- * @parameter expression="${description}" default-value="Generated Antlr report from grammars."
|
||||
*/
|
||||
+ @Parameter( property = "description",
|
||||
+ defaultValue = "Generated Antlr report from grammars." )
|
||||
private String description;
|
||||
|
||||
/**
|
||||
--- antlr-maven-plugin-2.2/src/main/java/org/codehaus/mojo/antlr/AntlrPlugin.java 2025-03-27 08:54:38.467763399 +0100
|
||||
+++ antlr-maven-plugin-2.2/src/main/java/org/codehaus/mojo/antlr/AntlrPlugin.java 2025-03-27 08:59:20.158846210 +0100
|
||||
@@ -23,6 +23,10 @@
|
||||
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
|
||||
+import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
+import org.apache.maven.plugins.annotations.Mojo;
|
||||
+import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||
+
|
||||
//----------------------------------------------------------------------
|
||||
// Don't remove this snippet
|
||||
//----------------------------------------------------------------------
|
||||
@@ -30,12 +34,12 @@
|
||||
/**
|
||||
* Generates files based on grammar files with Antlr tool.
|
||||
*
|
||||
- * @goal generate
|
||||
- * @phase generate-sources
|
||||
- * @requiresDependencyResolution compile
|
||||
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
|
||||
* @version $Id: AntlrPlugin.java 13111 2010-11-16 22:16:36Z pgier $
|
||||
*/
|
||||
+@Mojo( name = "generate",
|
||||
+ defaultPhase = LifecyclePhase.GENERATE_SOURCES,
|
||||
+ requiresDependencyResolution = ResolutionScope.COMPILE )
|
||||
public class AntlrPlugin
|
||||
extends AbstractAntlrMojo
|
||||
{
|
@@ -1,3 +1,24 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 23 14:40:55 UTC 2025 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
- Allow building with either maven 3 or 4
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 27 13:55:54 UTC 2025 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
- Added patch:
|
||||
* antlr-maven-plugin-mpt4.patch
|
||||
+ port the plugin to java-annotations extractor instead of the
|
||||
deprecated java-javadoc one
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 2 10:25:40 UTC 2024 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
- Modified patches:
|
||||
* maven-antlr-plugin-2.1-sinkfix.patch
|
||||
* new-reporting-api.patch
|
||||
+ port to changes in maven-doxia-sitetools 2.0.0 milestones
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 20 10:57:20 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package antlr-maven-plugin
|
||||
#
|
||||
# Copyright (c) 2023 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -32,11 +32,13 @@ Patch2: maven-antlr-plugin-2.1-sinkfix.patch
|
||||
Patch3: 0001-MANTLR-34-Fix-NPE-when-building-Jenkins.patch
|
||||
Patch4: new-reporting-api.patch
|
||||
Patch5: jdk18plus.patch
|
||||
Patch6: antlr-maven-plugin-mpt4.patch
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: java-devel >= 1.8
|
||||
BuildRequires: maven-local
|
||||
BuildRequires: unzip
|
||||
BuildRequires: mvn(org.apache.commons:commons-exec)
|
||||
BuildRequires: mvn(org.apache.maven.plugin-tools:maven-plugin-annotations)
|
||||
BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin)
|
||||
BuildRequires: mvn(org.apache.maven.reporting:maven-reporting-impl)
|
||||
BuildRequires: mvn(org.apache.maven.wagon:wagon-provider-api)
|
||||
@@ -68,8 +70,11 @@ This package contains the API documentation for %{name}.
|
||||
%patch -P 3 -p1 -b .fixnpe
|
||||
%patch -P 4 -p1
|
||||
%patch -P 5 -p1
|
||||
%patch -P 6 -p1
|
||||
|
||||
%pom_change_dep :maven-project :maven-core:3.9.3
|
||||
%pom_change_dep :maven-project :maven-core
|
||||
%pom_change_dep org.apache.maven::2.0.2 ::3.9.9
|
||||
%pom_add_dep org.apache.maven.plugin-tools:maven-plugin-annotations:3.15.1:provided
|
||||
|
||||
# reporting eventually pulls in another antlr and we'd break with weird errors
|
||||
%pom_xpath_inject "pom:dependency[pom:artifactId[text()='maven-reporting-impl']]/pom:exclusions" "
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
import org.apache.maven.doxia.siterenderer.Renderer;
|
||||
import org.apache.maven.doxia.siterenderer.RendererException;
|
||||
+import org.apache.maven.doxia.siterenderer.RenderingContext;
|
||||
+import org.apache.maven.doxia.siterenderer.DocumentRenderingContext;
|
||||
import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugin.MojoFailureException;
|
||||
@@ -13,7 +13,7 @@
|
||||
try
|
||||
{
|
||||
- SiteRendererSink sink = siteRenderer.createSink( getReportOutputDirectory(), getOutputName() + ".html" );
|
||||
+ RenderingContext context = new RenderingContext( getReportOutputDirectory(), getOutputName() + ".html" );
|
||||
+ DocumentRenderingContext context = new DocumentRenderingContext( getReportOutputDirectory(), getOutputName() + ".html", null );
|
||||
+ SiteRendererSink sink = new SiteRendererSink( context );
|
||||
|
||||
generate( sink, Locale.getDefault() );
|
||||
|
@@ -1,15 +1,20 @@
|
||||
--- antlr-maven-plugin-2.2/src/main/java/org/codehaus/mojo/antlr/AntlrHtmlReport.java 2010-11-16 16:59:34.000000000 +0100
|
||||
+++ antlr-maven-plugin-2.2/src/main/java/org/codehaus/mojo/antlr/AntlrHtmlReport.java 2022-03-10 21:12:43.366027036 +0100
|
||||
@@ -128,6 +128,12 @@
|
||||
arguments.add( "-html" );
|
||||
--- antlr-maven-plugin-2.2/src/main/java/org/codehaus/mojo/antlr/AntlrHtmlReport.java 2024-10-02 11:40:33.269689821 +0200
|
||||
+++ antlr-maven-plugin-2.2/src/main/java/org/codehaus/mojo/antlr/AntlrHtmlReport.java 2024-10-02 11:42:56.144065975 +0200
|
||||
@@ -34,7 +34,7 @@
|
||||
import org.apache.maven.reporting.MavenReport;
|
||||
import org.apache.maven.reporting.MavenReportException;
|
||||
import org.apache.maven.wagon.PathUtils;
|
||||
-import org.codehaus.doxia.sink.Sink;
|
||||
+import org.apache.maven.doxia.sink.Sink;
|
||||
import org.codehaus.plexus.i18n.I18N;
|
||||
import org.codehaus.plexus.util.FileUtils;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
@@ -129,7 +129,7 @@
|
||||
}
|
||||
|
||||
+ public void generate(
|
||||
+ final org.apache.maven.doxia.sink.Sink sink,
|
||||
+ final Locale locale) throws MavenReportException {
|
||||
+ generate( (Sink) sink, locale);
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* @see org.apache.maven.reporting.MavenReport#generate(org.codehaus.doxia.sink.Sink, java.util.Locale)
|
||||
- * @see org.apache.maven.reporting.MavenReport#generate(org.codehaus.doxia.sink.Sink, java.util.Locale)
|
||||
+ * @see org.apache.maven.reporting.MavenReport#generate(org.apache.maven.doxia.sink.Sink, java.util.Locale)
|
||||
*/
|
||||
public void generate( Sink sink, Locale locale )
|
||||
throws MavenReportException
|
||||
|
Reference in New Issue
Block a user