diff --git a/README.md b/README.md index 147a5b2..0c84193 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,10 @@ * [Plugin Common Detekt.](#plugin-common-detekt) * [Plugin Common Ktlint.](#plugin-common-ktlint) * [Plugin Common Project.](#plugin-common-project) + * [Library.](#library) + * [Plugin Library.](#plugin-library) + * [Plugin Library Manifest.](#plugin-library-manifest) + * [Plugin Library publish.](#plugin-library-publish) * [Publish gradle plugin locally.](#publish-gradle-plugin-locally) * [Releasing gradle plugin.](#releasing-gradle-plugin) * [Publish gradle plugin to repository.](#publish-gradle-plugin-to-repository) @@ -49,6 +53,26 @@ id `ltd.lulz.plugin.common-plugin.common-project` Display project, Gradle, and Java information. +### Library. + +#### Plugin Library. + +id `ltd.lulz.plugin.common-plugin.library` + +Default setting and tasks for libraries. + +#### Plugin Library Manifest. + +id `ltd.lulz.plugin.common-plugin.library-manifest` + +Extend manifest in library jar file. + +#### Plugin Library publish. + +id `ltd.lulz.plugin.common-plugin.library-publish` + +Configuration for publishing project artifacts to a remote Maven repository. + ## Publish gradle plugin locally. ```shell diff --git a/build.gradle.kts b/build.gradle.kts index 6b6456b..4d6230a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,6 +15,7 @@ dependencies { implementation(aa.plugin.detekt) implementation(aa.plugin.ktlint) implementation(aa.plugin.kotlin) + implementation(aa.plugin.springboot) } description = "Lulz Common Plugin" diff --git a/src/main/kotlin/ltd.lulz.plugin.common-plugin.library-manifest.gradle.kts b/src/main/kotlin/ltd.lulz.plugin.common-plugin.library-manifest.gradle.kts new file mode 100644 index 0000000..d294655 --- /dev/null +++ b/src/main/kotlin/ltd.lulz.plugin.common-plugin.library-manifest.gradle.kts @@ -0,0 +1,18 @@ +plugins { + id("ltd.lulz.plugin.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.lulz.plugin.common-plugin.library-publish.gradle.kts b/src/main/kotlin/ltd.lulz.plugin.common-plugin.library-publish.gradle.kts new file mode 100644 index 0000000..c3d4691 --- /dev/null +++ b/src/main/kotlin/ltd.lulz.plugin.common-plugin.library-publish.gradle.kts @@ -0,0 +1,19 @@ +plugins { + id("ltd.lulz.plugin.core-plugin") + + `maven-publish` +} + +publishing { + repositories { + maven { + url = uri("https://gitea.lulz.ltd/api/packages/aura-ascend/maven") + name = "GiteaPackages" + credentials { + username = config.find("repository.gitea.user", "REPOSITORY_USER") + password = config.find("repository.gitea.token", "REPOSITORY_TOKEN") + } + } + } + publications.register("mavenJava", MavenPublication::class) { from(components["java"]) } +} diff --git a/src/main/kotlin/ltd.lulz.plugin.common-plugin.library.gradle.kts b/src/main/kotlin/ltd.lulz.plugin.common-plugin.library.gradle.kts new file mode 100644 index 0000000..7601f5b --- /dev/null +++ b/src/main/kotlin/ltd.lulz.plugin.common-plugin.library.gradle.kts @@ -0,0 +1,21 @@ +import org.springframework.boot.gradle.tasks.bundling.BootJar + +plugins { + id("ltd.lulz.plugin.common-plugin.common") + id("ltd.lulz.plugin.common-plugin.library-manifest") + id("ltd.lulz.plugin.common-plugin.library-publish") + id("org.springframework.boot") +} + +java { + withSourcesJar() +} + +tasks { + named("jar") { + archiveClassifier.set("") + } + withType { + enabled = false + } +}