Re-enable java

This commit is contained in:
Orion Poplawski 2021-10-29 22:01:03 -06:00
parent 73ba13a4e9
commit 08e46e3afb

View File

@ -1,7 +1,7 @@
# Build -python subpackage # Build -python subpackage
%bcond_without python %bcond_without python
# Build -java subpackage # Build -java subpackage
%bcond_with java %bcond_without java
#global rcver rc2 #global rcver rc2
@ -139,6 +139,8 @@ BuildArch: noarch
BuildRequires: maven-local BuildRequires: maven-local
BuildRequires: mvn(com.google.code.gson:gson) BuildRequires: mvn(com.google.code.gson:gson)
BuildRequires: mvn(com.google.guava:guava) BuildRequires: mvn(com.google.guava:guava)
BuildRequires: mvn(com.google.guava:guava-testlib)
BuildRequires: mvn(com.google.truth:truth)
BuildRequires: mvn(junit:junit) BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
@ -214,19 +216,18 @@ find -name \*.cc -o -name \*.h | xargs chmod -x
chmod 644 examples/* chmod 644 examples/*
%if %{with java} %if %{with java}
%pom_remove_dep org.easymock:easymockclassextension java/pom.xml java/core/pom.xml java/lite/pom.xml java/util/pom.xml %pom_remove_dep org.easymock:easymockclassextension java/pom.xml java/core/pom.xml java/lite/pom.xml java/util/pom.xml
%pom_remove_dep com.google.truth:truth java/pom.xml java/core/pom.xml java/lite/pom.xml java/util/pom.xml
%pom_remove_dep com.google.errorprone:error_prone_annotations java/util/pom.xml %pom_remove_dep com.google.errorprone:error_prone_annotations java/util/pom.xml
%pom_remove_dep com.google.guava:guava-testlib java/pom.xml java/util/pom.xml
# These use easymockclassextension # These use easymockclassextension
rm java/core/src/test/java/com/google/protobuf/ServiceTest.java rm java/core/src/test/java/com/google/protobuf/ServiceTest.java
# These use truth or error_prone_annotations or guava-testlib
rm java/core/src/test/java/com/google/protobuf/LiteralByteStringTest.java # Remove annotation libraries we don't have
rm java/core/src/test/java/com/google/protobuf/BoundedByteStringTest.java annotations=$(
rm java/core/src/test/java/com/google/protobuf/RopeByteStringTest.java find -name '*.java' |
rm java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java xargs grep -h -e '^import com\.google\.errorprone\.annotation' |
rm java/core/src/test/java/com/google/protobuf/TextFormatTest.java sort -u | sed 's/.*\.\([^.]*\);/\1/' | paste -sd\|
rm -r java/util/src/test/java/com/google/protobuf/util )
rm -r java/util/src/main/java/com/google/protobuf/util find -name '*.java' | xargs sed -ri \
"s/^import .*\.($annotations);//;s/@($annotations)"'\>\s*(\((("[^"]*")|([^)]*))\))?//g'
# Make OSGi dependency on sun.misc package optional # Make OSGi dependency on sun.misc package optional
%pom_xpath_inject "pom:configuration/pom:instructions" "<Import-Package>sun.misc;resolution:=optional,*</Import-Package>" java/core %pom_xpath_inject "pom:configuration/pom:instructions" "<Import-Package>sun.misc;resolution:=optional,*</Import-Package>" java/core