amazon-archives / aws-scala-sdk

It's like the AWS SDK for Java, but more Scala-y
Apache License 2.0
73 stars 12 forks source link

Artifacts should published with scala binary version encoded #9

Open fiadliel opened 9 years ago

fiadliel commented 9 years ago

Looking at the artifacts published to Maven Central, the artifacts are not encoded with the scala binary version supported by them. This is standard practice in the scala world, due to past (and current) non-guarantees of compatibility between major releases.

For example, instead of the project "aws-scala-sdk-ec2", I would expect "aws-scala-sdk-ec2_2.10" and "aws-scala-sdk-ec2_2.11" (if you cross-compile).

(note the perils of the current approach, I was just about to try out one of the libraries with a scala 2.11 project, because the artifact encoding didn't warn me that it was potentially incompatible - and these incompatibilities are often latent until you hit a particular code path).

fernomac commented 9 years ago

Ah. That's ... fun. Thanks for bringing the issue to my attention. It looks like scala-maven-plugin is using 2.11, at least for me?

Downloading: https://repo.maven.apache.org/maven2/org/scala-lang/scala-compiler/2.11.7/scala-compiler-2.11.7.jar
...

I'll take a look at what it would take to get that included in the artifact that gets pushed. I'm not seeing anything in the scala-maven-plugin docs about cross-compiling with 2.10 - if that's important to people we'll maybe need to think about switching to use SBT. :(

fiadliel commented 9 years ago

Hmm. I thought I saw 2.10 in the POM file, I obviously mixed that up. So I could use it; but in general, this is still dangerous, and will eventually cause unexpected failures for many people.

I really can't emphasise enough, how important this is in the scala ecosystem. At least, at a MINIMUM, the scala version needs to be encoded. Only supporting a single scala version at a time will also be quite painful as people migrate between versions.

I have some experience with SBT (but not yet with this project) if you would like some help with migration to it.

(the "tasty" research project is working on better compatibility across versions, but right now, it's hard to stay compatible while also using traits to mix in behaviour).

fernomac commented 9 years ago

Yep, definitely makes sense. Both I and the team still at Amazon are relative newbies to scala, so we really appreciate help on making sure this library is a good fit for the community.

If you'd specifically like to help with converting the build to SBT, the actual project structure gets generated here. Currently it's creating an aggregator/parent pom and a set of submodule poms for individual services that reference the generator-maven-plugin to generate the scala code and the scala-maven-plugin to build it. Not sure if there's a great way to reference the generator-maven-plugin from an SBT build. If not, it'll either need to be rewritten as something that can plug into an SBT build, or we could pull that code forward to generate the .scala files and SBT stuff in one pass and then just do a "normal" SBT build on it?

johanatan commented 6 years ago

+1 . Any progress on publishing these artifacts to a public repository?