Skip to content
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

Build against 2.11 #46

Closed
kenbot opened this issue Jul 16, 2014 · 23 comments
Closed

Build against 2.11 #46

kenbot opened this issue Jul 16, 2014 · 23 comments

Comments

@kenbot
Copy link

kenbot commented Jul 16, 2014

One of our teams is using 2.11 and it would be super peachy if we had a pact-jvm build against it :)

@uglyog
Copy link
Member

uglyog commented Jul 16, 2014

So we have to produce a different set of artifacts. Is that easy to do with SBT?

@kenbot
Copy link
Author

kenbot commented Jul 16, 2014

Should be. There's some sort of command to do cross builds; can't remember what it is off the top of my head. There may be source changes required though; I can't be sure. In that case a branch would be needed. :(

@uglyog
Copy link
Member

uglyog commented Jul 16, 2014

Cross builds seem easy enough: http://www.scala-sbt.org/release/docs/Cross-Build.html

@uglyog
Copy link
Member

uglyog commented Jul 16, 2014

It is also easy to do with gradle as well, so it should not be a big problem. I'll try set it up this weekend.

@CaseyLeask
Copy link

@uglyog Thanks for the link! @carolliu and I will take a look, but we are complete Scala novices.

@kenbot
Copy link
Author

kenbot commented Jul 16, 2014

I'll review if you like :)

On 16 July 2014 16:38, Casey Leask notifications@github.com wrote:

@uglyog https://github.com/uglyog Thanks for the link! @carolliu
https://github.com/carolliu and I will take a look, but we are complete
Scala novices.


Reply to this email directly or view it on GitHub
#46 (comment).

@CaseyLeask
Copy link

Here's how far we got #47

@uglyog
Copy link
Member

uglyog commented Jul 19, 2014

travis ci build was green, so i merged the pull request

@uglyog
Copy link
Member

uglyog commented Jul 19, 2014

Looks like the SBT modules have to be compiled against the version of Scala that SBT is compiled against, which is 2.10. I'm trying to force those modules to always use 2.10, but I'm not having much luck.

Another option would be to exclude them if the version is 2.11, but I'm not sure how to do that. Maybe a filter after the aggregate in the build.sbt?

I'm also going to try setup a gradle cross build, because that will be easy to exclude those two modules when compiling with 2.11 with gradle.

@uglyog
Copy link
Member

uglyog commented Jul 19, 2014

I've managed to get gradle to cross compile. if you want to use it to build the 2.11 versions, I've setup some aggregate tasks. You can run

$ ./gradlew build_2_11

to build all the 2.11 artifacts, and

$ ./gradlew install_2_11

to install them into your local maven repo.

@uglyog
Copy link
Member

uglyog commented Jul 20, 2014

I have published all the artifacts to maven central using gradle. Both 2.10 and 2.11 versions should be available (except the SBT plugins, they're only built against 2.10)

@thetrav
Copy link
Contributor

thetrav commented Jul 20, 2014

Do we really need to maintain two different build tools?
I would have expected sbt to satisfy anything you'd need to use gradle for

@CaseyLeask
Copy link

@uglyog Thanks Ronald! That's some amazingly quick work!
I'm learning a lot by just reading the commits you made 👍

@uglyog
Copy link
Member

uglyog commented Jul 21, 2014

@CaseyLeask No worries, glad to help

@uglyog
Copy link
Member

uglyog commented Jul 21, 2014

@thetrav Sadly sbt being able to satisfy anything you'd need to use gradle for is not true. We've had some issues with it.

  1. sbt can only build java and scala modules. This seems to be by design.
  2. we could not get it working behind a corporate proxy
  3. I could not get it to not cross-compile the SBT modules (this is more a problem with me using it)

So it's more of a case that gradle can do anything sbt can, plus more

@uglyog uglyog closed this as completed Aug 6, 2014
@ShaneDelmore
Copy link

Given that the SBT plugins are only build against 2.10 is there any way to get this working with Scala 2.11 and SBT?

@bethesque
Copy link
Member

I'd really like to get the scala mock server to be runnable from a jar, for people who have java installed (most people) but who wouldn't install sbt/scala on top of all their other project dependencies just to run pact (again, most people). How much work would that be?

@uglyog
Copy link
Member

uglyog commented Aug 15, 2014

@ShaneDelmore The SBT plugins are built against the version of Scala that SBT is built against (2.10 for SBT 0.13). They should work with a project using Scala 2.11, but I have not tried this.

@CaseyLeask is using 2.11, so I'll try find out how it's working for them.

@uglyog
Copy link
Member

uglyog commented Aug 15, 2014

@bethesque there is the pact-jvm-server which is a standalone mock server. I'll update the docs on running it standalone.

Or where you thinking of something else?

@bethesque
Copy link
Member

Can you run it from a jar? With no sbt?

On Saturday, August 16, 2014, Ronald Holshausen notifications@github.com
wrote:

@bethesque https://github.com/bethesque there is the pact-jvm-server
which is a standalone mock server. I'll update the docs on running it
standalone.

Or where you thinking of something else?


Reply to this email directly or view it on GitHub
#46 (comment).

@ShaneDelmore
Copy link

@uglyog I downgraded my project to 2.10 for now. Still trying to get my first test working but once I have something I will convert my project back to 2.11 and verify it still works. I do not know that there actually was any problem with 2.11, it may have just been a mistake on my end related to #50 which you have already resolved.

@uglyog
Copy link
Member

uglyog commented Aug 19, 2014

@bethesque Yes you can, I tested it. But you need all jars it depends on for it to work. I updated the readme on how you can do it with gradle.

@ShaneDelmore
Copy link

I just verified 2.11 works fine with sbt now that @uglyog published 2.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants