Skip to content

Commit

Permalink
multi-version: Fix exception thrown when kotlin plugin is not present
Browse files Browse the repository at this point in the history
  • Loading branch information
Johni0702 committed Jun 18, 2024
1 parent 123f1e1 commit 71a4644
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/main/kotlin/gg/essential/multi-version.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,14 @@ fun inheritConfigurationFrom(parent: Project) {
}

afterEvaluate {
tasks.withType<KotlinCompile> {
kotlinOptions {
if (moduleName == null && "-module-name" !in freeCompilerArgs) {
moduleName = project.findProperty("baseArtifactId")?.toString()
?: parentBase?.archivesName?.orNull
?: parent.name.toLowerCase()
pluginManager.withPlugin("kotlin") {
tasks.withType<KotlinCompile> {
kotlinOptions {
if (moduleName == null && "-module-name" !in freeCompilerArgs) {
moduleName = project.findProperty("baseArtifactId")?.toString()
?: parentBase?.archivesName?.orNull
?: parent.name.toLowerCase()
}
}
}
}
Expand Down

0 comments on commit 71a4644

Please sign in to comment.