From 4f0efb0429a1d0efb298df23f2481ab5ee45301d Mon Sep 17 00:00:00 2001 From: DinoMarlir <72864666+DinoMarlir@users.noreply.github.com> Date: Sun, 3 Sep 2023 20:58:08 +0200 Subject: [PATCH] created cloudsystem-modulefactory gradle module --- cloudsystem-modulefactory/.gitignore | 42 +++++++++++++++++++ cloudsystem-modulefactory/build.gradle.kts | 22 ++++++++++ .../modulefactory/AbstractCloudModule.java | 7 ++++ .../modulefactory/ModuleFactory.kt | 11 +++++ .../modulefactory/models/CloudModuleConfig.kt | 11 +++++ settings.gradle.kts | 1 + 6 files changed, 94 insertions(+) create mode 100644 cloudsystem-modulefactory/.gitignore create mode 100644 cloudsystem-modulefactory/build.gradle.kts create mode 100644 cloudsystem-modulefactory/src/main/java/tech/marlonr/cloudsystem/modulefactory/AbstractCloudModule.java create mode 100644 cloudsystem-modulefactory/src/main/kotlin/tech/marlonr/cloudsystem/modulefactory/ModuleFactory.kt create mode 100644 cloudsystem-modulefactory/src/main/kotlin/tech/marlonr/cloudsystem/modulefactory/models/CloudModuleConfig.kt diff --git a/cloudsystem-modulefactory/.gitignore b/cloudsystem-modulefactory/.gitignore new file mode 100644 index 0000000..b63da45 --- /dev/null +++ b/cloudsystem-modulefactory/.gitignore @@ -0,0 +1,42 @@ +.gradle +build/ +!gradle/wrapper/gradle-wrapper.jar +!**/src/main/**/build/ +!**/src/test/**/build/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/cloudsystem-modulefactory/build.gradle.kts b/cloudsystem-modulefactory/build.gradle.kts new file mode 100644 index 0000000..76bede9 --- /dev/null +++ b/cloudsystem-modulefactory/build.gradle.kts @@ -0,0 +1,22 @@ +plugins { + id("java") + kotlin("jvm") version "1.9.0" + kotlin("plugin.serialization") version "1.9.0" +} + +group = "tech.marlonr" +version = "1.0-SNAPSHOT" + +repositories { + mavenCentral() +} + +dependencies { + implementation("org.projectlombok:lombok:1.18.26") + implementation("org.jetbrains:annotations:24.0.0") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0-RC") +} + +tasks.test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/cloudsystem-modulefactory/src/main/java/tech/marlonr/cloudsystem/modulefactory/AbstractCloudModule.java b/cloudsystem-modulefactory/src/main/java/tech/marlonr/cloudsystem/modulefactory/AbstractCloudModule.java new file mode 100644 index 0000000..0c3ac34 --- /dev/null +++ b/cloudsystem-modulefactory/src/main/java/tech/marlonr/cloudsystem/modulefactory/AbstractCloudModule.java @@ -0,0 +1,7 @@ +package tech.marlonr.cloudsystem.modulefactory; + +public abstract class AbstractCloudModule { + + abstract void startup(); + abstract void shutdown(); +} diff --git a/cloudsystem-modulefactory/src/main/kotlin/tech/marlonr/cloudsystem/modulefactory/ModuleFactory.kt b/cloudsystem-modulefactory/src/main/kotlin/tech/marlonr/cloudsystem/modulefactory/ModuleFactory.kt new file mode 100644 index 0000000..44884ba --- /dev/null +++ b/cloudsystem-modulefactory/src/main/kotlin/tech/marlonr/cloudsystem/modulefactory/ModuleFactory.kt @@ -0,0 +1,11 @@ +package tech.marlonr.cloudsystem.modulefactory + +import java.io.File + +class ModuleFactory( + private val moduleFolder: File +) { + fun initialize() { + if (!moduleFolder.exists()) moduleFolder.mkdirs() + } +} \ No newline at end of file diff --git a/cloudsystem-modulefactory/src/main/kotlin/tech/marlonr/cloudsystem/modulefactory/models/CloudModuleConfig.kt b/cloudsystem-modulefactory/src/main/kotlin/tech/marlonr/cloudsystem/modulefactory/models/CloudModuleConfig.kt new file mode 100644 index 0000000..c100df1 --- /dev/null +++ b/cloudsystem-modulefactory/src/main/kotlin/tech/marlonr/cloudsystem/modulefactory/models/CloudModuleConfig.kt @@ -0,0 +1,11 @@ +package tech.marlonr.cloudsystem.modulefactory.models + +import kotlinx.serialization.Serializable + +@Serializable +data class CloudModuleConfig( + val name: String, + val version: String, + val authors: List, + val mainClass: String +) \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 458f4b5..e02e787 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,3 +4,4 @@ include("cloudsystem-api") include("cloudsystem-manager") include("cloudsystem-node") include("cloudsystem-library") +include("cloudsystem-modulefactory")