Fridrich Strba 2022-01-13 11:49:56 +00:00 committed by Git OBS Bridge
parent 37b32e4cb7
commit 1bbc702e3b
7 changed files with 144 additions and 83 deletions

View File

@ -1,39 +0,0 @@
From 31f530b26bd4625ffe41aa16c48836455ef81c23 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Fri, 7 Jun 2019 10:39:34 +0200
Subject: [PATCH] Port to JFlex 1.7.0
---
src/grammar/lexer.flex | 2 +-
.../java/com/thoughtworks/qdox/library/ClassLoaderLibrary.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/grammar/lexer.flex b/src/grammar/lexer.flex
index 9b567ff..cd9d5b6 100644
--- a/src/grammar/lexer.flex
+++ b/src/grammar/lexer.flex
@@ -168,7 +168,7 @@ import java.util.*;
}
public JFlexLexer( java.io.InputStream stream, java.io.Writer writer ) {
- this( stream );
+ this( new java.io.InputStreamReader( stream, java.nio.charset.Charset.forName( "UTF-8" ) ) );
this.writer = writer;
}
diff --git a/src/main/java/com/thoughtworks/qdox/library/ClassLoaderLibrary.java b/src/main/java/com/thoughtworks/qdox/library/ClassLoaderLibrary.java
index c947f9b..5b415c0 100644
--- a/src/main/java/com/thoughtworks/qdox/library/ClassLoaderLibrary.java
+++ b/src/main/java/com/thoughtworks/qdox/library/ClassLoaderLibrary.java
@@ -112,7 +112,7 @@ public class ClassLoaderLibrary
if ( sourceStream != null )
{
Builder builder = getModelBuilder();
- JavaLexer lexer = new JFlexLexer( sourceStream );
+ JavaLexer lexer = new JFlexLexer( new java.io.InputStreamReader( sourceStream, java.nio.charset.Charset.forName( "UTF-8" ) ) );
Parser parser = new Parser( lexer, builder );
parser.setDebugLexer( debugLexer );
parser.setDebugParser( debugParser );
--
2.21.0

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:57148d2984cf47473365c86d5affe77a38b11f9982cc24456f9dd98cda820bf6
size 457511

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7656659c8ff8b4e3f6c9b5fd0164bfe2ff7211ccedaa21046e53e63005a6d37b
size 459971

View File

@ -1,19 +0,0 @@
Manifest-Version: 1.0
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.4
Bundle-Name: %pluginName
Bundle-SymbolicName: com.thoughtworks.qdox
Bundle-Version: 1.6.3.v20081201-1400
Export-Package: com.thoughtworks.qdox;version="1.6.3",com.thoughtworks
.qdox.ant;version="1.6.3",com.thoughtworks.qdox.directorywalker;versi
on="1.6.3",com.thoughtworks.qdox.junit;version="1.6.3",com.thoughtwor
ks.qdox.model;version="1.6.3",com.thoughtworks.qdox.model.util;versio
n="1.6.3",com.thoughtworks.qdox.parser;version="1.6.3",com.thoughtwor
ks.qdox.parser.impl;version="1.6.3",com.thoughtworks.qdox.parser.stru
cts;version="1.6.3",com.thoughtworks.qdox.tools;version="1.6.3"
Bundle-ManifestVersion: 2
Import-Package: junit.framework;version="[3.8.2,4.0.0)";resolution:=op
tional,org.apache.tools.ant;version="[1.7.0,2.0.0)";resolution:=optio
nal,org.apache.tools.ant.types;version="[1.7.0,2.0.0)";resolution:=op
tional

110
qdox-build.xml Normal file
View File

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="qdox" default="package" basedir=".">
<!-- ====================================================================== -->
<!-- Build environment properties -->
<!-- ====================================================================== -->
<property file="build.properties"/>
<property name="project.artifactId" value="qdox"/>
<property name="project.version" value="2.0.1"/>
<property name="build.finalName" value="${project.artifactId}-${project.version}"/>
<property name="build.dir" value="target"/>
<property name="build.outputDir" value="${build.dir}/classes"/>
<property name="build.srcDir" value="src/main/java"/>
<property name="build.resourceDir" value="src/main/resources"/>
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
<property name="compiler.source" value="1.7"/>
<property name="compiler.target" value="${compiler.source}"/>
<!-- ====================================================================== -->
<!-- Cleaning up target -->
<!-- ====================================================================== -->
<target name="clean" description="Clean the output directory">
<delete dir="${build.dir}"/>
</target>
<!-- ====================================================================== -->
<!-- Compilation target -->
<!-- ====================================================================== -->
<target name="compile" description="Compile the code">
<mkdir dir="${build.outputDir}"/>
<javac destdir="${build.outputDir}"
nowarn="false"
debug="true"
optimize="false"
deprecation="true"
target="${compiler.target}"
verbose="false"
fork="false"
source="${compiler.source}">
<src>
<pathelement location="${build.srcDir}"/>
</src>
</javac>
</target>
<!-- ====================================================================== -->
<!-- Javadoc target -->
<!-- ====================================================================== -->
<target name="javadoc" description="Generates the Javadoc of the application">
<javadoc sourcepath="${build.srcDir}"
packagenames="*"
destdir="${reporting.outputDirectory}/apidocs"
access="protected"
source="${compiler.source}"
verbose="false"
version="true"
use="true"
author="true"
splitindex="false"
nodeprecated="false"
nodeprecatedlist="false"
notree="false"
noindex="false"
nohelp="false"
nonavbar="false"
serialwarn="false"
charset="ISO-8859-1"
linksource="false"
breakiterator="false"/>
</target>
<!-- ====================================================================== -->
<!-- Package target -->
<!-- ====================================================================== -->
<target name="package" depends="compile" description="Package the application">
<jar jarfile="${build.dir}/${build.finalName}.jar"
compress="true"
index="false"
basedir="${build.outputDir}"
excludes="**/package.html">
<manifest>
<attribute name="Bundle-Localization" value="plugin"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-Name" value="%pluginName"/>
<attribute name="Bundle-RequiredExecutionEnvironment" value="J2SE-${compiler.target}"/>
<attribute name="Bundle-SymbolicName" value="com.thoughtworks.qdox"/>
<attribute name="Bundle-Vendor" value="%providerName"/>
<attribute name="Bundle-Version" value="${project.version}"/>
<attribute name="Export-Package" value="com.thoughtworks.qdox.ant;version=&quot;${project.version}&quot;,com.thoughtworks.qdox.directorywalker;version=&quot;${project.version}&quot;,com.thoughtworks.qdox.junit;version=&quot;${project.version}&quot;,com.thoughtworks.qdox.model.util;version=&quot;${project.version}&quot;,com.thoughtworks.qdox.model;version=&quot;${project.version}&quot;,com.thoughtworks.qdox.parser.impl;version=&quot;${project.version}&quot;,com.thoughtworks.qdox.parser.structs;version=&quot;${project.version}&quot;,com.thoughtworks.qdox.parser;version=&quot;${project.version}&quot;,com.thoughtworks.qdox.tools;version=&quot;${project.version}&quot;,com.thoughtworks.qdox;version=&quot;${project.version}&quot;"/>
<attribute name="Import-Package" value="junit.framework;version=&quot;[3.8.2,4.0.0)&quot;;resolution:=optional,org.apache.tools.ant.types;version=&quot;[1.7.0,2.0.0)&quot;;resolution:=optional,org.apache.tools.ant;version=&quot;[1.7.0,2.0.0)&quot;;resolution:=optional"/>
</manifest>
</jar>
</target>
<!-- ====================================================================== -->
<!-- A dummy target for the package named after the type it creates -->
<!-- ====================================================================== -->
<target name="jar" depends="package" description="Builds the jar for the application"/>
</project>

View File

@ -1,3 +1,23 @@
-------------------------------------------------------------------
Thu Jan 13 11:45:28 UTC 2022 - Fridrich Strba <fstrba@suse.com>
- Update to version 2.0.1:
* Changes:
+ Support Lambda Expression
+ Add SEALED / NON_SEALED tokens
+ #75 CodeBlock for Annotation with FieldReference should prefix
field with canonical name
+ Add UnqualifiedClassInstanceCreationExpression
+ updating jflex-maven-plugin to 1.8.2
+ Add reference to grammar documentation and hints to transform
it
+ Support Text Blocks
+ Support Sealed Classes
+ #67 Support records
+ #76 test with an @@ in comment
+ #64 Get interface via javaProjectBuilder.getClassByName
- Generate ant build file from maven pom and build using ant
-------------------------------------------------------------------
Thu Apr 29 23:11:06 UTC 2021 - Ferdinand Thiessen <rpm@fthiessen.de>

View File

@ -17,15 +17,15 @@
Name: qdox
Version: 2.0.0
Version: 2.0.1
Release: 0
Summary: Tool to extract class/interface/method definitions from sources
License: Apache-2.0
Group: Development/Libraries/Java
URL: https://github.com/paul-hammant/qdox
Source0: https://repo1.maven.org/maven2/com/thoughtworks/qdox/qdox/%{version}/%{name}-%{version}-project.tar.bz2
Source1: qdox-MANIFEST.MF
Patch0: 0001-Port-to-JFlex-1.7.0.patch
Source1: qdox-build.xml
BuildRequires: ant
BuildRequires: byaccj
BuildRequires: fdupes
BuildRequires: java-cup-bootstrap
@ -48,19 +48,18 @@ API docs for %{name}.
%prep
%setup -q
%patch0 -p1
cp %{SOURCE1} build.xml
find -name *.jar -delete
find -name *.class -delete
rm -rf bootstrap
# Fix line endings
sed -i "s|\r||" README.md
# We don't need these plugins
%pom_remove_plugin :animal-sniffer-maven-plugin
%pom_remove_plugin :maven-assembly-plugin
%pom_remove_plugin :maven-failsafe-plugin
%pom_remove_plugin :maven-jflex-plugin
%pom_remove_plugin :maven-invoker-plugin
%pom_remove_plugin :jflex-maven-plugin
%pom_remove_plugin :maven-enforcer-plugin
%pom_xpath_set pom:workingDirectory '${basedir}/src/main/java/com/thoughtworks/qdox/parser/impl'
%pom_remove_plugin :exec-maven-plugin
%pom_remove_parent .
@ -75,29 +74,19 @@ jflex -d src/main/java/com/thoughtworks/qdox/parser/impl src/grammar/commentlexe
byaccj -v -Jnorun -Jnoconstruct -Jclass=Parser -Jimplements=CommentHandler -Jsemantic=Value -Jpackage=com.thoughtworks.qdox.parser.impl -Jstack=500 ../../../../../../../grammar/parser.y
)
# Build artifact
mkdir -p build/classes
javac -d build/classes -source 6 -target 6 \
$(find src/main/java -name \*.java)
jar cf build/%{name}-%{version}.jar -C build/classes .
# Inject OSGi manifests
jar ufm build/%{name}-%{version}.jar %{SOURCE1}
mkdir -p build/apidoc
javadoc -d build/apidoc -source 6 -notimestamp $(find src/main/java -name \*.java)
%ant jar javadoc
%install
# jar
install -dm 0755 %{buildroot}%{_javadir}
install -pm 0644 build/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
install -pm 0644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
# pom
install -dm 0755 %{buildroot}%{_mavenpomdir}
install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom
%add_maven_depmap %{name}.pom %{name}.jar -a qdox:qdox
# javadoc
mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -aL build/apidoc/* %{buildroot}%{_javadocdir}/%{name}
cp -aL target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
%fdupes -s %{buildroot}%{_javadocdir}
%files -f .mfiles