Skip to content

Commit

Permalink
fix info-root plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
makeevrserg committed Jun 11, 2024
1 parent fe9fff6 commit 6188d25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,13 @@ package ru.astrainteractive.gradleplugin

import org.gradle.api.Plugin
import org.gradle.api.Project
import ru.astrainteractive.gradleplugin.property.extension.ModelPropertyValueExt.hierarchyGroup
import ru.astrainteractive.gradleplugin.property.extension.ModelPropertyValueExt.requireProjectInfo

class InfoRootPlugin : Plugin<Project> {
override fun apply(target: Project) {
val projectInfo = target.requireProjectInfo
if (target.rootProject.group.toString().isEmpty()) {
target.rootProject.group = projectInfo.group
}
if (target.group.toString().isEmpty()) {
target.group = target.hierarchyGroup
}
if (target.version.toString().isEmpty()) {
target.version = projectInfo.versionString
}
if (target.description.isNullOrBlank()) {
target.description = projectInfo.description
}
target.group = projectInfo.group
target.version = projectInfo.versionString
target.description = projectInfo.description
}
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project-description = "GradlePlugin for my kotlin projects"
project-group = "ru.astrainteractive.gradleplugin"
project-web = "https://github.com/makeevrserg/gradle-plugin"
project-version-code = "4"
project-version-string = "1.3.1"
project-version-string = "1.3.2"
# Kotlin
kotlin-version = "2.0.0" # https://github.com/JetBrains/kotlin
kotlin-dokka = "1.9.20" # https://github.com/Kotlin/dokka
Expand Down

0 comments on commit 6188d25

Please sign in to comment.