scala-hamsters / hamsters

A mini Scala utility library
Apache License 2.0
291 stars 23 forks source link

Resolves #76, simplify release process #112

Closed ggrossetie closed 5 years ago

ggrossetie commented 6 years ago

To install Mill, please read https://www.lihaoyi.com/mill/index.html#installation Once Mill installed, the following commands should work:

mill hamster[2.12.4].jvm.compile
mill hamster[2.12.4].jvm.test
mill hamster[2.11.11].jvm.compile
mill hamster[2.11.11].jvm.test
mill js.compile

Question: How can I make sure that js.compile is working ?

Note: In a Mill build file the keyword override is optional because Mill is using a compiler plugin. However Intellij IDEA is complaining because it does not use this compiler plugin (I don't know if it's possible to configure a plugin compiler for this file ?). Anyway, in order to provide a better developers experience on Intellij, I've added the keyword override.

ggrossetie commented 6 years ago

For now, the following command is throwing an exception (don't know why yet):

I found my mistake, I was using Scala 2.12 to run the tests compiled with Scala 2.11. Build is green :tada:

loicdescotte commented 6 years ago

Nice!!!

As soon as it's possible to deply on sonatype I can merge!

ggrossetie commented 6 years ago

Ok! I do have a few questions. Currently we deploy the following artifacts:

GroupId ArtifactId
io.github.scala-hamsters hamsters_2.11
io.github.scala-hamsters hamsters_sjs0.6_2.11
io.github.scala-hamsters hamsters_2.12
io.github.scala-hamsters hamsters_sjs0.6_2.12
io.github.scala-hamsters macros_sjs0.6_2.11
io.github.scala-hamsters macros_2.11
io.github.scala-hamsters macros_sjs0.6_2.12
io.github.scala-hamsters macros_2.12

Do we need to publish the Scala.js artifacts for both Scala 2.11 and 2.12 ? Do we need to publish Hamsters macros ?

loicdescotte commented 6 years ago

Hi,

Yes, the show macro for example is made to be used by end users. But if you can package everything (including macros) in the hamsters jar, it would be OK too! I guess it's better to have Scala 2.11 for js too, WDYT?

ggrossetie commented 6 years ago

Yes, the show macro for example is made to be used by end users. But if you can package everything (including macros) in the hamsters jar, it would be OK too!

Ok, here's the result:

ls -1 ~/.ivy2/local/io.github.scala-hamsters/**/jars/** 
/home/guillaume/.ivy2/local/io.github.scala-hamsters/hamster-2.11.11-js_sjs0.6_2.11/2.6.0/jars/hamster-2.11.11-js_sjs0.6_2.11.jar
/home/guillaume/.ivy2/local/io.github.scala-hamsters/hamster-2.11.11-jvm_2.11/2.6.0/jars/hamster-2.11.11-jvm_2.11.jar

I should remove the suffix -2.11.11-jvm and -2.11.11-js right ?

I guess it's better to have Scala 2.11 for js too, WDYT?

I've never used Scala.js that's why I was asking this question because I wasn't sure that it was necessary to compile against both Scala 2.11 and Scala 2.12. But if it's needed, Mill can do it :wink:

ggrossetie commented 6 years ago

 As soon as it's possible to deply on sonatype I can merge!

How can I test this ? @loicdescotte Did you have a chance to test it on your local machine to confirm that the produced jar are "valid" ?

loicdescotte commented 6 years ago

Hi, Sorry, I didn't have time to test yet, I'll try to do it ASAP, probably next week. To deploy on Sonatype you need to find something equivalent to the pgp SBT plugin (see https://github.com/xerial/sbt-sonatype and https://www.scala-sbt.org/sbt-pgp/). For Hamsters on Sonatype, there is a passphrase, I can send it to you by email :) (can you email me so I have your email?)

Thanks!

ggrossetie commented 5 years ago

I've added a contributing guide to explain how to build and release the project with mill