adaptations for Java 11 compatibility

This commit is contained in:
Fabio Valentini 2020-07-20 21:59:04 +02:00
parent 05661e1fe1
commit 6f2e2e44e7
4 changed files with 123 additions and 84 deletions

View File

@ -1,7 +1,7 @@
Name: bsf
Epoch: 0
Version: 2.4.0
Release: 36%{?dist}
Release: 37%{?dist}
Summary: Bean Scripting Framework
License: ASL 2.0
URL: http://commons.apache.org/bsf/
@ -10,8 +10,7 @@ BuildArch: noarch
Source0: http://apache.mirror.anlx.net//commons/%{name}/source/%{name}-src-%{version}.tar.gz
Source1: %{name}-pom.xml
Patch0: build-file.patch
Patch1: build.properties.patch
Patch0: java-11-fixes.patch
BuildRequires: javapackages-local
BuildRequires: ant
@ -54,7 +53,7 @@ Javadoc for %{name}.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
find -name \*.jar -delete
%mvn_file : %{name}
@ -77,6 +76,9 @@ ant jar javadocs
%license LICENSE.txt NOTICE.txt
%changelog
* Mon Jul 20 2020 Fabio Valentini <decathorpe@gmail.com> - 0:2.4.0-37
- Adaptations for Java 11 compatibility.
* Fri Jul 10 2020 Jiri Vanek <jvanek@redhat.com> - 0:2.4.0-36
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11

View File

@ -1,33 +0,0 @@
--- bsf-2.4.0-orig/build.xml 2009-09-09 11:51:20.000000000 +0200
+++ bsf-2.4.0/build.xml 2009-09-14 08:42:17.000000000 +0200
@@ -102,7 +102,7 @@
<pathelement location="${build.tests}"/>
</path>
- <target name="init" depends="clean">
+ <target name="init">
<tstamp />
@@ -134,11 +134,13 @@
<available property="junit.present" classname="junit.framework.TestCase" />
+ <!--
<uptodate property="javac.notRequired" targetfile="${build.lib}/${project.name}.jar">
<srcfiles dir="${src.dir}">
<patternset refid="javac.source.files" />
</srcfiles>
</uptodate>
+ -->
<uptodate property="javadoc.required" targetfile="${build.lib}/${project.name}.jar">
<srcfiles dir="${build.dir}" includes="**/*.html" />
@@ -268,6 +270,7 @@
<mkdir dir="${build.javadocs}" />
<!-- FIXME: Excluding some packages temporarily -->
<javadoc packagenames="${packages}" failonerror="true" excludepackagenames="org.apache.bsf.engines.java, org.apache.bsf.engines.javaclass" destdir="${build.javadocs}" author="true" version="false" use="true" windowtitle="${project.fullName} API" doctitle="${project.fullName}" source="${source.level}">
+ <arg value="-Xdoclint:none" />
<classpath refid="compile.classpath" />
<fileset dir="${src.dir}">
<patternset refid="java.source.files"></patternset>

View File

