Skip to content

Commit

Permalink
Don't publish core libraries with ij-suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
Walingar committed Oct 10, 2023
1 parent c670b2b commit b1aa4f9
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 36 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ jobs:
java-version: 17
- name: Setup Gradle
run: chmod +x gradlew
- name: Run Gradle
run: ./gradlew publishAllPublicationsToSpaceRepository -Psupported.ij.version=${{ matrix.supported-ij-version }}
- name: Run Jewel Core Publishing
run: ./gradlew publishMainPublicationsToSpaceRepository
env:
MAVEN_SPACE_USERNAME: ${{secrets.MAVEN_SPACE_USERNAME}}
MAVEN_SPACE_PASSWORD: ${{secrets.MAVEN_SPACE_PASSWORD}}
- name: Run Jewel IDE Publishing
run: ./gradlew publishIdeMainPublicationsToSpaceRepository -Psupported.ij.version=${{ matrix.supported-ij-version }}
env:
MAVEN_SPACE_USERNAME: ${{secrets.MAVEN_SPACE_USERNAME}}
MAVEN_SPACE_PASSWORD: ${{secrets.MAVEN_SPACE_PASSWORD}}
35 changes: 35 additions & 0 deletions buildSrc/src/main/kotlin/PublishConfiguration.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@file:Suppress("UnstableApiUsage")

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

internal fun PublishingExtension.configureJewelRepositories() {
repositories {
maven("https://packages.jetbrains.team/maven/p/kpm/public") {
name = "Space"
credentials {
username = System.getenv("MAVEN_SPACE_USERNAME")
password = System.getenv("MAVEN_SPACE_PASSWORD")
}
}
}
}

internal fun MavenPom.configureJewelPom() {
name = "Jewel"
description = "intelliJ theming system in for Compose."
url = "https://github.com/JetBrains/jewel"
licenses {
license {
name = "Apache License 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
scm {
connection = "scm:git:https://github.com/JetBrains/jewel.git"
developerConnection = "scm:git:https://github.com/JetBrains/jewel.git"
url = "https://github.com/JetBrains/jewel"
}
}
43 changes: 43 additions & 0 deletions buildSrc/src/main/kotlin/jewel-ij-publish.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@file:Suppress("UnstableApiUsage")

import SupportedIJVersion.IJ_232
import SupportedIJVersion.IJ_233

plugins {
kotlin("jvm")
`maven-publish`
id("org.jetbrains.dokka")
}

val sourcesJar by tasks.registering(Jar::class) {
from(kotlin.sourceSets.main.map { it.kotlin })
archiveClassifier = "sources"
destinationDirectory = layout.buildDirectory.dir("artifacts")
}

val javadocJar by tasks.registering(Jar::class) {
from(tasks.dokkaHtml)
archiveClassifier = "javadoc"
destinationDirectory = layout.buildDirectory.dir("artifacts")
}

publishing {
configureJewelRepositories()

publications {
register<MavenPublication>("IdeMain") {
from(components["kotlin"])
artifact(javadocJar)
artifact(sourcesJar)
val ijVersionRaw = when (supportedIJVersion()) {
IJ_232 -> "232"
IJ_233 -> "233"
}
version = "${project.version}-ij-$ijVersionRaw"
artifactId = "jewel-${project.name}"
pom {
configureJewelPom()
}
}
}
}
35 changes: 4 additions & 31 deletions buildSrc/src/main/kotlin/jewel-publish.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
@file:Suppress("UnstableApiUsage")

import SupportedIJVersion.IJ_232
import SupportedIJVersion.IJ_233

plugins {
kotlin("jvm")
`maven-publish`
Expand All @@ -22,41 +19,17 @@ val javadocJar by tasks.registering(Jar::class) {
}

publishing {
repositories {
maven("https://packages.jetbrains.team/maven/p/kpm/public") {
name = "Space"
credentials {
username = System.getenv("MAVEN_SPACE_USERNAME")
password = System.getenv("MAVEN_SPACE_PASSWORD")
}
}
}
configureJewelRepositories()

publications {
register<MavenPublication>("main") {
from(components["kotlin"])
artifact(javadocJar)
artifact(sourcesJar)
val ijVersionRaw = when (supportedIJVersion()) {
IJ_232 -> "232"
IJ_233 -> "233"
}
version = "${project.version}-ij-$ijVersionRaw"
version = project.version.toString()
artifactId = "jewel-${project.name}"
pom {
name = "Jewel"
description = "intelliJ theming system in for Compose."
url = "https://github.com/JetBrains/jewel"
licenses {
license {
name = "Apache License 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
scm {
connection = "scm:git:https://github.com/JetBrains/jewel.git"
developerConnection = "scm:git:https://github.com/JetBrains/jewel.git"
url = "https://github.com/JetBrains/jewel"
}
configureJewelPom()
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion ide-laf-bridge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import SupportedIJVersion.*

plugins {
jewel
`jewel-publish`
`jewel-ij-publish`
alias(libs.plugins.composeDesktop)
}

Expand Down
2 changes: 1 addition & 1 deletion ide-laf-bridge/ide-laf-bridge-232/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
jewel
`jewel-publish`
`jewel-ij-publish`
alias(libs.plugins.composeDesktop)
}

Expand Down
2 changes: 1 addition & 1 deletion ide-laf-bridge/ide-laf-bridge-233/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
jewel
`jewel-publish`
`jewel-ij-publish`
alias(libs.plugins.composeDesktop)
}

Expand Down

0 comments on commit b1aa4f9

Please sign in to comment.