Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
FWDekker committed Apr 16, 2024
1 parent 420cafa commit f9d436d
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 90 deletions.
16 changes: 9 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ fun properties(key: String) = project.findProperty(key).toString()
plugins {
// Compilation
id("org.jetbrains.kotlin.jvm") version "1.8.0" // Set to latest version compatible with `pluginSinceBuild`, cf. https://plugins.jetbrains.com/docs/intellij/using-kotlin.html#kotlin-standard-library
id("org.jetbrains.intellij") version "1.16.1"
id("org.jetbrains.intellij") version "1.17.3"

// Tests/coverage
id("org.jetbrains.kotlinx.kover") version "0.7.5"
id("org.jetbrains.kotlinx.kover") version "0.7.6"

// Static analysis
id("io.gitlab.arturbosch.detekt") version "1.23.4" // cf. `gradle.properties`
id("io.gitlab.arturbosch.detekt") version "1.23.6" // cf. `gradle.properties`

// Documentation
id("org.jetbrains.changelog") version "2.2.0"
id("org.jetbrains.dokka") version "1.9.10" // cf. `buildscript { dependencies` below and `gradle.properties`
id("org.jetbrains.dokka") version "1.9.20" // cf. `buildscript { dependencies` below and `gradle.properties`
}

buildscript {
dependencies {
classpath("org.jetbrains.dokka", "dokka-base", "1.9.10") // cf. `plugins` above and `gradle.properties`
classpath("org.jetbrains.dokka", "versioning-plugin", "1.9.10") // cf. `plugins` above and `gradle.properties`
classpath("org.jetbrains.dokka", "dokka-base", "1.9.20") // cf. `plugins` above and `gradle.properties`
classpath("org.jetbrains.dokka", "versioning-plugin", "1.9.20") // cf. `plugins` above and `gradle.properties`
}
}

Expand All @@ -45,7 +45,9 @@ repositories {
}