@ -1,47 +0,0 @@
diff --new-file -r -u bsf-2.4.0-orig/build-properties.xml bsf-2.4.0/build-properties.xml
--- bsf-2.4.0-orig/build-properties.xml 1970-01-01 01:00:00.000000000 +0100
+++ bsf-2.4.0/build-properties.xml 2007-05-23 15:33:04.000000000 +0200
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<project name="props">
+ <property name="project.name" value="bsf"/>
+ <property name="project.fullName" value="Bean Scripting Framework"/>
+ <property name="project.version" value="2.4.0"/>
+ <property name="project.debug" value="on"/>
+ <property name="project.deprecation" value="on"/>
+
+ <property name="build.file" value="build.xml"/>
+ <property name="build.dir" value="build"/>
+ <property name="build.dest" value="build/classes"/>
+ <property name="build.lib" value="build/lib"/>
+ <property name="build.lib.win32" value="build/lib/win32"/>
+ <property name="build.samples" value="build/samples"/>
+ <property name="build.samples.calc" value="build/samples/calc"/>
+ <property name="build.samples.scriptedui" value="build/samples/scriptedui"/>
+ <property name="build.samples.xsl" value="build/samples/xsl"/>
+ <property name="build.javadocs" value="build/javadocs"/>
+ <property name="build.tests" value="build/testcases" />
+
+ <property name="dist.dir" value="dist"/>
+ <property name="dist.dir.root" value="${dist.dir}/${project.name}-${project.version}"/>
+ <property name="dist.bin.file" value="${dist.dir}/${project.name}-bin-${project.version}"/>
+ <property name="dist.src.file" value="${dist.dir}/${project.name}-src-${project.version}"/>
+
+ <property name="packages" value="org.apache.*"/>
+
+ <property name="samples.dir" value="samples"/>
+
+ <property name="site.src" location="xdocs"/>
+ <property name="site.dest" location="docs"/>
+ <property name="site.projectFile" value="stylesheets/project.xml"/>
+
+ <property name="source.level" value="1.3" />
+
+ <property name="src.dir" value="src"/>
+
+ <property name="templ.path" location="xdocs/stylesheets"/>
+
+ <property name="tests.dir" value="test"/>
+
+ <property name="velocity.props" location="${site.src}/velocity.properties"/>
+</project>

117
java-11-fixes.patch Normal file
View File

