From dbf726adf83b4422f3d93a43a99c735202fb7785 Mon Sep 17 00:00:00 2001 From: Sebastiano Poggi Date: Wed, 14 Feb 2024 11:01:58 +0100 Subject: [PATCH] Fix publishing of Markdown artefacts --- buildSrc/src/main/kotlin/PublishConfiguration.kt | 8 +++++++- buildSrc/src/main/kotlin/jewel-publish.gradle.kts | 2 +- markdown/core/build.gradle.kts | 4 ++++ markdown/extension-gfm-alerts/build.gradle.kts | 4 ++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/PublishConfiguration.kt b/buildSrc/src/main/kotlin/PublishConfiguration.kt index 0a57d3887..6a31d6565 100644 --- a/buildSrc/src/main/kotlin/PublishConfiguration.kt +++ b/buildSrc/src/main/kotlin/PublishConfiguration.kt @@ -1,11 +1,13 @@ @file:Suppress("UnstableApiUsage", "UnusedImports") +import org.gradle.api.Project import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.maven.MavenPom import org.gradle.kotlin.dsl.assign import org.gradle.kotlin.dsl.maven +import java.io.File -internal fun PublishingExtension.configureJewelRepositories() { +internal fun PublishingExtension.configureJewelRepositories(project: Project) { repositories { maven("https://packages.jetbrains.team/maven/p/kpm/public") { name = "Space" @@ -14,6 +16,10 @@ internal fun PublishingExtension.configureJewelRepositories() { password = System.getenv("MAVEN_SPACE_PASSWORD") } } + + maven(project.rootProject.layout.buildDirectory.dir("maven-test")) { + name = "LocalTest" + } } } diff --git a/buildSrc/src/main/kotlin/jewel-publish.gradle.kts b/buildSrc/src/main/kotlin/jewel-publish.gradle.kts index af41e53d4..16160db1d 100644 --- a/buildSrc/src/main/kotlin/jewel-publish.gradle.kts +++ b/buildSrc/src/main/kotlin/jewel-publish.gradle.kts @@ -19,7 +19,7 @@ val javadocJar by tasks.registering(Jar::class) { } publishing { - configureJewelRepositories() + configureJewelRepositories(project) publications { register("main") { diff --git a/markdown/core/build.gradle.kts b/markdown/core/build.gradle.kts index 17fe051e3..814394294 100644 --- a/markdown/core/build.gradle.kts +++ b/markdown/core/build.gradle.kts @@ -17,3 +17,7 @@ publicApiValidation { // We don't foresee changes to the data models for now excludedClassRegexes = setOf("org.jetbrains.jewel.markdown.MarkdownBlock.*") } + +publishing.publications.named("main") { + artifactId = "jewel-markdown-${project.name}" +} diff --git a/markdown/extension-gfm-alerts/build.gradle.kts b/markdown/extension-gfm-alerts/build.gradle.kts index bd624c946..94de60c21 100644 --- a/markdown/extension-gfm-alerts/build.gradle.kts +++ b/markdown/extension-gfm-alerts/build.gradle.kts @@ -17,3 +17,7 @@ publicApiValidation { // We don't foresee changes to the data models for now excludedClassRegexes = setOf("org.jetbrains.jewel.markdown.extensions.github.alerts.Alert\\$.*") } + +publishing.publications.named("main") { + artifactId = "jewel-markdown-${project.name}" +}