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

Ability to Install Gem Dependencies From a Path #102

Open
blaines opened this issue Mar 25, 2015 · 9 comments
Open

Ability to Install Gem Dependencies From a Path #102

blaines opened this issue Mar 25, 2015 · 9 comments
Assignees
Labels

Comments

@blaines
Copy link

blaines commented Mar 25, 2015

It would be great if it would be possible to configure individual gems to be installed from a local directory like with bundler's :path option. This would be very useful for local development or even intra-project dependencies.

Here's the idea in code:

gems ('rubygems:activesupport:3.2.+') { path = '../somewhere/active_support' }

I believe @rtyler has something going in that direction already.

@ysb33r
Copy link
Contributor

ysb33r commented Mar 25, 2015

have you tried just doing

repositories {
  flatDir '../somewhere/active_support'
}

@rtyler
Copy link
Member

rtyler commented Mar 25, 2015

@ysb33r I believe the problem with that approach to be that the structure of a gem in source code is much different than the sturcture of a gem that has been "installed" or "unpacked" for Ruby code to pick up and require properly.

The work in progress that I have locally implements a SelfResolvingDependency to provide the following DSL:

dependencies {
    gems 'rubygems:faraday:1.0'

    gems gemspec('path/to/jbundler.gemspec')
}

Where I'm leaning right now is that resolve() on the dependency will properly build the package such that the normal gem install machinery can handle it appropriately.

@rtyler rtyler self-assigned this Mar 25, 2015
@ysb33r
Copy link
Contributor

ysb33r commented Mar 25, 2015

My suggestion assumed that you already had a packed gem in a folder.

However, I do get your point and I like the the use of a gemspec keyword. It will it readable and the intent expressed correctly.

@rtyler rtyler modified the milestone: 0.1.13 Mar 31, 2015
@rtyler rtyler modified the milestone: 0.1.13 Apr 9, 2015
@rtyler rtyler added the base label Jul 20, 2015
@rtyler
Copy link
Member

rtyler commented Aug 11, 2015

The work I have going on in groovy-gem might be able to help here, I'm not sure it's going to solve the problem outright though

@mojavelinux
Copy link
Contributor

The real hangup here is that people using Gradle are locked out from using gems directly from a git repository or a locally built gem. That makes it almost impossible for them to help with testing.

@mkristian
Copy link
Contributor

mkristian commented Nov 4, 2016 via email

@mojavelinux
Copy link
Contributor

@mkristian While it's true that using a git clone allows you to put the files of the gem on the load path, it does not provide dependency management. The ability to use a gem from a path or git repository just like any other gem is one of the most valuable features of Bundler for development and testing (See http://bundler.io/v1.13/git.html). However, we lack that feature in the JRuby Gradle environment.

@mkristian
Copy link
Contributor

@mojavelinux I tried to implement it when I worked on the jruby-maven-plugins and also here with the gradle plugin. I am also not the right person as I do not even use git and only temporary path declarations with ruby.

the moment I want to have reproducible builds, jruby-gradle needs some lock version plugin which makes the whole git and path part of more complicated as this is outside of the jruby-gradle domain.

creating a pom.xml on the fly is not the problem but we are not even able to convert the rubygems.org repo on the fly to maven repo for gradle to use with their dependency resolution. there is (or was when I look at it) no way to hook anything into gradle to do so. the local gem problem is not the same but goes into the same direction, as you need to hook into the core dependency resolver.

having said this, I will look at any PR and/or ideas addressing this issue, I personally had my experiments and trial in the direction and happy to help with anything promising.

@mojavelinux
Copy link
Contributor

mojavelinux commented Nov 19, 2016

Thanks for that insight!

For reference, I was able to work out how to use the gem from git without the dependency management part. You can see instructions in the following thread.

asciidoctor/asciidoctor-pdf#650 (comment)

This could be taken one step further to have Gradle clone the repo and the JRuby Gradle plugin build the gem. I just haven't gotten to that part yet.

@rtyler rtyler added this to the 2.0.0 - Stuttgart milestone May 5, 2019
@ysb33r ysb33r modified the milestones: 2.0.0 - Stuttgart, 2.1.0 Jan 17, 2020
@UweKubosch UweKubosch removed this from the 2.1.0 milestone May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

6 participants