Skip to content

Commit

Permalink
Merge pull request #342 from marhali/next
Browse files Browse the repository at this point in the history
Next
  • Loading branch information
marhali authored Dec 8, 2023
2 parents 6f79826 + 70f087b commit a157a92
Show file tree
Hide file tree
Showing 19 changed files with 63 additions and 58 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ jobs:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4

# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/[email protected]

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand Down Expand Up @@ -102,11 +102,11 @@ jobs:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand Down Expand Up @@ -155,18 +155,18 @@ jobs:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17

# Run Qodana inspections
- name: Qodana - Code Inspection
uses: JetBrains/[email protected].1
uses: JetBrains/[email protected].8
with:
cache-default-branch-only: true

Expand All @@ -186,11 +186,11 @@ jobs:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand Down Expand Up @@ -233,11 +233,11 @@ jobs:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ jobs:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

## [Unreleased]

### Added
- Support for all 2023.3 builds (233.*)

### Changed
- Replace deprecated apache commons utils
- Update dependencies

## [4.4.2] - 2023-09-02

### Added
Expand Down
6 changes: 5 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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+.
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
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ pluginGroup = de.marhali.easyi18n
pluginName = easy-i18n
pluginRepositoryUrl = https://github.com/marhali/easy-i18n
# 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
pluginSinceBuild = 223
pluginUntilBuild = 232.*
pluginUntilBuild = 233.*

# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
platformType = IU
platformVersion = 2023.2.1
platformVersion = 2023.3

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# 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
gradleVersion = 8.3
gradleVersion = 8.5

# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
kotlin.stdlib.default.dependency = false
Expand Down
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[versions]
# libraries
annotations = "24.0.1"
annotations = "24.1.0"
json5-java = "2.0.0"

# plugins
kotlin = "1.9.0"
changelog = "2.1.2"
gradleIntelliJPlugin = "1.15.0"
kotlin = "1.9.21"
changelog = "2.2.0"
gradleIntelliJPlugin = "1.16.1"
qodana = "0.1.13"
kover = "0.7.3"
kover = "0.7.5"

[libraries]
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
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
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 7 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# 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 ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# 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" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -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.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
2 changes: 1 addition & 1 deletion qodana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

version: 1.0
linter: jetbrains/qodana-jvm-community:latest
projectJDK: 17
projectJDK: "17"
profile:
name: qodana.recommended
exclude:
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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"
3 changes: 1 addition & 2 deletions src/main/java/de/marhali/easyi18n/io/parser/ArrayMapper.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package de.marhali.easyi18n.io.parser;

import de.marhali.easyi18n.util.StringUtil;

import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.text.StringEscapeUtils;

import java.text.MessageFormat;
import java.util.Iterator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
import de.marhali.easyi18n.model.TranslationNode;
import de.marhali.easyi18n.model.TranslationValue;
import de.marhali.easyi18n.util.StringUtil;

import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.text.StringEscapeUtils;

import java.util.Map;

Expand Down Expand Up @@ -61,7 +60,7 @@ public static void write(String locale, JsonObject json, TranslationNode node) {
if(content != null) {
if(JsonArrayMapper.isArray(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)));
} else {
json.add(key, new JsonPrimitive(StringEscapeUtils.unescapeJava(content)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
import de.marhali.json5.Json5;
import de.marhali.json5.Json5Array;
import de.marhali.json5.Json5Primitive;

import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang3.math.NumberUtils;

import java.io.IOException;

Expand Down Expand Up @@ -40,7 +39,7 @@ public static Json5Array write(String concat) {
} else {
if(StringUtil.isHexString(element)) {
array.add(Json5Primitive.of(element, true));
} else if(NumberUtils.isNumber(element)) {
} else if(NumberUtils.isCreatable(element)) {
array.add(Json5Primitive.of(NumberUtils.createNumber(element)));
} else {
array.add(Json5Primitive.of(element));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
import de.marhali.json5.Json5Element;
import de.marhali.json5.Json5Object;
import de.marhali.json5.Json5Primitive;

import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.text.StringEscapeUtils;

import java.util.Map;

Expand Down Expand Up @@ -61,7 +60,7 @@ public static void write(String locale, Json5Object json, TranslationNode node)
json.add(key, Json5ArrayMapper.write(content));
} else if(StringUtil.isHexString(content)) {
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)));
} else {
json.add(key, Json5Primitive.of(StringEscapeUtils.unescapeJava(content)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
import de.marhali.easyi18n.model.TranslationValue;
import de.marhali.easyi18n.util.KeyPathConverter;
import de.marhali.easyi18n.util.StringUtil;

import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.text.StringEscapeUtils;

import java.util.Map;

Expand Down Expand Up @@ -51,7 +50,7 @@ public static void write(String locale, SortableProperties properties,

if(PropertiesArrayMapper.isArray(content)) {
properties.put(simpleKey, PropertiesArrayMapper.write(content));
} else if(NumberUtils.isNumber(content)) {
} else if(NumberUtils.isCreatable(content)) {
properties.put(simpleKey, NumberUtils.createNumber(content));
} else {
properties.put(simpleKey, StringEscapeUtils.unescapeJava(content));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import de.marhali.easyi18n.model.TranslationNode;
import de.marhali.easyi18n.model.TranslationValue;
import de.marhali.easyi18n.util.StringUtil;

import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.text.StringEscapeUtils;

import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -53,7 +52,7 @@ public static void write(String locale, Map<String, Object> section, Translation
if(content != null) {
if(YamlArrayMapper.isArray(content)) {
section.put(key, YamlArrayMapper.write(content));
} else if(NumberUtils.isNumber(content)) {
} else if(NumberUtils.isCreatable(content)) {
section.put(key, NumberUtils.createNumber(content));
} else {
section.put(key, StringEscapeUtils.unescapeJava(content));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/marhali/easyi18n/util/StringUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static boolean isHexString(@NotNull String 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 skipStrings Should every string literal indication ("", '') be skipped? (Needed e.g. for json)
* @return Escaped string
Expand Down

0 comments on commit a157a92

Please sign in to comment.