diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e89e240..59c8635 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,6 +35,9 @@ jobs: - name: Publish JS release run: ./gradlew publishJsPublicationToOSSRHRepository + - name: Delete GnuPG data + run: rm -rfv $HOME/.gnupg + publish-linux: runs-on: ubuntu-latest steps: diff --git a/buildSrc/src/main/kotlin/buildsrc/conventions/publishing.gradle.kts b/buildSrc/src/main/kotlin/buildsrc/conventions/publishing.gradle.kts index 660d4b1..5952514 100644 --- a/buildSrc/src/main/kotlin/buildsrc/conventions/publishing.gradle.kts +++ b/buildSrc/src/main/kotlin/buildsrc/conventions/publishing.gradle.kts @@ -31,7 +31,7 @@ publishing { withType().configureEach { pom { name.set("UrlEncoder for Kotlin Multiplatform") - description.set("A simple defensive library to encode/decode URL components") + description.set(project.description) url.set(mavenUrl) licenses { license { diff --git a/urlencoder-app/build.gradle.kts b/urlencoder-app/build.gradle.kts index 93a9789..c5fe1df 100644 --- a/urlencoder-app/build.gradle.kts +++ b/urlencoder-app/build.gradle.kts @@ -9,6 +9,9 @@ plugins { id("com.github.ben-manes.versions") } +description = "A simple defensive application to encode/decode URL components" + +val deployDir = project.layout.projectDirectory.dir("deploy") val urlEncoderMainClass = "net.thauvin.erik.urlencoder.UrlEncoder" kotlin { @@ -60,9 +63,28 @@ tasks { dependsOn(fatJar) } + clean { + delete(deployDir) + } + withType().configureEach { dokkaSourceSets.configureEach { moduleName.set("UrlEncoder Application") } } + + val copyToDeploy by registering(Sync::class) { + group = PublishingPlugin.PUBLISH_TASK_GROUP + from(configurations.jvmRuntimeClasspath) { + exclude("annotations-*.jar") + } + from(jvmJar) + into(deployDir) + } + + register("deploy") { + description = "Copies all needed files to the 'deploy' directory." + group = PublishingPlugin.PUBLISH_TASK_GROUP + dependsOn(build, copyToDeploy) + } } diff --git a/urlencoder-lib/build.gradle.kts b/urlencoder-lib/build.gradle.kts index a05acf5..f922e29 100644 --- a/urlencoder-lib/build.gradle.kts +++ b/urlencoder-lib/build.gradle.kts @@ -8,6 +8,10 @@ plugins { id("com.github.ben-manes.versions") } +description = "A simple defensive library to encode/decode URL components" + +val deployDir = project.layout.projectDirectory.dir("deploy") + kotlin { sourceSets { commonTest { @@ -24,6 +28,11 @@ base { } tasks { + + clean { + delete(deployDir) + } + dokkaJavadoc { dokkaSourceSets { configureEach { @@ -43,4 +52,19 @@ tasks { moduleName.set("UrlEncoder Library") } } + + val copyToDeploy by registering(Sync::class) { + group = PublishingPlugin.PUBLISH_TASK_GROUP + from(configurations.runtimeClasspath) { + exclude("annotations-*.jar") + } + from(jvmJar) + into(deployDir) + } + + register("deploy") { + description = "Copies all needed files to the 'deploy' directory." + group = PublishingPlugin.PUBLISH_TASK_GROUP + dependsOn(build, copyToDeploy) + } }