Package net.regsirius06.engine.generator
Enum Class CodeCollectorSystem
- All Implemented Interfaces:
Serializable,Comparable<CodeCollectorSystem>,Constable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionGradle build system using Groovy DSL.Gradle build system using Kotlin DSL. -
Method Summary
Modifier and TypeMethodDescriptionstatic CodeCollectorSystemReturns the correspondingCodeCollectorSystemenum for the given name.@NotNull StringReturns the name of the build script file for the selected build system.getFileText(String projectGroup, String projectVersion, String nameJar) Retrieves the file text for the build configuration files based on the selected build system.static @NotNull StringgetGradlewFileName(boolean bat) Returns the name of the Gradle wrapper script based on the operating system.getGradlewFileText(boolean bat) Retrieves the text for the Gradle wrapper script.static @NotNull StringgetGroupPath(@NotNull String projectGroup) Returns the path to the source directory for a given project group.Retrieves the text for the help file.static @NotNull StringgetJavaFilePath(String projectGroup, String nameFile) Returns the path to a specific Java file in the source directory.getMainFileText(String className) Retrieves the text for the main Java file based on the project class name.@NotNull StringReturns the name of the settings script file for the selected build system.static @NotNull StringpathInMainRoot(String name) Returns the path for a given directory in the `src/main` root.static CodeCollectorSystemReturns the enum constant of this class with the specified name.static CodeCollectorSystem[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
GRADLE
Gradle build system using Groovy DSL. -
GRADLE_KTS
Gradle build system using Kotlin DSL.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
get
Returns the correspondingCodeCollectorSystemenum for the given name.- Parameters:
name- The name of the build system (e.g., "gradle").- Returns:
- The corresponding
CodeCollectorSystemenum. - 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
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
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
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
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
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
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
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.
-