open-location-code icon indicating copy to clipboard operation
open-location-code copied to clipboard

Kotlin language port - multiplatform

Open apatrida opened this issue 4 years ago • 7 comments

This is a port of the Java code to Kotlin written as a common library so that additional platforms could be supported from the same codebase. It should compile to a common module, and a JVM module. In fact, it runs both common tests and the equivalent original Java tests to ensure that this could also be used from Java as a drop-in replacement API (minus one constructor change that was moved to a factory method, the rest should be API compatible).

Missing is Gradle publishing and making sure all maven artifacts are generated as expected (source, doc, bin jar). Could also add JavaScript tests, and native builds but that requires specific build machines which is more complicated than needed.

apatrida avatar Nov 17 '19 20:11 apatrida

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

googlebot avatar Nov 17 '19 20:11 googlebot

@googlebot I signed it!

apatrida avatar Nov 17 '19 20:11 apatrida

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

googlebot avatar Nov 17 '19 20:11 googlebot

@zongweil Yes, I can leave the Gradle scripts and remove the binaries, it will re-download when someone does a build. I just missed it on the ignore list.

apatrida avatar Nov 18 '19 03:11 apatrida

@zongweil for #2, how to build/call also should consider where we can publish the maven artifacts and get that added to the Gradle build so that the library can just be used as a normal dependency. I can only test that so far since I won't have rights to publish to the maven repo under this group ID.

apatrida avatar Nov 18 '19 03:11 apatrida

Gradle files are removed, now I'm looking at how this should be published to a repo and used.

apatrida avatar Nov 18 '19 17:11 apatrida

I setup publishing to local Maven repo, and this could be extended to public repos if we have specific configuration that can be setup for making this a public artifact. We could also build JavaScript version for Kotlin, and native libraries for Mac, Linux, Windows, and other platforms. But those would require build machines that are capable of building each target.

More about this here:

  • https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html
  • https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven:repositories

apatrida avatar Nov 18 '19 17:11 apatrida