Skip to content

Commit

Permalink
Fix publication issues (#435)
Browse files Browse the repository at this point in the history
1. Allow bypassing signing (to test locally)
2. Fix task dependencies
3. Clean up build
  • Loading branch information
rock3r committed Jul 6, 2024
1 parent 8928c77 commit b718ff8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
9 changes: 3 additions & 6 deletions buildSrc/src/main/kotlin/icon-keys-generator.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.JsonNull
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.JsonPrimitive
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
import org.jetbrains.kotlin.gradle.tasks.BaseKotlinCompile
import java.lang.reflect.Field
Expand Down Expand Up @@ -57,6 +58,8 @@ extension.all item@{
tasks {
withType<BaseKotlinCompile> { dependsOn(task) }
withType<Detekt> { dependsOn(task) }
withType<DokkaTask> { dependsOn(task) }
withType<Jar> { dependsOn(task) }
}
}

Expand Down Expand Up @@ -216,12 +219,6 @@ open class IconKeysGeneratorTask : DefaultTask() {
.forEach { field ->
val fieldName = "${parentHolder.name}.${field.name}"

if (field.annotations.isNotEmpty()) {
logger.lifecycle(
"$fieldName -> ${field.annotations.joinToString { it!!.annotationClass.qualifiedName!! }}",
)
}

if (field.annotations.any { it.annotationClass == java.lang.Deprecated::class }) {
logger.lifecycle("Ignoring deprecated field: $fieldName")
return
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/src/main/kotlin/intellij-theme-generator.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.squareup.kotlinpoet.ClassName
import io.gitlab.arturbosch.detekt.Detekt
import org.gradle.util.internal.GUtil
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.jewel.buildlogic.theme.IntelliJThemeGeneratorTask
import org.jetbrains.jewel.buildlogic.theme.ThemeGeneration
import org.jetbrains.jewel.buildlogic.theme.ThemeGeneratorContainer
Expand Down Expand Up @@ -30,6 +31,8 @@ extension.all {
tasks {
withType<BaseKotlinCompile> { dependsOn(task) }
withType<Detekt> { dependsOn(task) }
withType<DokkaTask> { dependsOn(task) }
withType<Jar> { dependsOn(task) }
}

pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
Expand Down
11 changes: 9 additions & 2 deletions buildSrc/src/main/kotlin/jewel-publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,29 @@ val sourcesJar by tasks.registering(Jar::class) {
from(kotlin.sourceSets.main.map { it.kotlin })
archiveClassifier = "sources"
destinationDirectory = layout.buildDirectory.dir("artifacts")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

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

val publishingExtension = extensions.getByType<PublishingExtension>()

signing {
useInMemoryPgpKeys(
System.getenv("PGP_PRIVATE_KEY") ?: properties["signing.privateKey"] as String?,
System.getenv("PGP_PASSWORD")?: properties["signing.password"] as String?
System.getenv("PGP_PASSWORD") ?: properties["signing.password"] as String?
)
sign(publishingExtension.publications)

if (project.hasProperty("no-sign")) {
logger.warn("⚠️ CAUTION! NO-SIGN MODE ENABLED, PUBLICATIONS WON'T BE SIGNED")
} else {
sign(publishingExtension.publications)
}
}

publishing {
Expand Down
13 changes: 0 additions & 13 deletions int-ui/int-ui-standalone/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,3 @@ intelliJThemeGenerator {
ideaVersion = targetIdeaVersion
}
}

tasks {
named("dokkaHtml") {
dependsOn("generateIntUiDarkTheme")
dependsOn("generateIntUiLightTheme")
}

named<Jar>("sourcesJar") {
dependsOn("generateIntUiDarkTheme")
dependsOn("generateIntUiLightTheme")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}

0 comments on commit b718ff8

Please sign in to comment.