Skip to content

Commit

Permalink
Update settings, build, gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandru committed Apr 8, 2024
1 parent 447d443 commit 060bff3
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 25 deletions.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ dependencies {
implementation(libs.arrow.core)
implementation(libs.arrow.fx.coroutines)
implementation(libs.arrow.fx.stm)
implementation(libs.arrow.suspendapp)
implementation(libs.clikt)
implementation(libs.commons.codec)
implementation(libs.commons.text)
implementation(libs.kaml)
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.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,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 +57,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
5 changes: 4 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencyResolutionManagement {
create("libs") {
version("arrow", "1.2.4")
version("buildToolsNative", "0.10.1")
version("clikt", "4.3.0")
version("commonsCodec", "1.16.1")
version("commonsText", "1.11.0")
version("kaml", "0.58.0")
Expand Down Expand Up @@ -76,9 +77,11 @@ dependencyResolutionManagement {
.versionRef("kaml")
library("logback-classic", "ch.qos.logback", "logback-classic")
.versionRef("logback")
library("clikt", "com.github.ajalt.clikt", "clikt")
.versionRef("clikt")

plugin("graalvm-buildtools-native", "org.graalvm.buildtools.native")
.versionRef("buildToolsNative")
}
}
}
}
30 changes: 17 additions & 13 deletions src/main/kotlin/org/alexn/hook/Main.kt
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
package org.alexn.hook

import kotlinx.cli.ArgParser
import kotlinx.cli.ArgType
import kotlinx.coroutines.runBlocking
import arrow.continuations.SuspendApp
import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.parameters.arguments.argument
import java.io.File

fun main(args: Array<String>) {
val parser = ArgParser(programName = "github-webhook-listener")
val configPath by parser.argument(
ArgType.String,
fullName = "config-path",
description = "Path to the application configuration",
)
class RunServer : CliktCommand(
name = "github-webhook-listener",
help = "Start the server",
) {
val configPath by argument(help = "Path to the application configuration")

override fun run() =
SuspendApp {
val config = AppConfig.parseYaml(File(configPath))
startServer(config)
}
}

parser.parse(args)
val config = AppConfig.parseYaml(File(configPath))
runBlocking { startServer(config) }
fun main(args: Array<String>) {
RunServer().main(args)
}

0 comments on commit 060bff3

Please sign in to comment.