@ -0,0 +1,117 @@
diff --git a/build-properties.xml b/build-properties.xml
new file mode 100644
index 0000000..18d14cc
--- /dev/null
+++ b/build-properties.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<project name="props">
+ <property name="project.name" value="bsf"/>
+ <property name="project.fullName" value="Bean Scripting Framework"/>
+ <property name="project.version" value="2.4.0"/>
+ <property name="project.debug" value="on"/>
+ <property name="project.deprecation" value="on"/>
+
+ <property name="build.file" value="build.xml"/>
+ <property name="build.dir" value="build"/>
+ <property name="build.dest" value="build/classes"/>
+ <property name="build.lib" value="build/lib"/>
+ <property name="build.lib.win32" value="build/lib/win32"/>
+ <property name="build.samples" value="build/samples"/>
+ <property name="build.samples.calc" value="build/samples/calc"/>
+ <property name="build.samples.scriptedui" value="build/samples/scriptedui"/>
+ <property name="build.samples.xsl" value="build/samples/xsl"/>
+ <property name="build.javadocs" value="build/javadocs"/>
+ <property name="build.tests" value="build/testcases" />
+
+ <property name="dist.dir" value="dist"/>
+ <property name="dist.dir.root" value="${dist.dir}/${project.name}-${project.version}"/>
+ <property name="dist.bin.file" value="${dist.dir}/${project.name}-bin-${project.version}"/>
+ <property name="dist.src.file" value="${dist.dir}/${project.name}-src-${project.version}"/>
+
+ <property name="packages" value="org.apache.*"/>
+
+ <property name="samples.dir" value="samples"/>
+
+ <property name="site.src" location="xdocs"/>
+ <property name="site.dest" location="docs"/>
+ <property name="site.projectFile" value="stylesheets/project.xml"/>
+
+ <property name="source.level" value="1.8" />
+ <property name="target.level" value="1.8" />
+
+ <property name="src.dir" value="src"/>
+
+ <property name="templ.path" location="xdocs/stylesheets"/>
+
+ <property name="tests.dir" value="test"/>
+
+ <property name="velocity.props" location="${site.src}/velocity.properties"/>
+</project>
diff --git a/build.xml b/build.xml
index 39d31e1..1792f70 100644
--- a/build.xml
+++ b/build.xml
@@ -102,7 +102,7 @@ Copyright:
<pathelement location="${build.tests}"/>
</path>
- <target name="init" depends="clean">
+ <target name="init">
<tstamp />
@@ -134,11 +134,13 @@ Copyright:
<available property="junit.present" classname="junit.framework.TestCase" />
+ <!--
<uptodate property="javac.notRequired" targetfile="${build.lib}/${project.name}.jar">
<srcfiles dir="${src.dir}">
<patternset refid="javac.source.files" />
</srcfiles>
</uptodate>
+ -->
<uptodate property="javadoc.required" targetfile="${build.lib}/${project.name}.jar">
<srcfiles dir="${build.dir}" includes="**/*.html" />
@@ -214,7 +216,7 @@ Copyright:
<!-- =================================================================== -->
<target name="compile" description="Compiles the BSF *.java files." depends="prepare">
<mkdir dir="${build.dest}"/>
- <javac srcdir="${src.dir}" destdir="${build.dest}" debug="${project.debug}" deprecation="${project.deprecation}" source="${source.level}">
+ <javac srcdir="${src.dir}" destdir="${build.dest}" debug="${project.debug}" deprecation="${project.deprecation}" source="${source.level}" target="${target.level}">
<classpath>
<fileset dir="lib">
<include name="*.jar"/>
@@ -256,9 +258,9 @@ Copyright:
<copy todir="${build.samples}">
<fileset dir="${samples.dir}" />
</copy>
- <javac srcdir="${build.samples.calc}" destdir="${build.samples.calc}" classpath="${build.lib}/${project.name}.jar" debug="${project.debug}" deprecation="${project.deprecation}" source="${source.level}" />
- <javac srcdir="${build.samples.scriptedui}" destdir="${build.samples.scriptedui}" classpath="${build.lib}/${project.name}.jar" debug="${project.debug}" deprecation="${project.deprecation}" source="${source.level}" />
- <javac srcdir="${build.samples.xsl}" destdir="${build.samples.xsl}" classpath="${build.lib}/${project.name}.jar" debug="${project.debug}" deprecation="${project.deprecation}" source="${source.level}" />
+ <javac srcdir="${build.samples.calc}" destdir="${build.samples.calc}" classpath="${build.lib}/${project.name}.jar" debug="${project.debug}" deprecation="${project.deprecation}" source="${source.level}" target="${target.level}" />
+ <javac srcdir="${build.samples.scriptedui}" destdir="${build.samples.scriptedui}" classpath="${build.lib}/${project.name}.jar" debug="${project.debug}" deprecation="${project.deprecation}" source="${source.level}" target="${target.level}" />
+ <javac srcdir="${build.samples.xsl}" destdir="${build.samples.xsl}" classpath="${build.lib}/${project.name}.jar" debug="${project.debug}" deprecation="${project.deprecation}" source="${source.level}" target="${target.level}" />
</target>
<!-- =================================================================== -->
@@ -268,7 +270,7 @@ Copyright:
<mkdir dir="${build.javadocs}" />
<!-- FIXME: Excluding some packages temporarily -->
<javadoc packagenames="${packages}" failonerror="true" excludepackagenames="org.apache.bsf.engines.java, org.apache.bsf.engines.javaclass" destdir="${build.javadocs}" author="true" version="false" use="true" windowtitle="${project.fullName} API" doctitle="${project.fullName}" source="${source.level}">
- <classpath refid="compile.classpath" />
+ <arg value="-Xdoclint:none" />
<fileset dir="${src.dir}">
<patternset refid="java.source.files"></patternset>
</fileset>
@@ -375,7 +377,7 @@ Copyright:
<!-- =================================================================== -->
<target name="compile-test" if="junit.present" depends="compile">
<mkdir dir="${build.tests}" />
- <javac srcdir="${tests.dir}" destdir="${build.tests}" classpath="${build.dest}" source="${source.level}" />
+ <javac srcdir="${tests.dir}" destdir="${build.tests}" classpath="${build.dest}" source="${source.level}" target="${target.level}" />
</target>
<!-- =================================================================== -->