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
13 changes: 8 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ on:
push:
tags:
- 'v*'

env:
GPG_SEC: ${{ secrets.PGP_SEC }}
GPG_PASSWORD: ${{ secrets.PGP_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.SONATYPE_USER }}
OSSRH_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
# See https://vanniktech.github.io/gradle-maven-publish-plugin/central for the list of required properties
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ vars.PGP_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.PGP_SEC }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.PGP_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.CENTRAL_PORTAL_USER }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.CENTRAL_PORTAL_PASSWORD }}

jobs:
release:
Expand All @@ -35,4 +38,4 @@ jobs:
with:
gradle-version: wrapper
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- run: ./gradlew publishToSonatype closeSonatypeStagingRepository
- run: ./gradlew publishToMavenCentral
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![License](https://img.shields.io/github/license/petertrr/kotlin-multiplatform-diff)](https://github.com/petertrr/kotlin-multiplatform-diff/blob/main/LICENSE)
[![Maven Central](https://img.shields.io/maven-central/v/io.github.petertrr/kotlin-multiplatform-diff)](https://mvnrepository.com/artifact/io.github.petertrr)
[![Awesome Kotlin Badge](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin)
[![Kotlin](https://img.shields.io/badge/kotlin-2.1.20-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-2.2.21-blue.svg?logo=kotlin)](http://kotlinlang.org)

This is a port of [java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) to Kotlin with multiplatform support.
All credit for the implementation goes to the original authors.
Expand Down
92 changes: 83 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import io.github.petertrr.configurePublishing
import io.github.petertrr.ext.booleanProperty
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest

plugins {
kotlin("multiplatform")
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.dokka)
alias(libs.plugins.detekt)
id("jacoco-convention")
alias(libs.plugins.vanniktech)
jacoco
}

group = "io.github.petertrr"
Expand All @@ -20,10 +20,9 @@ dependencies {

kotlin {
explicitApi()

compilerOptions {
apiVersion = KotlinVersion.KOTLIN_2_1
languageVersion = KotlinVersion.KOTLIN_2_1
apiVersion = KotlinVersion.KOTLIN_2_2
languageVersion = KotlinVersion.KOTLIN_2_2
}

jvm {
Expand Down Expand Up @@ -117,16 +116,91 @@ kotlin {
}
}

configurePublishing()
mavenPublishing {
coordinates(
groupId = project.group.toString(),
artifactId = project.name,
version = project.version.toString(),
)

// Publishing to Maven Central requires the following Gradle properties:
// mavenCentralUsername=central_username
// mavenCentralPassword=central_password
publishToMavenCentral()

// Signing is enabled only if the key is actually provided.
// We do not want missing signing info to block publication to local.
val signingKey = project.providers.gradleProperty("signingInMemoryKey")

if (signingKey.isPresent) {
// Signing requires the following Gradle properties:
// signingInMemoryKeyId=pgp_key_id
// signingInMemoryKey=pgp_key
// signingInMemoryKeyPassword=pgp_key_password
signAllPublications()
}

pom {
name.set(project.name)
description.set(project.description)
url.set("https://github.com/petertrr/kotlin-multiplatform-diff")

licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}

developers {
developer {
id.set("petertrr")
name.set("Petr Trifanov")
email.set("peter.trifanov@gmail.com")
}
}

scm {
url.set("https://github.com/petertrr/kotlin-multiplatform-diff")
connection.set("scm:git:git://github.com/petertrr/kotlin-multiplatform-diff.git")
}
}
}

jacoco {
toolVersion = "0.8.13"
}

detekt {
buildUponDefaultConfig = true
config.setFrom(files("detekt.yml"))
autoCorrect = booleanProperty("detektAutoCorrect", default = true)
autoCorrect = project.providers.gradleProperty("detektAutoCorrect").map(String::toBoolean).getOrElse(true)
}

tasks {
check {
dependsOn(detekt)
}

val jvmTest = named<Test>("jvmTest")
val jacocoReport = register<JacocoReport>("jacocoTestReport") {
dependsOn(jvmTest)

val commonMainSources = kotlin.sourceSets["commonMain"].kotlin.sourceDirectories
val jvmMainSources = kotlin.sourceSets["jvmMain"].kotlin.sourceDirectories

sourceDirectories.setFrom(files(commonMainSources, jvmMainSources))
classDirectories.setFrom(layout.buildDirectory.file("classes/kotlin/jvm/main"))
executionData.setFrom(layout.buildDirectory.files("jacoco/jvmTest.exec"))

reports {
xml.required = true
html.required = true
}
}

jvmTest.configure {
finalizedBy(jacocoReport)
}
}
9 changes: 0 additions & 9 deletions buildSrc/build.gradle.kts

This file was deleted.

13 changes: 0 additions & 13 deletions buildSrc/settings.gradle.kts

This file was deleted.

111 changes: 0 additions & 111 deletions buildSrc/src/main/kotlin/io/github/petertrr/PublishingConfiguration.kt

This file was deleted.

12 changes: 0 additions & 12 deletions buildSrc/src/main/kotlin/io/github/petertrr/ext/Project.ext.kt

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#########################
# Gradle settings
#########################
org.gradle.jvmargs = -Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs = -Xmx4g -XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel = true
org.gradle.caching = true
org.gradle.configuration-cache = false
org.gradle.configuration-cache = true

#########################
# Kotlin settings
Expand Down
14 changes: 6 additions & 8 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
[versions]
kotlin = "2.1.20"
kotlin = "2.2.21"
detekt = "1.23.8"
dokka = "1.9.20"
nexus = "2.0.0"
dokka = "2.1.0"
vanniktech = "0.34.0"

[plugins]
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
vanniktech = { id = "com.vanniktech.maven.publish", version.ref = "vanniktech" }

[libraries]
detekt-formatting = { group = "io.gitlab.arturbosch.detekt", name = "detekt-formatting", version.ref = "detekt" }

# Gradle plugins
kotlin-plugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
dokka-plugin = { group = "org.jetbrains.dokka", name = "dokka-gradle-plugin", version.ref = "dokka" }
nexus-plugin = { group = "io.github.gradle-nexus", name = "publish-plugin", version.ref = "nexus" }
Loading
Loading