-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include the scala version in the maven artefacts #432
Comments
Why? |
I mean, why add a dependency to this library at all. It's not used anywhere in the Cucumber-JVM codebase. |
Closed due to lack of follow-up. Feel free to request this to be reopened. |
The scala library and compiler deps appear here... As you change the versions of these from 2.9.2 to 2.10 and back to 2.9.2 we get builds of Cuke scala DSL that does / doesn't work respectively with a 2.9.2 project. It would be preferable for client apps (eg me) for the cucumber-scala arterfact to be called cucumber-scala-2.9.2 as per other libs that have a scala binding such as scalatest. |
PS you may have misinterpreted my first post. Scala test builds separate artefacts for its 2.9.2 and 2.10 builds - for cucumber-scala to do the same it should be building eg cucumber-scala-2.9.2 rather than just cucumber-scala. This approach seems the convention for scala libraries, such as cucumber-scala. This approach avoids a situation where cucumber switching from 2.9.2 to 2.10 to 2.9.2 keeps breaking my app. |
Thanks @Johnlon for the clarification - I understand what you mean now. We can put the scala version in the artifactId, but to keep it simple I think releases should only publish one version, corresponding to the latest final scala release. Sounds ok? Want to send a pull request? |
Might need to wait a bit as I am having a back operation tomorrow. Wasn't sure what you meant ... I think releases should only publish one On 19 December 2012 14:29, Aslak Hellesøy notifications@github.com wrote:
|
What I meant was that the next release would publish a -Unless of course the current final scala version at that point in time is Makes sense? Good luck with your operation mate. |
Hi. Hot sure it's quite as simple as that. I've been looking into it a bit with regard to my sbt plugin. The current release schedule for Scala is that 2.10.0 should be final before the end of the year. However, I think 2.9.2 and 2.10.x will run side-by-side for some time (my company's projects certainly won't be migrating from 2.9.2 in the near future). I've done a few tests and cucumber-scala built against either version is not binary compatible with the other. For the sbt plugin I'm currently supporting 2 cucumber versions: 1.0.9 for Scala 2.9.2 and 1.1.x for Scala 2.10. While this works, it does mean that Scala 2.9.2 users can't have the latest cucumber-jvm features and bug fixes. The best solution would be to cross-build two versions of cucumber-scala, one for 2.9.2 and one for 2.10.0. Not sure how this is achieved in a Maven project but I'm happy to take a look over the Christmas break if that would help. |
Unless, or until, you start using a feature only available in 2.10 then the best solution is just to build two separate artefacts, one for each scala revision .. with as discussed the artefact-id containing the relevant scala version ...
I believe scala 2.9.3 is coming out sometime soon but I am not sure whether 2.9.2/2.9.3 are binary compatible.
One problem I think is that I'm not sure if you can override the artefact-id to include a variable for the scala version. Thoughts .. How about renaming the source dir to cucumber-scala-2.9.2/ and change that pom to build cucumber-scala-2.9.2. Then have a parallel tree eg called cucumber-scala-2.10/ but this dir would contain nothing but a pom that is customised for 2.10 - AND - that pom's config for the scala/java compiler fetches its source code via a relative path If this worked then you still only have a single body of code to maintain in the cucumber-scala-2.9.2/ tree. This scales easily as if you need scala-2.9.3 then you just add another sibling skeleton directory for it. Change the aggregator pom to build cucumber-scala-2.9.2/ and cucumber-scala-2.10/ instead of cucumber-scala/ I note ... |
So I did a bit of investigation on this, we could simply include an additional pom file, Of course, disregarding that part, it doesn't even build:
I think even if we could use a second pom to support 2.9.2, the source code itself doesn't. It would require two separate code bases, or using code that can work in both somehow. I'm not sure how to do that, too much of a noob at scala :( |
I think I've almost got a cross-build working that compiles from single source set using both Scala 2.10.0 and 2.9.2 and creates separate properly version numbered artifacts (e.g. cucumber-scala_2.10.0 and cucumber-scala_2.9.2). I'm just testing it out against my sbt cucumber plugin to make sure everything works and if it looks fine then I'll create a pull request in the next couple of days. What I've managed to do is have the cucumber-jvm/scala directory with the src directory underneath. Then I've created separate scala_2.9.2 and scala_2.10.0 directories under cucumber-jvm/scala and these each contain a copy of the pom customised for the specific Scala version, but working off of the shared source. The two separate Scala modules are then referenced as separate modules from the main pom, built tested and packaged independently. As an aside, the current Scala code seems to compile fine under both Scala 2.10.0 and 2.9.2 provided you get all the Scala library dependencies correct. The only downside I have with my solution is that the Scala dependencies and versions are no longer in the root pom.xml file, which means they have to be defined in both scala pom.xml files and also the scala pom.xml in the examples directory. I'm trying to work out if there's a way around this. |
The main scala build has been modified to generate an artifact named cucumber-scala_2.10 A new sub-directory of the scala build has been created. This uses the same source files as its parent but builds a cucumber-scala_2.9.2 artifact using the Scala 2.9.2 compiler and library To get this to work correctly the README.java and package.html files were moved into the scala source tree The scala-calculator example was modified to use the cucumber-scala_2.10 artifact The root pom.xml file no longer directly references Scala library dependencies as there are now different versions between the 2.10 and 2.9.2 build. (Is the a solution to this?)
I added a pull request for this (#462). Welcome comments/suggestions as it's a long long time since I last used maven. |
The main scala build has been modified to generate an artifact named cucumber-scala_2.10 A new sub-directory of the scala build has been created. This uses the same source files as its parent but builds a cucumber-scala_2.9.2 artifact using the Scala 2.9.2 compiler and library To get this to work correctly the README.java and package.html files were moved into the scala source tree The scala-calculator example was modified to use the cucumber-scala_2.10 artifact The root pom.xml file no longer directly references Scala library dependencies as there are now different versions between the 2.10 and 2.9.2 build. (Is the a solution to this?)
The main scala build has been modified to generate an artifact named cucumber-scala_2.10 A new sub-directory of the scala build has been created. This uses the same source files as its parent but builds a cucumber-scala_2.9.2 artifact using the Scala 2.9.2 compiler and library To get this to work correctly the README.java and package.html files were moved into the scala source tree The scala-calculator example was modified to use the cucumber-scala_2.10 artifact The root pom.xml file no longer directly references Scala library dependencies as there are now different versions between the 2.10 and 2.9.2 build. (Is the a solution to this?)
The main scala build has been modified to generate an artifact named cucumber-scala_2.10 A new sub-directory of the scala build has been created. This uses the same source files as its parent but builds a cucumber-scala_2.9.2 artifact using the Scala 2.9.2 compiler and library To get this to work correctly the README.java and package.html files were moved into the scala source tree The scala-calculator example was modified to use the cucumber-scala_2.10 artifact The root pom.xml file no longer directly references Scala library dependencies as there are now different versions between the 2.10 and 2.9.2 build. (Is the a solution to this?)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Please include the scala version in the path as per scalatest ..
The text was updated successfully, but these errors were encountered: