google / open-location-code

Open Location Code is a library to generate short codes, called "plus codes", that can be used as digital addresses where street addresses don't exist.
https://plus.codes
Apache License 2.0
4.06k stars 472 forks source link

Kotlin language port - multiplatform #366

Open apatrida opened 4 years ago

apatrida commented 4 years ago

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.

googlebot commented 4 years ago

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.

apatrida commented 4 years ago

@googlebot I signed it!

googlebot commented 4 years ago

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

apatrida commented 4 years ago

@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 commented 4 years ago

@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 commented 4 years ago

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

apatrida commented 4 years ago

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: