Enum Class CodeCollectorSystem

java.lang.Object
java.lang.Enum<CodeCollectorSystem>
net.regsirius06.engine.generator.CodeCollectorSystem
All Implemented Interfaces:
Serializable, Comparable<CodeCollectorSystem>, Constable

public enum CodeCollectorSystem extends Enum<CodeCollectorSystem>
An enum that represents different build systems (e.g., Gradle, Gradle Kotlin DSL).

CodeCollectorSystem is responsible for providing the required text content for the project configuration files based on the build system. It can generate text for build scripts, settings files, Java code, and other resources used in the project generation process.

  • Enum Constant Details

    • GRADLE

      public static final CodeCollectorSystem GRADLE
      Gradle build system using Groovy DSL.
    • GRADLE_KTS

      public static final CodeCollectorSystem GRADLE_KTS
      Gradle build system using Kotlin DSL.
  • Method Details

    • values

      public static CodeCollectorSystem[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CodeCollectorSystem valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • get

      public static CodeCollectorSystem get(String name) throws IllegalArgumentException
      Returns the corresponding CodeCollectorSystem enum for the given name.
      Parameters:
      name - The name of the build system (e.g., "gradle").
      Returns:
      The corresponding CodeCollectorSystem enum.
      Throws:
      IllegalArgumentException - If no matching enum is found.
    • getFileText

      public List<String> getFileText(String projectGroup, String projectVersion, String nameJar) throws RuntimeException
      Retrieves the file text for the build configuration files based on the selected build system.
      Parameters:
      projectGroup - The project group (e.g., "com.example").
      projectVersion - The project version (e.g., "1.0.0").
      nameJar - The name of the JAR file to be included in the project.
      Returns:
      A list of strings representing the file content.
      Throws:
      RuntimeException - If an error occurs while reading the file content.
    • getMainFileText

      public static List<String> getMainFileText(String className) throws RuntimeException
      Retrieves the text for the main Java file based on the project class name.
      Parameters:
      className - The name of the main class (e.g., "MyPlugin").
      Returns:
      A list of strings representing the content of the main file.
      Throws:
      RuntimeException - If an error occurs while reading the file content.
    • getHelpFileText

      public static List<String> getHelpFileText() throws RuntimeException
      Retrieves the text for the help file.
      Returns:
      A list of strings representing the content of the help file.
      Throws:
      RuntimeException - If an error occurs while reading the file content.
    • getGradlewFileText

      public static List<String> getGradlewFileText(boolean bat) throws RuntimeException
      Retrieves the text for the Gradle wrapper script.
      Parameters:
      bat - A boolean flag indicating whether to return the Windows (.bat) version or not.
      Returns:
      A list of strings representing the content of the Gradle wrapper script.
      Throws:
      RuntimeException - If an error occurs while reading the file content.
    • getGradlewFileName

      @Contract(pure=true) @NotNull public static @NotNull String getGradlewFileName(boolean bat)
      Returns the name of the Gradle wrapper script based on the operating system.
      Parameters:
      bat - A boolean flag indicating whether to return the Windows (.bat) version or not.
      Returns:
      The name of the Gradle wrapper script.
    • getBuildName

      @Contract(pure=true) @NotNull public @NotNull String getBuildName()
      Returns the name of the build script file for the selected build system.
      Returns:
      The build script file name (e.g., "build.gradle" or "build.gradle.kts").
    • getSettingsName

      @Contract(pure=true) @NotNull public @NotNull String getSettingsName()
      Returns the name of the settings script file for the selected build system.
      Returns:
      The settings script file name (e.g., "settings.gradle" or "settings.gradle.kts").
    • getGroupPath

      @Contract(pure=true) @NotNull public static @NotNull String getGroupPath(@NotNull @NotNull String projectGroup)
      Returns the path to the source directory for a given project group.
      Parameters:
      projectGroup - The project group (e.g., "com.example").
      Returns:
      The path to the source directory.
    • getJavaFilePath

      @Contract(pure=true) @NotNull public static @NotNull String getJavaFilePath(String projectGroup, String nameFile)
      Returns the path to a specific Java file in the source directory.
      Parameters:
      projectGroup - The project group (e.g., "com.example").
      nameFile - The name of the file (e.g., "Main").
      Returns:
      The path to the Java file.
    • pathInMainRoot

      @Contract("_ -> new") @NotNull public static @NotNull String pathInMainRoot(String name)
      Returns the path for a given directory in the `src/main` root.
      Parameters:
      name - The name of the directory or file.
      Returns:
      The full path relative to the `src/main` directory.