Merge pull request #342 from marhali/next

Next
This commit is contained in:
Marcel 2023-12-08 22:39:47 +01:00 committed by GitHub
commit a157a92b7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 63 additions and 58 deletions

View File

@ -34,7 +34,7 @@ jobs:
# Check out current repository # Check out current repository
- name: Fetch Sources - name: Fetch Sources
uses: actions/checkout@v3 uses: actions/checkout@v4
# Validate wrapper # Validate wrapper
- name: Gradle Wrapper Validation - name: Gradle Wrapper Validation
@ -42,7 +42,7 @@ jobs:
# Set up Java environment for the next steps # Set up Java environment for the next steps
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
distribution: zulu distribution: zulu
java-version: 17 java-version: 17
@ -102,11 +102,11 @@ jobs:
# Check out current repository # Check out current repository
- name: Fetch Sources - name: Fetch Sources
uses: actions/checkout@v3 uses: actions/checkout@v4
# Set up Java environment for the next steps # Set up Java environment for the next steps
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
distribution: zulu distribution: zulu
java-version: 17 java-version: 17
@ -155,18 +155,18 @@ jobs:
# Check out current repository # Check out current repository
- name: Fetch Sources - name: Fetch Sources
uses: actions/checkout@v3 uses: actions/checkout@v4
# Set up Java environment for the next steps # Set up Java environment for the next steps
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
distribution: zulu distribution: zulu
java-version: 17 java-version: 17
# Run Qodana inspections # Run Qodana inspections
- name: Qodana - Code Inspection - name: Qodana - Code Inspection
uses: JetBrains/qodana-action@v2023.2.1 uses: JetBrains/qodana-action@v2023.2.8
with: with:
cache-default-branch-only: true cache-default-branch-only: true
@ -186,11 +186,11 @@ jobs:
# Check out current repository # Check out current repository
- name: Fetch Sources - name: Fetch Sources
uses: actions/checkout@v3 uses: actions/checkout@v4
# Set up Java environment for the next steps # Set up Java environment for the next steps
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
distribution: zulu distribution: zulu
java-version: 17 java-version: 17
@ -233,11 +233,11 @@ jobs:
# Check out current repository # Check out current repository
- name: Fetch Sources - name: Fetch Sources
uses: actions/checkout@v3 uses: actions/checkout@v4
# Set up Java environment for the next steps # Set up Java environment for the next steps
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
distribution: zulu distribution: zulu
java-version: 17 java-version: 17

View File

@ -20,13 +20,13 @@ jobs:
# Check out current repository # Check out current repository
- name: Fetch Sources - name: Fetch Sources
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
ref: ${{ github.event.release.tag_name }} ref: ${{ github.event.release.tag_name }}
# Set up Java environment for the next steps # Set up Java environment for the next steps
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
distribution: zulu distribution: zulu
java-version: 17 java-version: 17

View File

@ -33,11 +33,11 @@ jobs:
# Check out current repository # Check out current repository
- name: Fetch Sources - name: Fetch Sources
uses: actions/checkout@v3 uses: actions/checkout@v4
# Set up Java environment for the next steps # Set up Java environment for the next steps
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
distribution: zulu distribution: zulu
java-version: 17 java-version: 17

View File

@ -4,6 +4,13 @@
## [Unreleased] ## [Unreleased]
### Added
- Support for all 2023.3 builds (233.*)
### Changed
- Replace deprecated apache commons utils
- Update dependencies
## [4.4.2] - 2023-09-02 ## [4.4.2] - 2023-09-02
### Added ### Added

View File

