AlexHeyman / TiledReader

A simple Java library for reading Tiled files
https://www.alexheyman.org/tiledreader/
BSD 3-Clause "New" or "Revised" License
6 stars 3 forks source link

Maven/Bintray coords? #2

Closed adorokhine closed 4 years ago

adorokhine commented 4 years ago

Hi,

I would love to use this project as libtiled-java is so out of date, but I can't find any maven repo that contains it. Is it available for use somewhere? If so could you document how to link against it in maven or gradle?

Thanks!

AlexHeyman commented 4 years ago

TiledReader is currently only available as a source download from this GitHub repo, and as a pre-built JAR + source download from http://www.alexheyman.org/tiledreader/. (That second download is a slightly older version, which is different only in that it requires JavaFX.)

I haven't personally used Maven (or Gradle, or Bintray), but if TiledReader being easily compatible with Maven would help a lot of people, then I can look into how to make that happen. For now, if you want to add TiledReader to your Maven project, you can download or build its JAR locally, and then manually add it as a dependency.

adorokhine commented 4 years ago

Yes please!! Adding a dependency onto a project in bintray or maven central is a single line in my build script.

In order to use the zip the way you've packaged it, developers need to:

  1. Check a binary blob into their source control system. This makes checkouts slower and prevents proper diffing of the artifact.
  2. Configure their build system to read from this jar. This is more-or-less okay in gradle, but is pretty hard in maven.
  3. Deal with the fact that their IDE will never prompt them for newer versions. How do they know when the jar can be upgraded? It's not on central/jcenter so it can't fetch new versions from there. This release does not seem to be tagged on github, so we can't use the github hooks. Your site has no RSS feed. There's no mailing list. In all likelihood, someone using the jar in this way will never upgrade.
  4. No source code will be available when inspecting in the IDE, unless I also grab the source code and check it in. But then I have both the jar and the source code checked in separately and have to configure my IDE to associate them. Also, even though the source code is editable in the IDE, it's not being compiled so it has no effect on the behaviour.
  5. It's hard to manage licensing. Right now I use a gradle plugin which extracts license information from the pom of all my dependencies, creating an easy-to-use compliant license package. Since you have no pom, I now need another system for tracking your license and including your copyright notice and license file into the final package.

Compared to all of the above, adding literally one line to my build script is much much preferable!

If you're not sure where to get started, I'd recommend:

  1. Install gradle and use that to add the gradle wrapper into your project. This adds gradlew, gradlew.bat and a 60kb jar which you will have to commit, but prevents anyone else from having to have gradle installed to build this. All other developers will be able to just use "./gradlew build" from your checkout or source distro without any setup at all.
  2. Move your source code into src/main/java to avoid having to reconfigure gradle.
  3. Write a simple build.gradle following their hello world guides. It doesn't look like you really need anything except the java-library plugin since you have no deps and are using defaults, plus whatever stuff you'll need to publish into jcenter like an artifact ID.
  4. Create an account on bintray. This is your interface for the jcenter maven repo and will let you upload published artifacts.
  5. Follow their guides (and other guides you may find) for how to properly package your jar and pom, and upload it to bintray. From there you can sync it into the jcenter repo to make it a one-liner for anyone else to grab.

Cheers!

jvisser commented 4 years ago

Maybe also follow the tiled versioning scheme for the maven artifact? So that the version of TiledReader indicates the compatibility level with tiled.

jvisser commented 4 years ago

Hi, do you have any indication when this will be available? I can't easily share my project with collaborators now because of the manual installation.

AlexHeyman commented 4 years ago

Apologies for the wait; I've been busy with IRL things over the last couple of weeks. I'm hoping to have TiledReader published by September 10th at the latest.

AlexHeyman commented 4 years ago

Update: I submitted a New Project ticket to Sonatype a few days ago. I'm still waiting for it to receive a response. Once the ticket is resolved and the repository is set up, it shouldn't take me too long to get a release of TiledReader published there, barring unforeseen mysterious bugs.

adorokhine commented 4 years ago

As I remember, going the sonatype (maven central) route was definitely the hardest way of publishing, and bintray/jcenter was much easier. If it starts looking like a major pain you can look into the jcenter option. Didn't mean to cause you much trouble :)

AlexHeyman commented 4 years ago

Don't worry about it. The main reason I went with Sonatype was that @jvisser was kind enough to do a lot of the setup work for me unprompted.

Also, it seems like Sonatype was just waiting for me to leave a comment clarifying that an issue had been resolved. When I left that comment, they quickly resolved the ticket. It's late where I am, but I'll see if I can get a TiledReader release published tomorrow.

AlexHeyman commented 4 years ago

TiledReader 1.1.0 is now available on Maven Central. Let me know if you encounter any problems with using it.