Skip to content

Commit

Permalink
Fix missing group in default mainClassName
Browse files Browse the repository at this point in the history
  • Loading branch information
srnyx committed Aug 24, 2024
1 parent fca81af commit 0a25f0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/main/kotlin/xyz/srnyx/gradlegalaxy/utility/Scripts.kt
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ fun Project.addCompilerArgs(vararg args: String) {
/**
* Sets the main class for the project
*
* @param mainClassName The main class name to set, defaults to "[getPackage].[Project.getName]"
* @param mainClassName The main class name to set, uses "[getPackage].[Project.getName]" if null
*/
fun Project.setMainClass(mainClassName: String = "${getPackage()}.${project.name}") {
fun Project.setMainClass(mainClassName: String? = null) {
check(hasApplicationPlugin()) { "Application plugin is not applied!" }
extensions.configure<JavaApplication>("application") { mainClass.set(mainClassName) }
extensions.configure<JavaApplication>("application") { mainClass.set(mainClassName ?: "${getPackage()}.${project.name}") }
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/xyz/srnyx/gradlegalaxy/utility/Setups.kt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ fun Project.setupJda(
version: String = project.version.toString(),
description: String? = project.description,
javaVersion: JavaVersion? = null,
mainClassName: String = "${getPackage()}.${project.name}",
mainClassName: String? = null,
textEncoding: String? = "UTF-8",
archiveClassifier: String? = "",
): ExternalModuleDependency {
Expand Down Expand Up @@ -180,7 +180,7 @@ fun Project.setupLazyLibrary(
version: String = project.version.toString(),
description: String? = project.description,
javaVersion: JavaVersion? = null,
mainClassName: String = "${getPackage()}.${project.name}",
mainClassName: String? = null,
textEncoding: String? = "UTF-8",
archiveClassifier: String? = "",
): ExternalModuleDependency {
Expand Down

0 comments on commit 0a25f0f

Please sign in to comment.