add plugin service process resource

This commit is contained in:
2024-11-01 19:47:12 +00:00
parent 3c0962d559
commit 53b87f6bc4
3 changed files with 32 additions and 0 deletions

View File

@@ -86,6 +86,12 @@ Adding intellij support `src/integration-test/java`, `src/integration-test/kotli
Adding dependencies support `integrationTestImplementation()`, and `integrationTestRuntimeOnly()` as part of Gradle. Adding dependencies support `integrationTestImplementation()`, and `integrationTestRuntimeOnly()` as part of Gradle.
### Plugin Service Process Resource
id `ltd.hlaeja.plugin.hlaeja-common-plugin.service-process-resource`
Assign values to `application.yml` from Gradle.
## Releasing plugin ## Releasing plugin
Run `release.sh` script from `master` branch. Run `release.sh` script from `master` branch.

View File

@@ -0,0 +1,25 @@
import org.gradle.kotlin.dsl.support.uppercaseFirstChar
plugins {
id("ltd.hlaeja.plugin.hlaeja-core-plugin")
}
tasks {
withType<ProcessResources> {
filesMatching("**/application.yml") {
filter {
it.replace(
"%APP_NAME%",
project.name.split("-").joinToString(" ") { word -> word.uppercaseFirstChar() },
)
}
filter { it.replace("%APP_VERSION%", project.version as String) }
filter { it.replace("%APP_BUILD_TIME%", info.utcTimestamp) }
filter { it.replace("%APP_BUILD_OS_NAME%", System.getProperty("os.name")) }
filter { it.replace("%APP_BUILD_OS_VERSION%", System.getProperty("os.version")) }
filter { it.replace("%APP_BUILD_GIT_COMMIT%", git.currentShortHash()) }
filter { it.replace("%APP_BUILD_GIT_BRANCH%", git.currentBranch()) }
}
onlyIf { file("src/main/resources/application.yml").exists() }
}
}

View File

@@ -2,4 +2,5 @@ plugins {
id("ltd.hlaeja.plugin.hlaeja-common-plugin.common") id("ltd.hlaeja.plugin.hlaeja-common-plugin.common")
id("ltd.hlaeja.plugin.hlaeja-common-plugin.service-container") id("ltd.hlaeja.plugin.hlaeja-common-plugin.service-container")
id("ltd.hlaeja.plugin.hlaeja-common-plugin.service-integration-test") id("ltd.hlaeja.plugin.hlaeja-common-plugin.service-integration-test")
id("ltd.hlaeja.plugin.hlaeja-common-plugin.service-process-resource")
} }