From b61004cc86a8c3465965bbb131a899f1a3f20106 Mon Sep 17 00:00:00 2001 From: DinoMarlir <72864666+DinoMarlir@users.noreply.github.com> Date: Fri, 24 May 2024 20:05:31 +0200 Subject: [PATCH] force using java 21 + added mode prompts --- node/build.gradle.kts | 6 ++++++ .../main/kotlin/me/blueamethyst/bluecloud/node/Node.kt | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/node/build.gradle.kts b/node/build.gradle.kts index eb2b7cd..fea70e8 100644 --- a/node/build.gradle.kts +++ b/node/build.gradle.kts @@ -46,4 +46,10 @@ tasks.shadowJar { ) ) } +} + +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(21)) + } } \ No newline at end of file diff --git a/node/src/main/kotlin/me/blueamethyst/bluecloud/node/Node.kt b/node/src/main/kotlin/me/blueamethyst/bluecloud/node/Node.kt index 8fadab4..665a4e5 100644 --- a/node/src/main/kotlin/me/blueamethyst/bluecloud/node/Node.kt +++ b/node/src/main/kotlin/me/blueamethyst/bluecloud/node/Node.kt @@ -18,6 +18,8 @@ import me.blueamethyst.bluecloud.node.utils.generateRandomSecret import me.blueamethyst.bluecloud.node.utils.json import me.blueamethyst.bluecloud.wrapper.Wrapper import java.io.File +import java.util.* +import kotlin.system.exitProcess @InternalBlueCloudApi class Node: AbstractSystemPart(InternalSystemPartType.NODE) { @@ -71,10 +73,10 @@ class Node: AbstractSystemPart(InternalSystemPartType.NODE) { name = "node.json", content = { NodeConfigModel( - id = "", - name = "", + id = UUID.randomUUID().toString(), + name = terminal.terminal.prompt("What is the name of this node?", "Node-1", true) ?: exitProcess(-1), internalWrapperEnabled = true, - otherNodes = emptyList() + otherNodes = terminal.terminal.prompt("What are the other nodes in the cluster? (seperate with ;)")?.split(";")?.map { it.trim() } ?: emptyList() ) } )