dependencies {
implementation("com.fasterxml.uuid", "java-uuid-generator", properties("uuidGeneratorVersion"))
implementation("com.fasterxml.uuid", "java-uuid-generator", properties("uuidGeneratorVersion")) {
exclude(group = "org.slf4j", module = "slf4j-api") // Logging API is already provided by IDEA platform
}
implementation("com.github.sisyphsu", "dateparser", properties("dateparserVersion")) {
exclude(group = "org.projectlombok", module = "lombok") // cf. https://github.com/sisyphsu/dateparser/issues/30
}
Expand Down
18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
group=com.fwdekker
# Version number should also be updated in `com.fwdekker.randomness.PersistentSettings.Companion.CURRENT_VERSION`.
version=3.2.0
version=3.3.0-dev

# Compatibility
# * `pluginSinceBuild`:
Expand All @@ -13,7 +13,7 @@ version=3.2.0
# See also https://data.services.jetbrains.com/products?fields=name,releases.version,releases.build&code=IC,CL.
pluginSinceBuild=231.0
intellijVersion=2023.1
pluginVerifierIdeVersions=IC-2023.1.5, IC-2023.2.5, IC-2023.3, CL-2023.1.5, CL-2023.2.2, CL-2023.3
pluginVerifierIdeVersions=IC-2023.1.6, IC-2023.2.6, IC-2023.3.6, IC-2024.1.1, CL-2023.1.6, CL-2023.2.3, CL-2023.3.4, CL-2024.1

# Targets
# * Java:
Expand All @@ -33,14 +33,14 @@ kotlinVersion=1.8
# * RgxGen should also be updated in `string.ui.value.pattern_help_url` property in `randomness.properties`.
assertjSwingVersion=3.17.1
dateparserVersion=1.0.11
detektVersion=1.23.3
dokkaVersion=1.9.10
detektVersion=1.23.6
dokkaVersion=1.9.20
githubCore=2.1.5
junitVersion=5.10.1
junitRunnerVersion=1.10.1
kotestVersion=5.8.0
rgxgenVersion=1.4
uuidGeneratorVersion=4.3.0
junitVersion=5.10.2
junitRunnerVersion=1.10.2
kotestVersion=5.8.1
rgxgenVersion=2.0
uuidGeneratorVersion=5.0.0

# Gradle
org.gradle.caching=true
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
2 changes: 1 addition & 1 deletion src/main/kotlin/com/fwdekker/randomness/ErrorReporter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ internal class ErrorReporter : ErrorReportSubmitter() {
/**
* Returns the text that is displayed in the button to report the error.
*/
override fun getReportActionText(): String = Bundle("reporter.report")
override fun getReportActionText() = Bundle("reporter.report")

/**
* Returns the privacy notice text.
Expand Down
30 changes: 15 additions & 15 deletions src/main/kotlin/com/fwdekker/randomness/Icons.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,57 +18,57 @@ object Icons {
/**
* The main icon of Randomness.
*/
val RANDOMNESS = IconLoader.getIcon("/icons/randomness.svg", this.javaClass.classLoader)
val RANDOMNESS get() = IconLoader.getIcon("/icons/randomness.svg", this.javaClass.classLoader)

/**
* The template icon for template icons.
*/
val TEMPLATE = IconLoader.getIcon("/icons/template.svg", this.javaClass.classLoader)
val TEMPLATE get() = IconLoader.getIcon("/icons/template.svg", this.javaClass.classLoader)

/**
* The template icon for scheme icons.
*/
val SCHEME = IconLoader.getIcon("/icons/scheme.svg", this.javaClass.classLoader)
val SCHEME get() = IconLoader.getIcon("/icons/scheme.svg", this.javaClass.classLoader)

/**
* An icon for settings.
*/
val SETTINGS = IconLoader.getIcon("/icons/settings.svg", this.javaClass.classLoader)
val SETTINGS get() = IconLoader.getIcon("/icons/settings.svg", this.javaClass.classLoader)

/**
* A filled-in version of [SETTINGS].
*/
val SETTINGS_FILLED = IconLoader.getIcon("/icons/settings-filled.svg", this.javaClass.classLoader)
val SETTINGS_FILLED get() = IconLoader.getIcon("/icons/settings-filled.svg", this.javaClass.classLoader)

/**
* An icon for arrays.
*/
val ARRAY = IconLoader.getIcon("/icons/array.svg", this.javaClass.classLoader)
val ARRAY get() = IconLoader.getIcon("/icons/array.svg", this.javaClass.classLoader)

/**
* A filled-in version of [ARRAY].
*/
val ARRAY_FILLED = IconLoader.getIcon("/icons/array-filled.svg", this.javaClass.classLoader)
val ARRAY_FILLED get() = IconLoader.getIcon("/icons/array-filled.svg", this.javaClass.classLoader)

/**
* An icon for references.
*/
val REFERENCE = IconLoader.getIcon("/icons/reference.svg", this.javaClass.classLoader)
val REFERENCE get() = IconLoader.getIcon("/icons/reference.svg", this.javaClass.classLoader)

/**
* A filled-in version of [REFERENCE].
*/
val REFERENCE_FILLED = IconLoader.getIcon("/icons/reference-filled.svg", this.javaClass.classLoader)
val REFERENCE_FILLED get() = IconLoader.getIcon("/icons/reference-filled.svg", this.javaClass.classLoader)

/**
* An icon for repeated insertions.
*/
val REPEAT = IconLoader.getIcon("/icons/repeat.svg", this.javaClass.classLoader)
val REPEAT get() = IconLoader.getIcon("/icons/repeat.svg", this.javaClass.classLoader)

/**
* A filled-in version of [REPEAT].
*/
val REPEAT_FILLED = IconLoader.getIcon("/icons/repeat-filled.svg", this.javaClass.classLoader)
val REPEAT_FILLED get() = IconLoader.getIcon("/icons/repeat-filled.svg", this.javaClass.classLoader)
}


Expand Down Expand Up @@ -192,22 +192,22 @@ data class OverlayIcon(val base: Icon, val background: Icon? = null) : Icon {
/**
* Overlay icon for arrays.
*/
val ARRAY by lazy { OverlayIcon(Icons.ARRAY, Icons.ARRAY_FILLED) }
val ARRAY get() = OverlayIcon(Icons.ARRAY, Icons.ARRAY_FILLED)

/**
* Overlay icon for template references.
*/
val REFERENCE by lazy { OverlayIcon(Icons.REFERENCE, Icons.REFERENCE_FILLED) }
val REFERENCE get() = OverlayIcon(Icons.REFERENCE, Icons.REFERENCE_FILLED)

/**
* Overlay icon for repeated insertion.
*/
val REPEAT by lazy { OverlayIcon(Icons.REPEAT, Icons.REPEAT_FILLED) }
val REPEAT get() = OverlayIcon(Icons.REPEAT, Icons.REPEAT_FILLED)

/**
* Overlay icon for settings.
*/
val SETTINGS by lazy { OverlayIcon(Icons.SETTINGS, Icons.SETTINGS_FILLED) }
val SETTINGS get() = OverlayIcon(Icons.SETTINGS, Icons.SETTINGS_FILLED)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/fwdekker/randomness/Scheme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract class Scheme : State() {
* scheme does not represent any kind of data, as is the case for [DecoratorScheme]s.
*/
@get:Transient
open val typeIcon: TypeIcon? get() = null
open val typeIcon: TypeIcon? = null

/**
* The icon signifying this scheme in its entirety, or `null` if it does not have an icon.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ data class DateTimeScheme(
val arrayDecorator: ArrayDecorator = ArrayDecorator(),
) : Scheme() {
override val name = Bundle("datetime.title")
override val typeIcon = BASE_ICON
override val typeIcon get() = BASE_ICON
override val decorators get() = listOf(arrayDecorator)


Expand Down Expand Up @@ -61,11 +61,8 @@ data class DateTimeScheme(
/**
* The base icon for date-times.
*/
val BASE_ICON = TypeIcon(
Icons.SCHEME,
"2:3",
listOf(JBColor(Color(249, 139, 158, 154), Color(249, 139, 158, 154)))
)
val BASE_ICON
get() = TypeIcon(Icons.SCHEME, "2:3", listOf(JBColor(Color(249, 139, 158, 154), Color(249, 139, 158, 154))))

/**
* The default value of the [minDateTime] field.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ data class DecimalScheme(
val arrayDecorator: ArrayDecorator = DEFAULT_ARRAY_DECORATOR,
) : Scheme() {
override val name = Bundle("decimal.title")
override val typeIcon = BASE_ICON
override val typeIcon get() = BASE_ICON
override val decorators get() = listOf(affixDecorator, arrayDecorator)


Expand Down Expand Up @@ -90,11 +90,8 @@ data class DecimalScheme(
/**
* The base icon for decimals.
*/
val BASE_ICON = TypeIcon(
Icons.SCHEME,
"4.2",
listOf(JBColor(Color(98, 181, 67, 154), Color(98, 181, 67, 154)))
)
val BASE_ICON
get() = TypeIcon(Icons.SCHEME, "4.2", listOf(JBColor(Color(98, 181, 67, 154), Color(98, 181, 67, 154))))

/**
* The maximum valid difference between the [minValue] and [maxValue] fields.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ data class IntegerScheme(
) : Scheme() {
@get:Transient
override val name = Bundle("integer.title")
override val typeIcon = BASE_ICON
override val typeIcon get() = BASE_ICON
override val decorators get() = listOf(fixedLengthDecorator, affixDecorator, arrayDecorator)


Expand Down Expand Up @@ -103,11 +103,8 @@ data class IntegerScheme(
/**
* The base icon for integers.
*/
val BASE_ICON = TypeIcon(
Icons.SCHEME,
"123",
listOf(JBColor(Color(64, 182, 224, 154), Color(64, 182, 224, 154)))
)
val BASE_ICON
get() = TypeIcon(Icons.SCHEME, "123", listOf(JBColor(Color(64, 182, 224, 154), Color(64, 182, 224, 154))))

/**
* The default value of the [minValue] field.
Expand Down
15 changes: 6 additions & 9 deletions src/main/kotlin/com/fwdekker/randomness/string/StringScheme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ data class StringScheme(
val arrayDecorator: ArrayDecorator = DEFAULT_ARRAY_DECORATOR,
) : Scheme() {
override val name = Bundle("string.title")
override val typeIcon = BASE_ICON
override val typeIcon get() = BASE_ICON
override val decorators get() = listOf(arrayDecorator)


Expand All @@ -51,7 +51,7 @@ data class StringScheme(
override fun generateUndecoratedStrings(count: Int): List<String> {
val rawStrings =
if (isRegex) {
val rgxGen = RgxGen(pattern)
val rgxGen = RgxGen.parse(pattern)
List(count) {
if (this.isNonMatching) rgxGen.generateNotMatching(random.asJavaRandom())
else rgxGen.generate(random.asJavaRandom())
Expand All @@ -78,8 +78,8 @@ data class StringScheme(
else ->
@Suppress("detekt:TooGenericExceptionCaught") // Consequence of incomplete validation in RgxGen
try {
if (this.isNonMatching) RgxGen(pattern).generate()
else RgxGen(pattern).generateNotMatching()
if (this.isNonMatching) RgxGen.parse(pattern).generate()
else RgxGen.parse(pattern).generateNotMatching()

arrayDecorator.doValidate()
} catch (exception: RgxGenParseException) {
Expand Down Expand Up @@ -107,11 +107,8 @@ data class StringScheme(
/**
* The base icon for strings.
*/
val BASE_ICON = TypeIcon(
Icons.SCHEME,
"abc",
listOf(JBColor(Color(244, 175, 61, 154), Color(244, 175, 61, 154)))
)
val BASE_ICON
get() = TypeIcon(Icons.SCHEME, "abc", listOf(JBColor(Color(244, 175, 61, 154), Color(244, 175, 61, 154))))

/**
* The default value of the [pattern] field.
Expand Down
5 changes: 2 additions & 3 deletions src/main/kotlin/com/fwdekker/randomness/template/Template.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ data class Template(
val schemes: MutableList<Scheme> = DEFAULT_SCHEMES,
val arrayDecorator: ArrayDecorator = DEFAULT_ARRAY_DECORATOR,
) : Scheme() {
override val typeIcon
get() = TypeIcon.combine(schemes.mapNotNull { it.typeIcon }) ?: DEFAULT_ICON
override val typeIcon get() = TypeIcon.combine(schemes.mapNotNull { it.typeIcon }) ?: DEFAULT_ICON
override val decorators get() = listOf(arrayDecorator)

/**
Expand Down Expand Up @@ -105,7 +104,7 @@ data class Template(
/**
* The icon displayed when a template has no schemes.
*/
val DEFAULT_ICON = TypeIcon(Icons.TEMPLATE, "", listOf(Gray._110))
val DEFAULT_ICON get() = TypeIcon(Icons.TEMPLATE, "", listOf(Gray._110))

/**
* The default value of the [name] field.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ data class TemplateReference(
/**
* The base icon for references when the reference is invalid.
*/
val DEFAULT_ICON = TypeIcon(Icons.TEMPLATE, "", listOf(Gray._110))
val DEFAULT_ICON get() = TypeIcon(Icons.TEMPLATE, "", listOf(Gray._110))

/**
* The preset values for the [capitalization] field.
Expand Down
9 changes: 3 additions & 6 deletions src/main/kotlin/com/fwdekker/randomness/uuid/UuidScheme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ data class UuidScheme(
val arrayDecorator: ArrayDecorator = DEFAULT_ARRAY_DECORATOR,
) : Scheme() {
override val name = Bundle("uuid.title")
override val typeIcon = BASE_ICON
override val typeIcon get() = BASE_ICON
override val decorators get() = listOf(affixDecorator, arrayDecorator)


Expand Down Expand Up @@ -86,11 +86,8 @@ data class UuidScheme(
/**
* The base icon for UUIDs.
*/
val BASE_ICON = TypeIcon(
Icons.SCHEME,
"id",
listOf(JBColor(Color(185, 155, 248, 154), Color(185, 155, 248, 154)))
)
val BASE_ICON
get() = TypeIcon(Icons.SCHEME, "id", listOf(JBColor(Color(185, 155, 248, 154), Color(185, 155, 248, 154))))

/**
* The default value of the [version] field.
Expand Down
9 changes: 3 additions & 6 deletions src/main/kotlin/com/fwdekker/randomness/word/WordScheme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ data class WordScheme(
val arrayDecorator: ArrayDecorator = DEFAULT_ARRAY_DECORATOR,
) : Scheme() {
override val name = Bundle("word.title")
override val typeIcon = BASE_ICON
override val typeIcon get() = BASE_ICON
override val decorators get() = listOf(affixDecorator, arrayDecorator)


Expand Down Expand Up @@ -56,11 +56,8 @@ data class WordScheme(
/**
* The base icon for words.
*/
val BASE_ICON = TypeIcon(
Icons.SCHEME,
"cat",
listOf(JBColor(Color(242, 101, 34, 154), Color(242, 101, 34, 154)))
)
val BASE_ICON
get() = TypeIcon(Icons.SCHEME, "cat", listOf(JBColor(Color(242, 101, 34, 154), Color(242, 101, 34, 154))))

/**
* The default value of the [words] field.
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/randomness.properties
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ string.ui.value.header=Value
string.ui.value.is_non_matching_option=&Non-matching
string.ui.value.is_regex_option=Parse as rege&x
string.ui.value.pattern_help=Supported syntax
string.ui.value.pattern_help_url=https://github.com/curious-odd-man/RgxGen/tree/1.4#supported-syntax
string.ui.value.pattern_help_url=https://github.com/curious-odd-man/RgxGen/tree/2.0#supported-syntax
string.ui.value.pattern_option=&Pattern:
string.ui.value.remove_look_alike=&Remove look-alike symbols
string.ui.value.remove_look_alike_help=Removes the following characters from all generated strings: %1$s
Expand Down
Loading

0 comments on commit f9d436d

Please sign in to comment.