From 7f51bf6b6d8a22ba6b1267181ec340522dd61485 Mon Sep 17 00:00:00 2001 From: Peter Trifanov Date: Sat, 13 Mar 2021 17:39:08 +0300 Subject: [PATCH 1/3] Develop ### What's done: * Added ROADMAP.md and fixme comments --- README.md | 2 ++ ROADMAP.md | 11 +++++++++++ .../io/github/petertrr/PublishingConfiguration.kt | 4 +++- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 ROADMAP.md diff --git a/README.md b/README.md index 82e891d..6b0cf61 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ ![Build and test](https://github.com/petertrr/kotlin-multiplatform-diff/workflows/Build%20and%20test/badge.svg) [![License](https://img.shields.io/github/license/petertrr/kotlin-multiplatform-diff)](https://github.com/petertrr/kotlin-multiplatform-diff/blob/main/LICENSE) [![codecov](https://codecov.io/gh/petertrr/kotlin-multiplatform-diff/branch/main/graph/badge.svg)](https://codecov.io/gh/petertrr/kotlin-multiplatform-diff) +Todo: badge from maven central +Todo: badge for awesome kotlin 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 original authors. diff --git a/ROADMAP.md b/ROADMAP.md new file mode 100644 index 0000000..aeedb5c --- /dev/null +++ b/ROADMAP.md @@ -0,0 +1,11 @@ +Library: +* [ ] More kotlin-way + * [ ] Refactor DiffRowGenerator to use kotlin-dsl-style builder +* [x] Explicit API mode +* [ ] Binary compatibility validator for JVM +* [ ] Benchmarks on JVM to compare with the original library + +Infra: +* [ ] Static analysis (detekt, diktat) +* [ ] Git hooks +* [ ] Main CI worker depends on other two, executes task closeAndReleaseSonatypeStagingRepository if everything is successful \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/io/github/petertrr/PublishingConfiguration.kt b/buildSrc/src/main/kotlin/io/github/petertrr/PublishingConfiguration.kt index a164308..36fe74e 100644 --- a/buildSrc/src/main/kotlin/io/github/petertrr/PublishingConfiguration.kt +++ b/buildSrc/src/main/kotlin/io/github/petertrr/PublishingConfiguration.kt @@ -34,7 +34,9 @@ fun Project.configurePublishing() { configurePublications() // https://kotlinlang.org/docs/mpp-publish-lib.html#avoid-duplicate-publications - val publicationsFromMainHost = listOf("jvm", "js", "kotlinMultiplatform") + // publication with name `kotlinMultiplatform` is for the default artifact + // fixme: doesn't work as expected + val publicationsFromMainHost = listOf("jvm", "js", "linuxX64", "kotlinMultiplatform", "metadata") configure { publications { matching { it.name in publicationsFromMainHost }.all { From 72ee22e413f28f3281e92e8299a8d2c873155ba1 Mon Sep 17 00:00:00 2001 From: Peter Trifanov Date: Sat, 13 Mar 2021 19:06:32 +0300 Subject: [PATCH 2/3] Update README.md --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6b0cf61..22d286a 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,10 @@ ![Build and test](https://github.com/petertrr/kotlin-multiplatform-diff/workflows/Build%20and%20test/badge.svg) [![License](https://img.shields.io/github/license/petertrr/kotlin-multiplatform-diff)](https://github.com/petertrr/kotlin-multiplatform-diff/blob/main/LICENSE) [![codecov](https://codecov.io/gh/petertrr/kotlin-multiplatform-diff/branch/main/graph/badge.svg)](https://codecov.io/gh/petertrr/kotlin-multiplatform-diff) -Todo: badge from maven central -Todo: badge for awesome kotlin + +[![Releases](https://img.shields.io/github/v/release/petertrr/kotlin-multiplatform-diff)](https://github.com/petertrr/kotlin-multiplatform-diff/releases) +[![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) 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 original authors. @@ -21,4 +23,4 @@ Currently, artifacts for the following platforms are supported: * JS (both browser and Node.js) * LinuxX64 * MingwX64 -* MacosX64 \ No newline at end of file +* MacosX64 From 1ce546c341629d365542760814b6ced1975d6ffa Mon Sep 17 00:00:00 2001 From: petertr Date: Sun, 14 Mar 2021 16:53:45 +0300 Subject: [PATCH 3/3] Fixes to publication, update to docs ### What's done: * Fixed publication not being skipped on not main workers * Updated ROADMAP.md * Updated gradle.properties --- ROADMAP.md | 6 ++-- .../petertrr/PublishingConfiguration.kt | 35 +++++++++++-------- gradle.properties | 4 ++- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index aeedb5c..2f97914 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,11 +1,11 @@ Library: -* [ ] More kotlin-way +* [ ] More kotlin-way API * [ ] Refactor DiffRowGenerator to use kotlin-dsl-style builder * [x] Explicit API mode +* [ ] Working with files * [ ] Binary compatibility validator for JVM * [ ] Benchmarks on JVM to compare with the original library Infra: * [ ] Static analysis (detekt, diktat) -* [ ] Git hooks -* [ ] Main CI worker depends on other two, executes task closeAndReleaseSonatypeStagingRepository if everything is successful \ No newline at end of file +* [ ] Git hooks \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/io/github/petertrr/PublishingConfiguration.kt b/buildSrc/src/main/kotlin/io/github/petertrr/PublishingConfiguration.kt index 36fe74e..ba3554e 100644 --- a/buildSrc/src/main/kotlin/io/github/petertrr/PublishingConfiguration.kt +++ b/buildSrc/src/main/kotlin/io/github/petertrr/PublishingConfiguration.kt @@ -33,32 +33,37 @@ fun Project.configurePublishing() { } configurePublications() + + if (hasProperty("signingKey")) { + configureSigning() + } + if (hasProperty("sonatypeUsername")) { + configureNexusPublishing() + } + // https://kotlinlang.org/docs/mpp-publish-lib.html#avoid-duplicate-publications - // publication with name `kotlinMultiplatform` is for the default artifact - // fixme: doesn't work as expected - val publicationsFromMainHost = listOf("jvm", "js", "linuxX64", "kotlinMultiplatform", "metadata") - configure { - publications { - matching { it.name in publicationsFromMainHost }.all { + // Publication with name `kotlinMultiplatform` is for the default artifact. + // `configureNexusPublishing` adds sonatype publication tasks inside `afterEvaluate`. + rootProject.afterEvaluate { + val publicationsFromMainHost = listOf("jvm", "js", "linuxX64", "kotlinMultiplatform", "metadata") + configure { + publications.matching { it.name in publicationsFromMainHost }.all { val targetPublication = this@all tasks.withType() .matching { it.publication == targetPublication } .configureEach { onlyIf { // main publishing CI job is executed on Linux host - DefaultNativePlatform.getCurrentOperatingSystem().isLinux + DefaultNativePlatform.getCurrentOperatingSystem().isLinux.apply { + if (!this) { + logger.lifecycle("Publication ${(it as AbstractPublishToMaven).publication.name} is skipped on current host") + } + } } } - } + } } } - - if (hasProperty("signingKey")) { - configureSigning() - } - if (hasProperty("sonatypeUsername")) { - configureNexusPublishing() - } } private fun Project.configurePublications() { diff --git a/gradle.properties b/gradle.properties index 5c4eaf8..b2251a6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,4 @@ kotlin.code.style=official -org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 \ No newline at end of file +org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +org.gradle.parallel=true +org.gradle.vfs.watch=true \ No newline at end of file