Accepting request 691493 from home:fstrba:maven

OBS-URL: https://build.opensuse.org/request/show/691493
OBS-URL: https://build.opensuse.org/package/show/Java:packages/antlr-maven-plugin?expand=0&rev=1
This commit is contained in:
Fridrich Strba 2019-04-04 11:52:41 +00:00 committed by Git OBS Bridge
commit 59825a1474
7 changed files with 235 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View 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

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d55783bff4e79818930eb888cfa93a4a0511e1f9f24712f842f5aaa2cfa2ac6
size 134214

91
antlr-maven-plugin.spec Normal file
View File

@ -0,0 +1,91 @@
#
# spec file for package antlr-maven-plugin
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: antlr-maven-plugin
Version: 2.2
Release: 0
Summary: Maven plugin that generates files based on grammar file(s)
License: Apache-2.0
Group: Development/Libraries/Java
URL: http://mojo.codehaus.org/antlr-maven-plugin/
Source0: http://repo1.maven.org/maven2/org/codehaus/mojo/%{name}/%{version}/%{name}-%{version}-source-release.zip
# Modern modello expects to see <models></models>, even if there is only one.
Patch0: maven-antlr-plugin-2.2-modello-issue.patch
# siteRenderer.createSink doesn't exist anymore
Patch2: maven-antlr-plugin-2.1-sinkfix.patch
# Fix grammar processing bug (bz 1020312)
Patch3: 0001-MANTLR-34-Fix-NPE-when-building-Jenkins.patch
BuildRequires: fdupes
BuildRequires: maven-local
BuildRequires: mvn(org.apache.commons:commons-exec)
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)
BuildRequires: mvn(org.apache.maven:maven-plugin-api)
BuildRequires: mvn(org.apache.maven:maven-project)
BuildRequires: mvn(org.codehaus.modello:modello-maven-plugin)
BuildRequires: mvn(org.codehaus.mojo:mojo-parent:pom:)
BuildRequires: mvn(org.codehaus.plexus:plexus-i18n)
BuildRequires: mvn(org.codehaus.plexus:plexus-utils)
BuildRequires: unzip
BuildArch: noarch
%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}
Group: Documentation/HTML
%description javadoc
This package contains the API documentation for %{name}.
%prep
%setup -q
%patch0 -p1 -b .modello
%patch2 -b .sink
%patch3 -p1 -b .fixnpe
# 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" "
<exclusion>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
</exclusion>"
# remove all binary bits
find -name '*.class' -exec rm -f '{}' \;
find -name '*.jar' -exec rm -f '{}' \;
%{mvn_file} : %{name}
%build
%{mvn_build} -f -- -Dsource=6
%install
%mvn_install
%fdupes -s %{buildroot}%{_javadocdir}
%files -f .mfiles
%files javadoc -f .mfiles-javadoc
%changelog

View 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 )

View 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>