diff --git a/README.md b/README.md index 7bb02c3..33f62a1 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,12 @@ id `ltd.hlaeja.plugin.hlaeja-common-plugin.library` Default setting and tasks for libraries. +### Plugin Library Manifest + +id `ltd.hlaeja.plugin.hlaeja-common-plugin.library-manifest` + +Extend manifest in library jar file. + ## Releasing plugin Run `release.sh` script from `master` branch. diff --git a/src/main/kotlin/ltd.hlaeja.plugin.hlaeja-common-plugin.library-manifest.gradle.kts b/src/main/kotlin/ltd.hlaeja.plugin.hlaeja-common-plugin.library-manifest.gradle.kts new file mode 100644 index 0000000..07e1aeb --- /dev/null +++ b/src/main/kotlin/ltd.hlaeja.plugin.hlaeja-common-plugin.library-manifest.gradle.kts @@ -0,0 +1,19 @@ +plugins { + id("ltd.hlaeja.plugin.hlaeja-core-plugin") +} + +tasks { + withType().configureEach { + manifest.attributes.apply { + put("Implementation-Title", project.name.split("-").joinToString(" ")) + put("Implementation-Version", project.version) + put("Implementation-Vendor", info.vendorName) + put("Built-By", System.getProperty("user.name")) + put("Built-Git", "${git.currentBranch()} #${git.currentShortHash()}") + put("Built-Gradle", project.gradle.gradleVersion) + put("Built-JDK", System.getProperty("java.version")) + put("Built-OS", "${System.getProperty("os.name")} v${System.getProperty("os.version")}") + put("Built-Time", info.utcTimestamp) + } + } +} diff --git a/src/main/kotlin/ltd.hlaeja.plugin.hlaeja-common-plugin.library.gradle.kts b/src/main/kotlin/ltd.hlaeja.plugin.hlaeja-common-plugin.library.gradle.kts index b5d7240..2da07b9 100644 --- a/src/main/kotlin/ltd.hlaeja.plugin.hlaeja-common-plugin.library.gradle.kts +++ b/src/main/kotlin/ltd.hlaeja.plugin.hlaeja-common-plugin.library.gradle.kts @@ -2,6 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar plugins { id("ltd.hlaeja.plugin.hlaeja-common-plugin.common") + id("ltd.hlaeja.plugin.hlaeja-common-plugin.library-manifest") id("org.springframework.boot") }