Sync from SUSE:SLFO:Main cal10n revision 8a14a585e449d9137d8ec04e679384fb

This commit is contained in:
Adrian Schröter 2024-05-31 14:33:53 +02:00
parent 9bf8d22b29
commit c0c13c1139
8 changed files with 151 additions and 52 deletions

View File

@ -0,0 +1,47 @@
From a1c260aeeeeb6583deecf76ab9a7ef884c89b942 Mon Sep 17 00:00:00 2001
From: Sylvain Bugat <sylvain.bugat@cpexterne.org>
Date: Thu, 27 Aug 2015 14:54:23 +0200
Subject: [PATCH] Fix SupportedSourceVersion warning
When using cal10n-api this compilation warning is displayed: [WARNING] Supported source version 'RELEASE_5' from annotation processor 'ch.qos.cal10n.verifier.processor.CAL10NAnnotationProcessor' less than -source '1.7'
---
.../processor/CAL10NAnnotationProcessor.java | 21 ++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/cal10n-api/src/main/java/ch/qos/cal10n/verifier/processor/CAL10NAnnotationProcessor.java b/cal10n-api/src/main/java/ch/qos/cal10n/verifier/processor/CAL10NAnnotationProcessor.java
index 136cfe1..023f450 100644
--- a/cal10n-api/src/main/java/ch/qos/cal10n/verifier/processor/CAL10NAnnotationProcessor.java
+++ b/cal10n-api/src/main/java/ch/qos/cal10n/verifier/processor/CAL10NAnnotationProcessor.java
@@ -13,12 +13,31 @@
import java.util.Set;
@SupportedAnnotationTypes("ch.qos.cal10n.BaseName")
-@SupportedSourceVersion(SourceVersion.RELEASE_5)
public class CAL10NAnnotationProcessor extends AbstractProcessor {
TypeElement baseNameTypeElement;
Filer filer;
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+
+ //Replacement of @SupportedSourceVersion(SourceVersion.RELEASE_5) because it generate compilation warning like:
+ //[WARNING] Supported source version 'RELEASE_5' from annotation processor 'ch.qos.cal10n.verifier.processor.CAL10NAnnotationProcessor' less than -source '1.7'
+ try {
+ return SourceVersion.valueOf("RELEASE_8");
+ } catch (IllegalArgumentException e) {}
+
+ try {
+ return SourceVersion.valueOf("RELEASE_7");
+ } catch (IllegalArgumentException e) {}
+
+ try {
+ return SourceVersion.valueOf("RELEASE_6");
+ } catch (IllegalArgumentException x) {}
+
+ return SourceVersion.RELEASE_5;
+ }
+
@Override
public void init(ProcessingEnvironment env) {
super.init(env);

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>plugins</package>
</multibuild>

View File

@ -2,10 +2,13 @@
<service name="tar_scm" mode="disabled">
<param name="scm">git</param>
<param name="url">https://github.com/qos-ch/cal10n.git</param>
<param name="revision">22c048801fb6d04c991a0c8c01bb6fb97ef50b37</param>
<param name="revision">db338cf47ad069d22cc9a0331ae433dfe2024e2a</param>
<param name="match-tag">v_*</param>
<param name="versionformat">@PARENT_TAG@.@TAG_OFFSET@</param>
<param name="versionrewrite-pattern">v_(.*)</param>
<param name="exclude">**/*.jar</param>
<param name="exclude">docs</param>
<param name="exclude">cal10n-site</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>

BIN
cal10n-0.8.1.10.tar.xz (Stored with Git LFS)

Binary file not shown.

BIN
cal10n-0.8.1.12.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
cal10n-build.tar.xz (Stored with Git LFS)

Binary file not shown.

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Thu May 2 14:22:43 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Fetch the latest git revision: 12th commit after 0.8.1 calling
it 0.8.1.12
- Add a multibuild flavour to build the maven plugins
- Added patch:
* Fix-SupportedSourceVersion-warning.patch
+ fix the following: [WARNING] Supported source version
'RELEASE_5' from annotation processor
'ch.qos.cal10n.verifier.processor.CAL10NAnnotationProcessor'
less than -source '1.7'
+ uncommitted change from the following pull request:
https://github.com/qos-ch/cal10n/pull/10
-------------------------------------------------------------------
Wed May 11 13:18:07 UTC 2022 - Fridrich Strba <fstrba@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package cal10n
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,29 +16,49 @@
#
%bcond_with tests
Name: cal10n
Version: 0.8.1.10
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "plugins"
%bcond_without plugins
%else
%bcond_with plugins
%endif
%global base_name cal10n
Version: 0.8.1.12
Release: 0
Summary: Compiler assisted localization library (CAL10N)
License: MIT
Group: Development/Libraries/Java
URL: http://cal10n.qos.ch
Source0: %{name}-%{version}.tar.xz
Source1: %{name}-build.tar.xz
BuildRequires: ant
URL: https://cal10n.qos.ch
Source0: %{base_name}-%{version}.tar.xz
Source1: %{base_name}-build.tar.xz
# https://github.com/qos-ch/cal10n/pull/10
Patch0: Fix-SupportedSourceVersion-warning.patch
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local
BuildRequires: xz
Requires: java
BuildArch: noarch
%if %{with tests}
BuildRequires: ant-antunit
BuildRequires: ant-junit
%if %{with plugins}
Name: %{base_name}-maven-plugins
Summary: Compiler assisted localization library (CAL10N) maven plugins
BuildRequires: maven-local
BuildRequires: mvn(ch.qos.cal10n:cal10n-api)
BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin)
BuildRequires: mvn(org.apache.maven.wagon:wagon-ssh)
BuildRequires: mvn(org.apache.maven:maven-core)
BuildRequires: mvn(org.apache.maven:maven-plugin-api)
%else
Name: %{base_name}
Summary: Compiler assisted localization library (CAL10N)
BuildRequires: ant
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local >= 6
%endif
%description
%if %{with plugins}
Compiler Assisted Localization, abbreviated as CAL10N (pronounced as "calion")
is a java library for writing localized (internationalized) messages.
This package contains maven plugins
%else
Compiler Assisted Localization, abbreviated as CAL10N (pronounced as "calion")
is a java library for writing localized (internationalized) messages.
Features:
@ -48,6 +68,7 @@ Features:
in the most convenient charset, per locale.
* good performance (300 nanoseconds per key look-up)
* automatic reloading of resource bundles upon change
%endif
%package javadoc
Summary: Javadoc for %{name}
@ -57,15 +78,22 @@ Group: Development/Libraries/Java
API documentation for %{name}.
%prep
%setup -q -a1
find . -name "*.jar" -exec rm -f {} \;
%setup -q -n %{base_name}-%{version} -a1
%patch -P 0 -p1
# We don't want to depend on ant, since it will be
# present when we try to use the task
%pom_change_dep :ant :::provided %{name}-ant-task
%pom_change_dep :ant :::provided %{base_name}-ant-task
%pom_disable_module cal10n-site
%pom_disable_module cal10n-api
%pom_disable_module cal10n-ant-task
%pom_change_dep -r :maven-artifact-manager :maven-core
%pom_remove_plugin -r :maven-source-plugin
# bnc#759912
rm -rf docs cal10n-site
cat > README.SUSE <<EOF
The documentation under Creative Commons Attribution-NonCommercial-ShareAlike
@ -77,47 +105,50 @@ http://cal10n.qos.ch/manual.html
EOF
%build
%if %{with plugins}
%{mvn_file} :{*} %{name}/@1
%{mvn_package} :%{base_name}-parent __noinstall
%{mvn_build} -f -- \
-Dproject.build.outputTimestamp=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ) \
-Dsource=8 -Dproject.build.sourceEncoding=ISO-8859-1
%else
mkdir -p lib
build-jar-repository -s lib \
%if %{with tests}
ant-antunit \
build-jar-repository -s lib ant/ant
%{ant} package javadoc
%endif
ant/ant
%{ant} \
%if %{without tests}
-Dtest.skip=true \
%endif
package javadoc
%install
# jars
install -d -m 0755 %{buildroot}%{_javadir}/%{name}
install -m 644 %{name}-api/target/%{name}-api-*.jar \
%{buildroot}%{_javadir}/%{name}/%{name}-api.jar
install -m 644 %{name}-ant-task/target/%{name}-ant-task-*.jar \
%{buildroot}%{_javadir}/%{name}/%{name}-ant-task.jar
# pom
install -d -m 755 %{buildroot}%{_mavenpomdir}
install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom
%add_maven_depmap %{name}.pom
install -pm 644 %{name}-api/pom.xml %{buildroot}%{_mavenpomdir}/%{name}-api.pom
%add_maven_depmap %{name}-api.pom %{name}/%{name}-api.jar
install -pm 644 %{name}-ant-task/pom.xml %{buildroot}%{_mavenpomdir}/%{name}-ant-task.pom
%add_maven_depmap %{name}-ant-task.pom %{name}/%{name}-ant-task.jar
# javadoc
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}
%if %{with plugins}
%mvn_install
%else
install -d -m 0755 %{buildroot}%{_javadir}/%{base_name}
install -d -m 0755 %{buildroot}%{_mavenpomdir}/%{base_name}
install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}
for i in api ant-task; do
# jar
install -m 644 %{base_name}-${i}/target/%{base_name}-${i}-*.jar \
%{buildroot}%{_javadir}/%{base_name}/%{base_name}-${i}.jar
# pom
%{mvn_install_pom} %{base_name}-${i}/pom.xml %{buildroot}%{_mavenpomdir}/%{base_name}/%{base_name}-${i}.pom
%add_maven_depmap %{base_name}/%{base_name}-${i}.pom %{base_name}/%{base_name}-${i}.jar
# javadoc
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}/${i}
cp -pr %{name}-${i}/target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/${i}/
done
%endif
%fdupes -s %{buildroot}%{_javadocdir}/%{name}
%files -f .mfiles
%if %{with plugins}
%files javadoc -f .mfiles-javadoc
%else
%doc README.SUSE
%files javadoc
%{_javadocdir}/%{name}
%endif
%changelog