arangodb / java-velocypack-module-scala

Apache License 2.0
6 stars 3 forks source link

arango #7 Add scala cross-build #10

Closed wajda closed 4 years ago

wajda commented 4 years ago

Fixes #7

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

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.

rashtao commented 4 years ago

Fixed in https://github.com/arangodb/java-velocypack-module-scala/releases/tag/v1.2.0

wajda commented 4 years ago

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

rashtao commented 4 years ago

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.