Ready for first release
This commit is contained in:
+2
-1
@@ -46,4 +46,5 @@ bin/
|
||||
|
||||
*.db
|
||||
.env
|
||||
.idea/
|
||||
.idea/
|
||||
artifacts/
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
./gradlew :clients:cli:shadowJar
|
||||
./gradlew :clients:compose:createDistributable
|
||||
./gradlew :clients:compose:wasmJsBrowserProductionWebpack
|
||||
./gradlew :server:installDist
|
||||
|
||||
mkdir -p artifacts
|
||||
cp clients/cli/build/libs/phoebench-cli.jar artifacts/
|
||||
|
||||
(cd clients/compose/build/compose/binaries/main/app/com.jaytux.phoebench.clients && zip phoebench-linux.zip -r bin/ lib/)
|
||||
cp clients/compose/build/compose/binaries/main/app/com.jaytux.phoebench.clients/phoebench-linux.zip artifacts/
|
||||
|
||||
mkdir -p artifacts/wasm
|
||||
cp clients/compose/build/kotlin-webpack/wasmJs/productionExecutable/* clients/compose/src/wasmJsMain/resources/* artifacts/wasm
|
||||
(cd artifacts/wasm && zip phoebench-wasm.zip -r ./*)
|
||||
mv artifacts/wasm/phoebench-wasm.zip artifacts/
|
||||
rm -fr artifacts/wasm
|
||||
|
||||
(cd server/build/install/server/ && zip phoebench-server.zip -r bin/ lib/)
|
||||
cp server/build/install/server/phoebench-server.zip artifacts
|
||||
+1
-1
@@ -12,4 +12,4 @@ repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
version = "0.2.0-dev"
|
||||
version = "1.0.0-dev"
|
||||
@@ -1,3 +1,5 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.jvm)
|
||||
application
|
||||
@@ -40,4 +42,8 @@ kotlin {
|
||||
freeCompilerArgs.add("-Xcontext-parameters")
|
||||
optIn.add("kotlin.uuid.ExperimentalUuidApi")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<ShadowJar> {
|
||||
archiveFileName = "phoebench-cli.jar"
|
||||
}
|
||||
@@ -97,6 +97,12 @@ compose.desktop {
|
||||
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
|
||||
packageName = "com.jaytux.phoebench.clients"
|
||||
packageVersion = rootProject.version.toString().split('-')[0]
|
||||
|
||||
jvmArgs += listOf("--enable-native-access=ALL-UNNAMED")
|
||||
includeAllModules = true
|
||||
buildTypes.release.proguard {
|
||||
configurationFiles.from(file("proguard-rules.pro"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
-keep class com.github.javakeyring.** { *; }
|
||||
-dontwarn com.github.javakeyring.**
|
||||
|
||||
-keep class com.sun.jna.** { *; }
|
||||
-dontwarn com.sun.jna.**
|
||||
-keepclassmembers class * extends com.sun.jna.Structure {
|
||||
*** *;
|
||||
}
|
||||
-keepclassmembers class * extends com.sun.jna.Callback {
|
||||
*** *;
|
||||
}
|
||||
+14
-3
@@ -1,3 +1,5 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.jvm)
|
||||
alias(libs.plugins.ktor)
|
||||
@@ -5,7 +7,6 @@ plugins {
|
||||
}
|
||||
|
||||
group = "com.jaytux.phoebench"
|
||||
//version = "1.0-SNAPSHOT"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -65,12 +66,22 @@ kotlin {
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("com.jaytux.phoebench.server.MainKt")
|
||||
mainClass = "io.ktor.server.netty.EngineMain"
|
||||
}
|
||||
|
||||
tasks.withType<Jar> {
|
||||
manifest {
|
||||
attributes["Main-Class"] = application.mainClass
|
||||
}
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
duplicatesStrategy = DuplicatesStrategy.WARN
|
||||
}
|
||||
|
||||
ktor {
|
||||
fatJar {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<ShadowJar> {
|
||||
mergeServiceFiles()
|
||||
append("reference.conf")
|
||||
}
|
||||
@@ -10,7 +10,6 @@ import io.ktor.serialization.kotlinx.json.*
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.auth.*
|
||||
import io.ktor.server.auth.jwt.*
|
||||
import io.ktor.server.netty.*
|
||||
import io.ktor.server.plugins.autohead.*
|
||||
import io.ktor.server.plugins.calllogging.*
|
||||
import io.ktor.server.plugins.contentnegotiation.*
|
||||
@@ -24,12 +23,10 @@ import kotlinx.serialization.json.Json
|
||||
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||
import kotlin.uuid.Uuid
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
DB.db
|
||||
EngineMain.main(args)
|
||||
}
|
||||
|
||||
fun Application.module() {
|
||||
DB.db
|
||||
println("Entering module...")
|
||||
|
||||
install(ContentNegotiation) {
|
||||
json()
|
||||
}
|
||||
@@ -147,22 +144,22 @@ fun Application.module() {
|
||||
|
||||
get("{...}") {
|
||||
println("Fallback for GET ${call.request.path()} triggered.")
|
||||
call.respond(HttpStatusCode.NotFound, ErrorResponse("Could not find ${call.request.path()}"))
|
||||
call.respondText(status = HttpStatusCode.NotFound, text = Json.encodeToString(ErrorResponse("Could not find ${call.request.path()}")), contentType = ContentType.Application.Json)
|
||||
}
|
||||
|
||||
post("{...}") {
|
||||
println("Fallback for POST ${call.request.path()} triggered.")
|
||||
call.respond(HttpStatusCode.NotFound, ErrorResponse("Could not find ${call.request.path()}"))
|
||||
call.respondText(status = HttpStatusCode.NotFound, text = Json.encodeToString(ErrorResponse("Could not find ${call.request.path()}")), contentType = ContentType.Application.Json)
|
||||
}
|
||||
|
||||
delete("{...}") {
|
||||
println("Fallback for DELETE ${call.request.path()} triggered.")
|
||||
call.respond(HttpStatusCode.NotFound, ErrorResponse("Could not find ${call.request.path()}"))
|
||||
call.respondText(status = HttpStatusCode.NotFound, text = Json.encodeToString(ErrorResponse("Could not find ${call.request.path()}")), contentType = ContentType.Application.Json)
|
||||
}
|
||||
|
||||
patch("{...}") {
|
||||
println("Fallback for PATCH ${call.request.path()} triggered.")
|
||||
call.respond(HttpStatusCode.NotFound, ErrorResponse("Could not find ${call.request.path()}"))
|
||||
call.respondText(status = HttpStatusCode.NotFound, text = Json.encodeToString(ErrorResponse("Could not find ${call.request.path()}")), contentType = ContentType.Application.Json)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,23 @@
|
||||
ktor {
|
||||
deployment {
|
||||
port = ${PORT}
|
||||
port = 8080
|
||||
port = ${?PORT}
|
||||
}
|
||||
application {
|
||||
modules = [com.jaytux.phoebench.server.MainKt.module]
|
||||
}
|
||||
jwt {
|
||||
secret = ${JWT_SECRET}
|
||||
issuer = ${JWT_ISSUER}
|
||||
audience = ${JWT_AUDIENCE}
|
||||
realm = ${JWT_REALM}
|
||||
secret = "NO_SECRET_SET!"
|
||||
secret = ${?JWT_SECRET}
|
||||
issuer = "http://0.0.0.0"
|
||||
issuer = ${?JWT_ISSUER}
|
||||
audience = "http://0.0.0.0"
|
||||
audience = ${?JWT_AUDIENCE}
|
||||
realm = "phoebench"
|
||||
realm = ${?JWT_REALM}
|
||||
}
|
||||
cors {
|
||||
enableLocalhostOn = ${PHOEBENCH_DEV_CLIENT_PORT}
|
||||
enableLocalhostOn = ${?PHOEBENCH_DEV_CLIENT_PORT}
|
||||
browserOrigin = ${?PHOEBENCH_SAFE_CLIENT}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user