Skip to content

Commit

Permalink
deps: version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
janniclas committed Nov 7, 2024
1 parent 58bb358 commit 6874e86
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 64 deletions.
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[versions]
kotlin = "2.0.20"
kotlin = "2.0.21"
kotlinxSerialization = "1.7.3"
kotlinCli = "4.4.0"
kotlinCli = "5.0.1"
kotlinLogging = "7.0.0"
simpleLogger = "2.0.14"
koinDI = "3.5.6"
mockk = "1.13.12"
koinDI = "4.0.0"
mockk = "1.13.13"
jimfs = "1.3.0"
apache-commoms = "3.17.0"
junit = "5.11.0"
ktfmt = "0.20.1"
junit = "5.11.3"
ktfmt = "0.21.0"
versions = "0.51.0"
sphaVersion = "0.0.3"

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.10.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
91 changes: 46 additions & 45 deletions src/main/kotlin/de/fraunhofer/iem/spha/cli/Main.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package de.fraunhofer.iem.spha.cli

import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.NoOpCliktCommand
import com.github.ajalt.clikt.core.Context
import com.github.ajalt.clikt.core.main
import com.github.ajalt.clikt.core.subcommands
import com.github.ajalt.clikt.parameters.options.flag
import com.github.ajalt.clikt.parameters.options.option
Expand All @@ -18,42 +19,42 @@ import org.koin.dsl.module
import org.slf4j.simple.SimpleLogger

internal val appModules = module {
single<RawKpiTransformer> { Tool2RawKpiTransformer() }
single<FileSystem> { FileSystems.getDefault() }
single<RawKpiTransformer> { Tool2RawKpiTransformer() }
single<FileSystem> { FileSystems.getDefault() }
}

fun main(args: Array<String>) {
startKoin { modules(appModules) }
startKoin { modules(appModules) }

try {
MainSphaToolCommand().subcommands(TransformToolResultCommand()).main(args)
} catch (e: Exception) {
val logger = KotlinLogging.logger {}
logger.error(e, { e.message })
exitProcess(1)
}
try {
MainSphaToolCommand().subcommands(TransformToolResultCommand()).main(args)
} catch (e: Exception) {
val logger = KotlinLogging.logger {}
logger.error(e, { e.message })
exitProcess(1)
}
}

/**
* The Main command of this application. Supports a global switch to enable verbose logging mode.
*/
private class MainSphaToolCommand : NoOpCliktCommand() {
private class MainSphaToolCommand : CliktCommand() {

val verbose by
option(
"--verbose",
"-v",
help = "When set, the application provides detailed logging. Default is unset.",
)
.flag()
val verbose by
option(
"--verbose",
"-v",
help = "When set, the application provides detailed logging. Default is unset.",
)
.flag()

override fun run() {
configureLogging()
}
override fun run() {
configureLogging()
}

private fun configureLogging() {
if (verbose) System.setProperty(SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "TRACE")
}
private fun configureLogging() {
if (verbose) System.setProperty(SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "TRACE")
}
}

/**
Expand All @@ -64,26 +65,26 @@ private class MainSphaToolCommand : NoOpCliktCommand() {
* switch is independent to the first switch. This will cause confusion for users, which switch to
* use.
*/
internal abstract class SphaToolCommandBase(name: String? = null, help: String = "") :
CliktCommand(name = name, help = help), KoinComponent {
// NB: Needs to be lazy, as otherwise we initialize this variable before setting the logger
// configuration.
private val _lazyLogger = lazy { KotlinLogging.logger {} }
protected val Logger
get() = _lazyLogger.value
internal abstract class SphaToolCommandBase(name: String? = null, val help: String = "") :
CliktCommand(name = name), KoinComponent {
override fun help(context: Context) = help

val strict by
option(
"--strict",
help =
"When set, the application is less tolerant to unknown input formats. Default is unset.",
)
.flag()
// NB: Needs to be lazy, as otherwise we initialize this variable before setting the logger
// configuration.
private val _lazyLogger = lazy { KotlinLogging.logger {} }
protected val Logger
get() = _lazyLogger.value

override fun run() {
Logger.trace {
"Original command arguments: '${currentContext.originalArgv.joinToString()}}'"
}
Logger.debug { "Running command: $commandName" }
}
val strict by
option(
"--strict",
help =
"When set, the application is less tolerant to unknown input formats. Default is unset.",
)
.flag()

override fun run() {
Logger.trace { "Original command arguments: '${currentContext.originalArgv.joinToString()}}'" }
Logger.debug { "Running command: $commandName" }
}
}

0 comments on commit 6874e86

Please sign in to comment.