Skip to content

Commit 7da3ca7

Browse files
authored
Fixes to CI, updates to docs (#1)
### What's done: * Fixed publication not being skipped on not main workers * Updated ROADMAP.md * Updated gradle.properties
1 parent 095382d commit 7da3ca7

File tree

4 files changed

+39
-15
lines changed

4 files changed

+39
-15
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
[![License](https://img.shields.io/github/license/petertrr/kotlin-multiplatform-diff)](https://github.com/petertrr/kotlin-multiplatform-diff/blob/main/LICENSE)
44
[![codecov](https://codecov.io/gh/petertrr/kotlin-multiplatform-diff/branch/main/graph/badge.svg)](https://codecov.io/gh/petertrr/kotlin-multiplatform-diff)
55

6+
[![Releases](https://img.shields.io/github/v/release/petertrr/kotlin-multiplatform-diff)](https://github.com/petertrr/kotlin-multiplatform-diff/releases)
7+
[![Maven Central](https://img.shields.io/maven-central/v/io.github.petertrr/kotlin-multiplatform-diff)](https://mvnrepository.com/artifact/io.github.petertrr)
8+
[![Awesome Kotlin Badge](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin)
9+
610
This is a port of [java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) to kotlin
711
with multiplatform support. All credit for the implementation goes to original authors.
812

@@ -19,4 +23,4 @@ Currently, artifacts for the following platforms are supported:
1923
* JS (both browser and Node.js)
2024
* LinuxX64
2125
* MingwX64
22-
* MacosX64
26+
* MacosX64

ROADMAP.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Library:
2+
* [ ] More kotlin-way API
3+
* [ ] Refactor DiffRowGenerator to use kotlin-dsl-style builder
4+
* [x] Explicit API mode
5+
* [ ] Working with files
6+
* [ ] Binary compatibility validator for JVM
7+
* [ ] Benchmarks on JVM to compare with the original library
8+
9+
Infra:
10+
* [ ] Static analysis (detekt, diktat)
11+
* [ ] Git hooks

buildSrc/src/main/kotlin/io/github/petertrr/PublishingConfiguration.kt

+20-13
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,37 @@ fun Project.configurePublishing() {
3333
}
3434

3535
configurePublications()
36+
37+
if (hasProperty("signingKey")) {
38+
configureSigning()
39+
}
40+
if (hasProperty("sonatypeUsername")) {
41+
configureNexusPublishing()
42+
}
43+
3644
// https://kotlinlang.org/docs/mpp-publish-lib.html#avoid-duplicate-publications
37-
val publicationsFromMainHost = listOf("jvm", "js", "kotlinMultiplatform")
38-
configure<PublishingExtension> {
39-
publications {
40-
matching { it.name in publicationsFromMainHost }.all {
45+
// Publication with name `kotlinMultiplatform` is for the default artifact.
46+
// `configureNexusPublishing` adds sonatype publication tasks inside `afterEvaluate`.
47+
rootProject.afterEvaluate {
48+
val publicationsFromMainHost = listOf("jvm", "js", "linuxX64", "kotlinMultiplatform", "metadata")
49+
configure<PublishingExtension> {
50+
publications.matching { it.name in publicationsFromMainHost }.all {
4151
val targetPublication = this@all
4252
tasks.withType<AbstractPublishToMaven>()
4353
.matching { it.publication == targetPublication }
4454
.configureEach {
4555
onlyIf {
4656
// main publishing CI job is executed on Linux host
47-
DefaultNativePlatform.getCurrentOperatingSystem().isLinux
57+
DefaultNativePlatform.getCurrentOperatingSystem().isLinux.apply {
58+
if (!this) {
59+
logger.lifecycle("Publication ${(it as AbstractPublishToMaven).publication.name} is skipped on current host")
60+
}
61+
}
4862
}
4963
}
50-
}
64+
}
5165
}
5266
}
53-
54-
if (hasProperty("signingKey")) {
55-
configureSigning()
56-
}
57-
if (hasProperty("sonatypeUsername")) {
58-
configureNexusPublishing()
59-
}
6067
}
6168

6269
private fun Project.configurePublications() {

gradle.properties

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
kotlin.code.style=official
2-
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
2+
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
3+
org.gradle.parallel=true
4+
org.gradle.vfs.watch=true

0 commit comments

Comments
 (0)