@ -29,7 +29,11 @@ dependencies {
// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+. // Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
kotlin { kotlin {
jvmToolchain(17) @Suppress("UnstableApiUsage")
jvmToolchain {
languageVersion = JavaLanguageVersion.of(17)
vendor = JvmVendorSpec.JETBRAINS
}
} }
// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html // Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html

View File

@ -4,22 +4,22 @@ pluginGroup = de.marhali.easyi18n
pluginName = easy-i18n pluginName = easy-i18n
pluginRepositoryUrl = https://github.com/marhali/easy-i18n pluginRepositoryUrl = https://github.com/marhali/easy-i18n
# SemVer format -> https://semver.org # SemVer format -> https://semver.org
pluginVersion = 4.4.2 pluginVersion = 4.4.3
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 223 pluginSinceBuild = 223
pluginUntilBuild = 232.* pluginUntilBuild = 233.*
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
platformType = IU platformType = IU
platformVersion = 2023.2.1 platformVersion = 2023.3
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22 # Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins = org.jetbrains.kotlin, JavaScript, com.jetbrains.php:232.9559.64 platformPlugins = org.jetbrains.kotlin, JavaScript, com.jetbrains.php:233.11799.241
# Gradle Releases -> https://github.com/gradle/gradle/releases # Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion = 8.3 gradleVersion = 8.5
# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib # Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
kotlin.stdlib.default.dependency = false kotlin.stdlib.default.dependency = false

View File

@ -1,14 +1,14 @@
[versions] [versions]
# libraries # libraries
annotations = "24.0.1" annotations = "24.1.0"
json5-java = "2.0.0" json5-java = "2.0.0"
# plugins # plugins
kotlin = "1.9.0" kotlin = "1.9.21"
changelog = "2.1.2" changelog = "2.2.0"
gradleIntelliJPlugin = "1.15.0" gradleIntelliJPlugin = "1.16.1"
qodana = "0.1.13" qodana = "0.1.13"
kover = "0.7.3" kover = "0.7.5"
[libraries] [libraries]
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" } annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }

Binary file not shown.

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

14
gradlew vendored
View File

@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #( case $MAX_FD in #(
max*) max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045 # shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) || MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit" warn "Could not query maximum file descriptor limit"
esac esac
@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #( '' | soft) :;; #(
*) *)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045 # shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" || ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD" warn "Could not set maximum file descriptor limit to $MAX_FD"
esac esac
@ -202,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command; # Collect all arguments for the java command:
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# shell script including quotes and variable substitutions, so put them in # and any embedded shellness will be escaped.
# double quotes to make sure that they get re-expanded; and # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# * put everything else in single quotes, so that it's not re-expanded. # treated as '${Hostname}' itself on the command line.
set -- \ set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \ "-Dorg.gradle.appname=$APP_BASE_NAME" \

View File

@ -3,7 +3,7 @@
version: 1.0 version: 1.0
linter: jetbrains/qodana-jvm-community:latest linter: jetbrains/qodana-jvm-community:latest
projectJDK: 17 projectJDK: "17"
profile: profile:
name: qodana.recommended name: qodana.recommended
exclude: exclude:

View File

@ -1,5 +1,5 @@
plugins { plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.6.0" id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
} }
rootProject.name = "easy-i18n" rootProject.name = "easy-i18n"

View File

@ -1,8 +1,7 @@
package de.marhali.easyi18n.io.parser; package de.marhali.easyi18n.io.parser;
import de.marhali.easyi18n.util.StringUtil; import de.marhali.easyi18n.util.StringUtil;
import org.apache.commons.text.StringEscapeUtils;
import org.apache.commons.lang.StringEscapeUtils;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.Iterator; import java.util.Iterator;

View File

