Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/api-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
distribution: 'adopt'

- name: Binary Compatibility
run: ./gradlew apiCheck
run: ./gradlew checkLegacyAbi

- name: Documentation
if: success() || failure()
run: ./gradlew dokkaHtml # dokkaHtmlMultiModule doesn't fail undocumented code
run: ./gradlew dokkaGenerate
14 changes: 7 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ on:
branches: [ 'main', '[0-9]+.[0-9]+' ]

env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_PORTAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PORTAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}

jobs:
publish-maven:
Expand Down Expand Up @@ -82,12 +82,12 @@ jobs:
distribution: 'adopt'

- name: Build KDoc
run: ./gradlew dokkaHtmlMultiModule
run: ./gradlew dokkaGenerate

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './build/dokka/htmlMultiModule'
path: './build/dokka/html'

- name: Deploy to GitHub Pages
id: deployment
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Parameterize

[![Maven Central](https://img.shields.io/maven-central/v/com.benwoodworth.parameterize/parameterize-core)](https://central.sonatype.com/artifact/com.benwoodworth.parameterize/parameterize-core)
[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/com.benwoodworth.parameterize/parameterize-core?server=https%3A%2F%2Fs01.oss.sonatype.org)](https://s01.oss.sonatype.org/content/repositories/snapshots/com/benwoodworth/parameterize/parameterize-core)
[![Maven Snapshots](https://img.shields.io/maven-metadata/v?label=maven-snapshots&metadataUrl=https%3A%2F%2Fcentral.sonatype.com%2Frepository%2Fmaven-snapshots%2Fcom%2Fbenwoodworth%2Fparameterize%2Fparameterize-core%2Fmaven-metadata.xml)](https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/com/benwoodworth/parameterize/parameterize-core)
[![KDoc](https://img.shields.io/badge/api-KDoc-blue)](https://benwoodworth.github.io/Parameterize/parameterize-core/com.benwoodworth.parameterize/parameterize.html)
[![Kotlin](https://img.shields.io/badge/kotlin-2.2.0-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-2.2.21-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Slack channel](https://img.shields.io/badge/chat-slack-blue.svg?logo=slack)](https://kotlinlang.slack.com/messages/parameterize/)

Parameterize is a multiplatform Kotlin library introducing a concise, idiomatic style of parameterizing code. Having
Expand Down Expand Up @@ -277,12 +277,12 @@ the need for an extra level of nesting nesting inside the group of tests.
// build.gradle.kts

plugins {
kotlin("jvm") version "2.2.0" // or kotlin("multiplatform"), etc.
kotlin("jvm") version "2.2.21" // or kotlin("multiplatform"), etc.
}

repositories {
mavenCentral()
//maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
//maven("https://central.sonatype.com/repository/maven-snapshots/")
}

dependencies {
Expand Down
16 changes: 3 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask

/*
* Copyright 2024 Ben Woodworth
*
Expand All @@ -24,15 +22,7 @@ repositories {
mavenCentral()
}

tasks.withType<DokkaMultiModuleTask>().configureEach {
doLast {
layout.buildDirectory.asFileTree.asSequence()
.filter { it.isFile && it.extension == "html" }
.forEach { file ->
file.readText()
// Remove "ParameterizeConfiguration." prefix from link text for *Scope classes
.replace(Regex("""(?<=>)ParameterizeConfiguration\.(?=\w+Scope</a>)"""), "")
.let { file.writeText(it) }
}
}
dependencies {
dokka(project(":parameterize-api"))
dokka(project(":parameterize-core"))
}
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ dependencies {

implementation(plugin(libs.plugins.kotlin.multiplatform))
implementation(plugin(libs.plugins.dokka))
implementation(plugin(libs.plugins.binary.compatibility.validator))
implementation(plugin(libs.plugins.vanniktech.maven.publish))
}
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/ci-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ val ciHostTargets = run {
hostTargets[host]!!.asSequence()
}

tasks.create("ciTest") {
tasks.register("ciTest") {
ciHostTargets
.filterIsInstance<KotlinTargetWithTests<*, *>>()
.map { target -> "${target.name}Test" }
Expand All @@ -65,11 +65,11 @@ tasks.create("ciTest") {
}
}

tasks.create("ciPublish") {
tasks.register("ciPublish") {
ciHostTargets
.map { it.name.replaceFirstChar(Char::uppercase) }
.map { if (it == "Metadata") "KotlinMultiplatform" else it }
.map { target -> "publish${target}PublicationToMavenRepository" }
.map { target -> "publish${target}PublicationToMavenCentralRepository" }
.forEach { publishTarget ->
dependsOn(publishTarget)
}
Expand Down
16 changes: 10 additions & 6 deletions buildSrc/src/main/kotlin/dokka-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
* limitations under the License.
*/

import org.jetbrains.dokka.gradle.DokkaTask
import java.net.URL

plugins {
id("org.jetbrains.dokka")
}

tasks.withType<DokkaTask>().configureEach {
dokka {
dokkaPublications.configureEach {
failOnWarning = true
}

dokkaSourceSets.configureEach {
reportUndocumented = true
failOnWarning = true

val releaseVersionRef = version.toString()
.takeIf { version -> version.matches(Regex("""\d+\.\d+\.\d+""")) }
Expand All @@ -33,9 +33,13 @@ tasks.withType<DokkaTask>().configureEach {
if (releaseVersionRef != null) {
sourceLink {
localDirectory = rootDir
remoteUrl = URL("https://github.com/BenWoodworth/Parameterize/tree/$releaseVersionRef")
remoteUrl = uri("https://github.com/BenWoodworth/Parameterize/tree/$releaseVersionRef")
remoteLineSuffix = "#L"
}
}
}
}

dependencies {
dokkaPlugin(project(":dokka-plugin"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import org.gradle.kotlin.dsl.*
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation

// https://github.com/gradle/gradle/issues/15383#issuecomment-1216098405
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
Expand Down Expand Up @@ -97,4 +98,9 @@ kotlin {
}
}
}

@OptIn(ExperimentalAbiValidation::class)
abiValidation {
enabled = true
}
}
87 changes: 23 additions & 64 deletions buildSrc/src/main/kotlin/publishing-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,80 +14,39 @@
* limitations under the License.
*/

val ciVersion: String? = System.getenv("CI_VERSION")

val ossrhUsername: String? = System.getenv("OSSRH_USERNAME")
val ossrhPassword: String? = System.getenv("OSSRH_PASSWORD")

val signingKeyId: String? = System.getenv("SIGNING_KEY_ID")
val signingKey: String? = System.getenv("SIGNING_KEY")
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")

plugins {
`maven-publish`
signing
id("com.vanniktech.maven.publish")
}

if (ciVersion != null) version = ciVersion
val isSnapshot = version.toString().contains("SNAPSHOT", true)

val javadocJar by tasks.registering(Jar::class) {
archiveClassifier = "javadoc"
System.getenv("CI_VERSION")?.let { ciVersion ->
version = ciVersion
}

publishing {
repositories {
maven {
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
url = if (isSnapshot) snapshotsRepoUrl else releasesRepoUrl

credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}

publications.withType<MavenPublication> {
artifact(javadocJar.get())
mavenPublishing {
publishToMavenCentral()
signAllPublications()

pom {
name = "Parameterize"
description = "Kotlin DSL for clean parameterized code"
url = "https://github.com/BenWoodworth/Parameterize"
pom {
name = "Parameterize"
description = "Kotlin DSL for clean parameterized code"
url = "https://github.com/BenWoodworth/Parameterize"

licenses {
license {
name = "The Apache Software License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "BenWoodworth"
name = "Ben Woodworth"
email = "ben@benwoodworth.com"
}
licenses {
license {
name = "The Apache Software License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
scm {
url = "https://github.com/BenWoodworth/Parameterize"
}
developers {
developer {
id = "BenWoodworth"
name = "Ben Woodworth"
email = "ben@benwoodworth.com"
}
}
}
}

signing {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign(publishing.publications)

gradle.taskGraph.whenReady {
isRequired = allTasks.any { it is PublishToMavenRepository }
}

// https://github.com/gradle/gradle/issues/26091#issuecomment-1722947958
tasks.withType<AbstractPublishToMaven>().configureEach {
val signingTasks = tasks.withType<Sign>()
mustRunAfter(signingTasks)
scm {
url = "https://github.com/BenWoodworth/Parameterize"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Ben Woodworth
* Copyright 2025 Ben Woodworth
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,15 +14,14 @@
* limitations under the License.
*/

import kotlinx.validation.ExperimentalBCVApi

plugins {
id("org.jetbrains.kotlinx.binary-compatibility-validator")
kotlin("jvm")
}

repositories {
mavenCentral()
}

apiValidation {
@OptIn(ExperimentalBCVApi::class)
klib {
enabled = true
}
dependencies {
implementation(libs.dokka.core)
}
Loading