These are chat archives for jruby-gradle/jruby-gradle-plugin

3rd
Sep 2015
Ernest Bursa
@swistaczek
Sep 03 2015 05:44
@rtyler hello :), yes! I would like to reuse this configuration instead rewriting it to gradle file, mabey this is sick idea but I would like to use bundler deps loading and I would like to be able to run simple ruby server (like puma) without using gradle bundling process (which will be used for staging/production deployment)
R. Tyler Croy
@rtyler
Sep 03 2015 13:39
@swistaczek do you work with me? i've had developers make similar requests from where I work :P
@swistaczek I don't like that approach because it encourages a separation of what runs in production and what runs locally in development mode
Ernest Bursa
@swistaczek
Sep 03 2015 13:41
@rtyler unfortunately I dont work with you :)
R. Tyler Croy
@rtyler
Sep 03 2015 13:41
using Bundler.require or Bundler.setup only requires the generation of a Gemfile.lock so using that I don't think is too sick :P
Ernest Bursa
@swistaczek
Sep 03 2015 13:42
but you are generating Gemfile.lock from gradle?
R. Tyler Croy
@rtyler
Sep 03 2015 13:42
I am not, it's possible though
Gemfile.lock is a machine-readable format, unlike Gemfile which is interpreted Ruby
that said, I have some pretty negative opinions on bundler as a tool in general, so II don't think I will implement anything like that any time soon
Christian Meier
@mkristian
Sep 03 2015 13:44
bundler is very nice and generates it for you if not there , just make sure all gems are installed locally :) - my memory might put bundler in too nice position. not sure
Ernest Bursa
@swistaczek
Sep 03 2015 16:29
@rtyler could I find any example of running rspec as validation before finishing project packaging?
I wonder how to specify testing ruby dependency
R. Tyler Croy
@rtyler
Sep 03 2015 16:41
@swistaczek I don't think I know what you mean
@swistaczek assemble.dependsOn specTaskNameGoesHere
Ernest Bursa
@swistaczek
Sep 03 2015 16:42
for example, imagine that you have Rspec test and it requires gem 'factory_girl'
you would like to install that gem only for testing purpouse, not include it in final JAR
R. Tyler Croy
@rtyler
Sep 03 2015 16:43
that's a good use-case for a different configuration
let me write an quasi-example real quick
Ernest Bursa
@swistaczek
Sep 03 2015 16:43
ok, thanks :)
R. Tyler Croy
@rtyler
Sep 03 2015 16:44
configurations {
  rspec.extendsFrom gems /* make rspec configuration a superset of the `gems` */
}

dependencies {
  gems 'rubygems:sinatra:1.4.5' /* everything needs more sinatra */
  rspec 'rubygems:factory_girl:1.0.0' /* only rspec needs factory_girl */
}

task spec(type: JRubyExec) {
  // etc
  configuration 'rspec' /* use our Gradle configuration with all the necessary dependencies */
}
maybe I'll write a blog post this weekend on overlapping configurations for dependency managmeent
Ernest Bursa
@swistaczek
Sep 03 2015 16:45
ok, but during spec run it will also include sinatra?
R. Tyler Croy
@rtyler
Sep 03 2015 16:45
yes
Ernest Bursa
@swistaczek
Sep 03 2015 16:45
great, thanks :)!
R. Tyler Croy
@rtyler
Sep 03 2015 16:56
heh, neat, ratpack.io uses jruby/gradle via @robfletcher's compass plugin to build their manual
Schalk W. Cronjé
@ysb33r
Sep 03 2015 18:04
nice!
R. Tyler Croy
@rtyler
Sep 03 2015 18:38
I only noticed because I saw a jrubyPrepare task in the tas klist :P
"o hai my code"