Closed wajda closed 4 years ago
The approach I've taken is the one that we use for our projects.
It uses scala-cross-build-maven-plugin
to switch from one Scala version to another by execution a simple Maven command. It rewrites POM accordingly.
So the build procedure is following:
> mvn scala-cross-build:change-version -Pscala-2.11
> mvn deploy
> mvn scala-cross-build:change-version -Pscala-2.12
> mvn deploy
.... and so on and then...
> mvn scala-cross-build:restore-version # to return POM to the original state
I would prefer solving this problem keeping different scala versions in different branches, eg. as we are doing for https://github.com/arangodb/arangodb-spark-connector In this way I don't have to change our internal CI to test and deploy the library. Also it would be beneficial in case the codebase would be different for different scala versions, eg. the code for supporting scala collections v2.13 could be different.
I see. Just curios, won't this branching strategy lead to the code base diverging in time, putting more and more burden on you as a maintainer? I'd also be worried about a potential risk of certain bugfixes not to make it in one of the branches (simply been forgotten or as a result of incorrect merge conflict resolution). Have you looked at scala-collection-compat or Scalafix? What's your opinion?
Thanks @rashtao
Thanks for clarifying, @wajda ! Sure, it puts more responsibility on the developer and in case of mistakes the branches could be not aligned. Since this library is quite small, I think it is still fine managing it manually and keeping the branches aligned. Of course for bigger projects your solution would be preferable, so I will keep it in mind in case the maintenance efforts will become too much.
Fixes #7