Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump Kotlin to 1.9.23, enable additional Kotlin Multiplatform targets #15

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

aSemy
Copy link
Collaborator

@aSemy aSemy commented Mar 26, 2024

hey @ethauvin 👋

@krzema12 and I would like to enable more Kotlin Multiplatform targets in https://github.com/krzema12/snakeyaml-engine-kmp, so we can support as many Kotlin targets as possible. snakeyaml-engine-kmp depends on urlencoder, so would you be

Summary

  • Update Kotlin to 1.9.23 (The Kotlin languageVersion is still set to 1.6, so there's no change in the library's ABI)
  • Adds additional Kotlin Multiplatform targets
  • Tidies the Kotlin Multiplatform source sets, thanks to the new hierarchy structure.
  • Bumps the Node version used by Kotlin Multiplatform, which is required for Wasm support.
  • Refactors urlencoder-app to remove the Java Application plugin (this is no longer compatible with KGP), and instead use KGP's new mainRun {} function.

Testing

I have manually tested the urlencoder-app executable JAR urlencoder-1.4.0-all.jar, and it works as expected.

Running the tests for all Kotlin Multiplatform targets requires a Mac with all of the XCode simulators installed.

@aSemy aSemy requested a review from ethauvin March 26, 2024 20:11
Comment on lines 46 to 55
val fatJar by registering(Jar::class) {
group = LifecycleBasePlugin.BUILD_GROUP
dependsOn.addAll(listOf("compileJava", "compileKotlinJvm", "processResources"))
archiveClassifier.set("all")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest { attributes(mapOf("Main-Class" to application.mainClass)) }
from(sourceSets.main.get().output)
manifest { attributes(mapOf("Main-Class" to urlEncoderMainClass)) }
from(sourceSets.main.map { it.output })
dependsOn(configurations.jvmRuntimeClasspath)
from(configurations.jvmRuntimeClasspath.map { classpath ->
classpath.incoming.artifacts.artifactFiles.files.filter { it.name.endsWith("jar") }.map { zipTree(it) }
classpath.filter { it.name.endsWith(".jar") }.map { zipTree(it) }
})
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are some unrelated tidying, to make the config a bit neater, and make it more Gradle idiomatic.

@ethauvin ethauvin merged commit 8890fef into master Mar 26, 2024
10 checks passed
@ethauvin
Copy link
Owner

@aSemy Thanks.

Is there a need to update the GitHub workflows to include the new targets? If so, would you mind doing it? I'll be able to publish a new version then.

@aSemy
Copy link
Collaborator Author

aSemy commented Mar 26, 2024

Oh, good question, I didn't think about that.

The publishing requirements should be simpler, because now KGP will automatically skip targets that aren't available.

That said, I think the Workflows can be made much simpler: macOS can publish all targets, so we just need to run ./gradlew publish on a macos-latest runner. And that should Just Work. (Although we'll need to disable any sort of parallelization, because Maven Central can't handle fast uploads.)

@ethauvin
Copy link
Owner

@aSemy I gave it a shot, but I'm getting errors. Do you mind taking a look at it? Maybe I missed something.

@aSemy aSemy deleted the feat/enable-kotlin-targets branch March 27, 2024 11:01
@aSemy
Copy link
Collaborator Author

aSemy commented Mar 27, 2024

@aSemy I gave it a shot, but I'm getting errors. Do you mind taking a look at it? Maybe I missed something.

Sure thing!

I can see this error in the log:

* What went wrong:
Execution failed for task ':urlencoder-app:publishJvmPublicationToOssrhRepository'.
> Failed to publish publication 'jvm' to repository 'ossrh'
   > Invalid publication 'jvm': supplied artifactId (urlencoder-app-jvm) does not match value from POM file (urlencoder-app). Cannot edit artifactId directly in the POM file.

I suspect it might be something to do with the custom POM location.

withType<GenerateMavenPom> {
destination = file("$projectDir/pom.xml")
}

There are multiple artifacts, each with their own POM, and if all POMs get set to the same location, maybe Gradle is accidentally picking the wrong ones.

I'll make a PR that removes it, and do some misc tidying.

@ethauvin
Copy link
Owner

@aSemy Thanks again.

I just published a new snapshot, no errors. A lot more targets.

Take a look at it and let me know if that works for you, and I'll publish a new release.

@aSemy
Copy link
Collaborator Author

aSemy commented Mar 27, 2024

Thanks very much @ethauvin!

@ethauvin
Copy link
Owner

@aSemy 1.5.0 has been published.

krzema12 referenced this pull request in krzema12/snakeyaml-engine-kmp Mar 28, 2024
#149)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[net.thauvin.erik.urlencoder:urlencoder-lib](https://togithub.com/ethauvin/urlencoder)
| `1.4.0` -> `1.5.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/net.thauvin.erik.urlencoder:urlencoder-lib/1.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/net.thauvin.erik.urlencoder:urlencoder-lib/1.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/net.thauvin.erik.urlencoder:urlencoder-lib/1.4.0/1.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/net.thauvin.erik.urlencoder:urlencoder-lib/1.4.0/1.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>ethauvin/urlencoder
(net.thauvin.erik.urlencoder:urlencoder-lib)</summary>

###
[`v1.5.0`](https://togithub.com/ethauvin/urlencoder/releases/tag/1.5.0)

[Compare
Source](https://togithub.com/ethauvin/urlencoder/compare/1.4.0...1.5.0)

#### Summary

- Updated Kotlin to 1.9.24 (The Kotlin `languageVersion` is still set to
1.6, so there's no change in the library's ABI.)
-   Added additional Kotlin Multiplatform targets.
- Tidied the Kotlin Multiplatform source sets, thanks to the [new
hierarchy
structure](https://kotlinlang.org/docs/multiplatform-hierarchy.html).
- Bumped the Node version used by Kotlin Multiplatform, which is
required for Wasm support.
- Refactored urlencoder-app to remove the Java Application plugin (this
is no longer compatible with KGP), and instead use KGP's new `mainRun
{}` function.

#### What's Changed

- add Java tests for verifying `@JvmStatic` by
[@&#8203;aSemy](https://togithub.com/aSemy) in
[https://github.com/ethauvin/urlencoder/pull/14](https://togithub.com/ethauvin/urlencoder/pull/14)
- bump Kotlin to 1.9.23, enable additional Kotlin Multiplatform targets
by [@&#8203;aSemy](https://togithub.com/aSemy) in
[https://github.com/ethauvin/urlencoder/pull/15](https://togithub.com/ethauvin/urlencoder/pull/15)
- Bumped Gradle to version 8.7 by
[@&#8203;ethauvin](https://togithub.com/ethauvin) in
ethauvin/urlencoder@a689c56
- Bumped Dokka to version 1.9.20 by
[@&#8203;ethauvin](https://togithub.com/ethauvin) in
ethauvin/urlencoder@b59d01e
- bump version to 1.5.0-SNAPSHOT by
[@&#8203;aSemy](https://togithub.com/aSemy) in
[https://github.com/ethauvin/urlencoder/pull/16](https://togithub.com/ethauvin/urlencoder/pull/16)
- Reworked GitHub workflows by
[@&#8203;ethauvin](https://togithub.com/ethauvin) in
ethauvin/urlencoder@1ef2045
- Tidy publishing config by [@&#8203;aSemy](https://togithub.com/aSemy)
in
[https://github.com/ethauvin/urlencoder/pull/17](https://togithub.com/ethauvin/urlencoder/pull/17)

**Full Changelog**:
ethauvin/urlencoder@1.4.0...1.5.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/krzema12/snakeyaml-engine-kmp).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants