package init
This commit is contained in:
parent
cf2cf6a16e
commit
42c68cdb34
72
0001-MANTLR-34-Fix-NPE-when-building-Jenkins.patch
Normal file
72
0001-MANTLR-34-Fix-NPE-when-building-Jenkins.patch
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
From 1305d8d7aa5f9724e28d54a112a524f9a2fb0af7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Michal Srb <msrb@redhat.com>
|
||||||
|
Date: Wed, 16 Oct 2013 14:29:21 +0200
|
||||||
|
Subject: [PATCH] [MANTLR-34] Fix NPE when building Jenkins
|
||||||
|
|
||||||
|
---
|
||||||
|
.../mojo/antlr/metadata/MetadataExtracter.java | 40 ++++++++++++----------
|
||||||
|
1 file changed, 21 insertions(+), 19 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/codehaus/mojo/antlr/metadata/MetadataExtracter.java b/src/main/java/org/codehaus/mojo/antlr/metadata/MetadataExtracter.java
|
||||||
|
index c54f301..8637dea 100644
|
||||||
|
--- a/src/main/java/org/codehaus/mojo/antlr/metadata/MetadataExtracter.java
|
||||||
|
+++ b/src/main/java/org/codehaus/mojo/antlr/metadata/MetadataExtracter.java
|
||||||
|
@@ -239,34 +239,36 @@ public class MetadataExtracter
|
||||||
|
Method getRHSMethod = helper.getAntlrOptionClass().getMethod( "getRHS", Helper.NO_ARG_SIGNATURE );
|
||||||
|
getRHSMethod.setAccessible( true );
|
||||||
|
|
||||||
|
- Object importVocabOption = getElementMethod.invoke( options, new Object[] { "importVocab" } );
|
||||||
|
- if ( importVocabOption != null )
|
||||||
|
- {
|
||||||
|
- String importVocab = (String) getRHSMethod.invoke( importVocabOption, Helper.NO_ARGS );
|
||||||
|
- if ( importVocab != null )
|
||||||
|
+ if ( options != null ) {
|
||||||
|
+ Object importVocabOption = getElementMethod.invoke( options, new Object[] { "importVocab" } );
|
||||||
|
+ if ( importVocabOption != null )
|
||||||
|
{
|
||||||
|
- importVocab = importVocab.trim();
|
||||||
|
- if ( importVocab.endsWith( ";" ) )
|
||||||
|
+ String importVocab = (String) getRHSMethod.invoke( importVocabOption, Helper.NO_ARGS );
|
||||||
|
+ if ( importVocab != null )
|
||||||
|
{
|
||||||
|
- importVocab = importVocab.substring( 0, importVocab.length() - 1 );
|
||||||
|
+ importVocab = importVocab.trim();
|
||||||
|
+ if ( importVocab.endsWith( ";" ) )
|
||||||
|
+ {
|
||||||
|
+ importVocab = importVocab.substring( 0, importVocab.length() - 1 );
|
||||||
|
+ }
|
||||||
|
+ grammar.setImportVocab( importVocab );
|
||||||
|
}
|
||||||
|
- grammar.setImportVocab( importVocab );
|
||||||
|
}
|
||||||
|
- }
|
||||||
|
|
||||||
|
- Object exportVocabOption = getElementMethod.invoke( options, new Object[] { "exportVocab" } );
|
||||||
|
- if ( exportVocabOption != null )
|
||||||
|
- {
|
||||||
|
- String exportVocab = (String) getRHSMethod.invoke( exportVocabOption, Helper.NO_ARGS );
|
||||||
|
- if ( exportVocab != null )
|
||||||
|
+ Object exportVocabOption = getElementMethod.invoke( options, new Object[] { "exportVocab" } );
|
||||||
|
+ if ( exportVocabOption != null )
|
||||||
|
{
|
||||||
|
- exportVocab = exportVocab.trim();
|
||||||
|
- if ( exportVocab.endsWith( ";" ) )
|
||||||
|
+ String exportVocab = (String) getRHSMethod.invoke( exportVocabOption, Helper.NO_ARGS );
|
||||||
|
+ if ( exportVocab != null )
|
||||||
|
{
|
||||||
|
- exportVocab = exportVocab.substring( 0, exportVocab.length() - 1 );
|
||||||
|
+ exportVocab = exportVocab.trim();
|
||||||
|
+ if ( exportVocab.endsWith( ";" ) )
|
||||||
|
+ {
|
||||||
|
+ exportVocab = exportVocab.substring( 0, exportVocab.length() - 1 );
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
+ grammar.setExportVocab( exportVocab );
|
||||||
|
}
|
||||||
|
- grammar.setExportVocab( exportVocab );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch ( Throwable t )
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
||||||
BIN
antlr-maven-plugin-2.2-source-release.zip
Normal file
BIN
antlr-maven-plugin-2.2-source-release.zip
Normal file
Binary file not shown.
59
antlr-maven-plugin.spec
Normal file
59
antlr-maven-plugin.spec
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
Name: antlr-maven-plugin
|
||||||
|
Version: 2.2
|
||||||
|
Release: 1
|
||||||
|
Summary: Maven plugin that generates files based on grammar file(s)
|
||||||
|
License: ASL 2.0
|
||||||
|
URL: https://www.antlr.org/api/maven-plugin/latest
|
||||||
|
Source0: https://repo1.maven.org/maven2/org/codehaus/mojo/antlr-maven-plugin/2.2/antlr-maven-plugin-2.2-source-release.zip
|
||||||
|
Patch0: maven-antlr-plugin-2.2-modello-issue.patch
|
||||||
|
Patch2: maven-antlr-plugin-2.1-sinkfix.patch
|
||||||
|
Patch3: 0001-MANTLR-34-Fix-NPE-when-building-Jenkins.patch
|
||||||
|
BuildArch: noarch
|
||||||
|
BuildRequires: maven-local mvn(org.apache.commons:commons-exec)
|
||||||
|
BuildRequires: mvn(org.apache.maven:maven-plugin-api) mvn(org.apache.maven:maven-project)
|
||||||
|
BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin)
|
||||||
|
BuildRequires: mvn(org.apache.maven.reporting:maven-reporting-impl)
|
||||||
|
BuildRequires: mvn(org.apache.maven.shared:maven-plugin-testing-harness)
|
||||||
|
BuildRequires: mvn(org.apache.maven.wagon:wagon-provider-api)
|
||||||
|
BuildRequires: mvn(org.codehaus.modello:modello-maven-plugin)
|
||||||
|
BuildRequires: mvn(org.codehaus.mojo:mojo-parent:pom:) mvn(org.codehaus.plexus:plexus-i18n)
|
||||||
|
BuildRequires: mvn(org.codehaus.plexus:plexus-utils)
|
||||||
|
|
||||||
|
%description
|
||||||
|
The Antlr Plugin has two goals:
|
||||||
|
- antlr:generate Generates file(s) to a target directory based on grammar
|
||||||
|
file(s).
|
||||||
|
- antlr:html Generates Antlr report for grammar file(s).
|
||||||
|
|
||||||
|
%package javadoc
|
||||||
|
Summary: Javadocs for %{name}
|
||||||
|
%description javadoc
|
||||||
|
This package contains the API documentation for %{name}.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q
|
||||||
|
%patch0 -p1 -b .modello
|
||||||
|
%patch2 -b .sink
|
||||||
|
%patch3 -p1 -b .fixnpe
|
||||||
|
%pom_xpath_inject "pom:dependency[pom:artifactId[text()='maven-reporting-impl']]/pom:exclusions" "
|
||||||
|
<exclusion>
|
||||||
|
<groupId>antlr</groupId>
|
||||||
|
<artifactId>antlr</artifactId>
|
||||||
|
</exclusion>"
|
||||||
|
find -name '*.class' -exec rm -f '{}' \;
|
||||||
|
find -name '*.jar' -exec rm -f '{}' \;
|
||||||
|
%mvn_file : %{name}
|
||||||
|
|
||||||
|
%build
|
||||||
|
%mvn_build -- -Dmaven.test.skip=true
|
||||||
|
|
||||||
|
%install
|
||||||
|
%mvn_install
|
||||||
|
|
||||||
|
%files -f .mfiles
|
||||||
|
|
||||||
|
%files javadoc -f .mfiles-javadoc
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Mon Jul 27 2020 chengzihan <chengzihan2@huawei.com> - 2.2-1
|
||||||
|
- Package init
|
||||||
4
antlr-maven-plugin.yaml
Normal file
4
antlr-maven-plugin.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
version_control: NA
|
||||||
|
src_repo: NA
|
||||||
|
tag_prefix: NA
|
||||||
|
seperator: NA
|
||||||
33
maven-antlr-plugin-2.1-sinkfix.patch
Normal file
33
maven-antlr-plugin-2.1-sinkfix.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
--- src/main/java/org/codehaus/mojo/antlr/AntlrHtmlReport.java.sink 2010-11-16 16:59:34.000000000 +0000
|
||||||
|
+++ src/main/java/org/codehaus/mojo/antlr/AntlrHtmlReport.java 2015-06-17 10:54:56.729105945 +0100
|
||||||
|
@@ -27,6 +27,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.sink.SiteRendererSink;
|
||||||
|
import org.apache.maven.plugin.MojoExecutionException;
|
||||||
|
import org.apache.maven.plugin.MojoFailureException;
|
||||||
|
@@ -217,20 +218,11 @@
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
- SiteRendererSink sink = siteRenderer.createSink( getReportOutputDirectory(), getOutputName() + ".html" );
|
||||||
|
+ RenderingContext context = new RenderingContext( getReportOutputDirectory(), getOutputName() + ".html" );
|
||||||
|
+ SiteRendererSink sink = new SiteRendererSink( context );
|
||||||
|
|
||||||
|
generate( sink, Locale.getDefault() );
|
||||||
|
}
|
||||||
|
- catch ( RendererException e )
|
||||||
|
- {
|
||||||
|
- throw new MojoExecutionException( "An error has occurred in " + getName( Locale.ENGLISH )
|
||||||
|
- + " report generation.", e );
|
||||||
|
- }
|
||||||
|
- catch ( IOException e )
|
||||||
|
- {
|
||||||
|
- throw new MojoExecutionException( "An error has occurred in " + getName( Locale.ENGLISH )
|
||||||
|
- + " report generation.", e );
|
||||||
|
- }
|
||||||
|
catch ( MavenReportException e )
|
||||||
|
{
|
||||||
|
throw new MojoExecutionException( "An error has occurred in " + getName( Locale.ENGLISH )
|
||||||
12
maven-antlr-plugin-2.2-modello-issue.patch
Normal file
12
maven-antlr-plugin-2.2-modello-issue.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -up antlr-maven-plugin/pom.xml.BAD antlr-maven-plugin/pom.xml
|
||||||
|
--- antlr-maven-plugin/pom.xml.BAD 2011-03-07 13:18:45.219217017 -0500
|
||||||
|
+++ antlr-maven-plugin/pom.xml 2011-03-07 13:18:57.498217062 -0500
|
||||||
|
@@ -132,7 +132,7 @@
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
- <model>src/main/mdo/antlrOptions.mdo</model>
|
||||||
|
+ <models><model>src/main/mdo/antlrOptions.mdo</model></models>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
Loading…
x
Reference in New Issue
Block a user