@ -7,9 +7,8 @@ import com.google.gson.JsonPrimitive;
import de.marhali.easyi18n.model.TranslationNode; import de.marhali.easyi18n.model.TranslationNode;
import de.marhali.easyi18n.model.TranslationValue; import de.marhali.easyi18n.model.TranslationValue;
import de.marhali.easyi18n.util.StringUtil; import de.marhali.easyi18n.util.StringUtil;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.text.StringEscapeUtils;
import org.apache.commons.lang.math.NumberUtils;
import java.util.Map; import java.util.Map;
@ -61,7 +60,7 @@ public class JsonMapper {
if(content != null) { if(content != null) {
if(JsonArrayMapper.isArray(content)) { if(JsonArrayMapper.isArray(content)) {
json.add(key, JsonArrayMapper.write(content)); json.add(key, JsonArrayMapper.write(content));
} else if(NumberUtils.isNumber(content)) { } else if(NumberUtils.isCreatable(content)) {
json.add(key, new JsonPrimitive(NumberUtils.createNumber(content))); json.add(key, new JsonPrimitive(NumberUtils.createNumber(content)));
} else { } else {
json.add(key, new JsonPrimitive(StringEscapeUtils.unescapeJava(content))); json.add(key, new JsonPrimitive(StringEscapeUtils.unescapeJava(content)));

View File

@ -5,8 +5,7 @@ import de.marhali.easyi18n.util.StringUtil;
import de.marhali.json5.Json5; import de.marhali.json5.Json5;
import de.marhali.json5.Json5Array; import de.marhali.json5.Json5Array;
import de.marhali.json5.Json5Primitive; import de.marhali.json5.Json5Primitive;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.lang.math.NumberUtils;
import java.io.IOException; import java.io.IOException;
@ -40,7 +39,7 @@ public class Json5ArrayMapper extends ArrayMapper {
} else { } else {
if(StringUtil.isHexString(element)) { if(StringUtil.isHexString(element)) {
array.add(Json5Primitive.of(element, true)); array.add(Json5Primitive.of(element, true));
} else if(NumberUtils.isNumber(element)) { } else if(NumberUtils.isCreatable(element)) {
array.add(Json5Primitive.of(NumberUtils.createNumber(element))); array.add(Json5Primitive.of(NumberUtils.createNumber(element)));
} else { } else {
array.add(Json5Primitive.of(element)); array.add(Json5Primitive.of(element));

View File

@ -6,9 +6,8 @@ import de.marhali.easyi18n.util.StringUtil;
import de.marhali.json5.Json5Element; import de.marhali.json5.Json5Element;
import de.marhali.json5.Json5Object; import de.marhali.json5.Json5Object;
import de.marhali.json5.Json5Primitive; import de.marhali.json5.Json5Primitive;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.text.StringEscapeUtils;
import org.apache.commons.lang.math.NumberUtils;
import java.util.Map; import java.util.Map;
@ -61,7 +60,7 @@ public class Json5Mapper {
json.add(key, Json5ArrayMapper.write(content)); json.add(key, Json5ArrayMapper.write(content));
} else if(StringUtil.isHexString(content)) { } else if(StringUtil.isHexString(content)) {
json.add(key, Json5Primitive.of(content, true)); json.add(key, Json5Primitive.of(content, true));
} else if(NumberUtils.isNumber(content)) { } else if(NumberUtils.isCreatable(content)) {
json.add(key, Json5Primitive.of(NumberUtils.createNumber(content))); json.add(key, Json5Primitive.of(NumberUtils.createNumber(content)));
} else { } else {
json.add(key, Json5Primitive.of(StringEscapeUtils.unescapeJava(content))); json.add(key, Json5Primitive.of(StringEscapeUtils.unescapeJava(content)));

View File

@ -5,9 +5,8 @@ import de.marhali.easyi18n.model.KeyPath;
import de.marhali.easyi18n.model.TranslationValue; import de.marhali.easyi18n.model.TranslationValue;
import de.marhali.easyi18n.util.KeyPathConverter; import de.marhali.easyi18n.util.KeyPathConverter;
import de.marhali.easyi18n.util.StringUtil; import de.marhali.easyi18n.util.StringUtil;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.text.StringEscapeUtils;
import org.apache.commons.lang.math.NumberUtils;
import java.util.Map; import java.util.Map;
@ -51,7 +50,7 @@ public class PropertiesMapper {
if(PropertiesArrayMapper.isArray(content)) { if(PropertiesArrayMapper.isArray(content)) {
properties.put(simpleKey, PropertiesArrayMapper.write(content)); properties.put(simpleKey, PropertiesArrayMapper.write(content));
} else if(NumberUtils.isNumber(content)) { } else if(NumberUtils.isCreatable(content)) {
properties.put(simpleKey, NumberUtils.createNumber(content)); properties.put(simpleKey, NumberUtils.createNumber(content));
} else { } else {
properties.put(simpleKey, StringEscapeUtils.unescapeJava(content)); properties.put(simpleKey, StringEscapeUtils.unescapeJava(content));

View File

@ -3,9 +3,8 @@ package de.marhali.easyi18n.io.parser.yaml;
import de.marhali.easyi18n.model.TranslationNode; import de.marhali.easyi18n.model.TranslationNode;
import de.marhali.easyi18n.model.TranslationValue; import de.marhali.easyi18n.model.TranslationValue;
import de.marhali.easyi18n.util.StringUtil; import de.marhali.easyi18n.util.StringUtil;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.text.StringEscapeUtils;
import org.apache.commons.lang.math.NumberUtils;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -53,7 +52,7 @@ public class YamlMapper {
if(content != null) { if(content != null) {
if(YamlArrayMapper.isArray(content)) { if(YamlArrayMapper.isArray(content)) {
section.put(key, YamlArrayMapper.write(content)); section.put(key, YamlArrayMapper.write(content));
} else if(NumberUtils.isNumber(content)) { } else if(NumberUtils.isCreatable(content)) {
section.put(key, NumberUtils.createNumber(content)); section.put(key, NumberUtils.createNumber(content));
} else { } else {
section.put(key, StringEscapeUtils.unescapeJava(content)); section.put(key, StringEscapeUtils.unescapeJava(content));

View File

@ -24,7 +24,7 @@ public class StringUtil {
/** /**
* Escapes control characters for the given input string. * Escapes control characters for the given input string.
* Inspired by Apache Commons (see {@link org.apache.commons.lang.StringEscapeUtils} * Inspired by Apache Commons (see {@link org.apache.commons.text.StringEscapeUtils}
* @param input The input string * @param input The input string
* @param skipStrings Should every string literal indication ("", '') be skipped? (Needed e.g. for json) * @param skipStrings Should every string literal indication ("", '') be skipped? (Needed e.g. for json)
* @return Escaped string * @return Escaped string