Quantcast

Pull Dependencies from GIT

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Pull Dependencies from GIT

Alan
hi,

I was putting a plugin together which depended on code in a git repo for it's functionality, I looked into

compile ('scm:git:git///myrepo.....')

but this failed and the code in IvyDependency... (grails src) doesn't seem to cater for it, is there any way to do this?

Alan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Pull Dependencies from GIT

pledbrook
> I was putting a plugin together which depended on code in a git repo for
> it's functionality, I looked into
>
> compile ('scm:git:git///myrepo.....')
>
> but this failed and the code in IvyDependency... (grails src) doesn't seem
> to cater for it, is there any way to do this?

You want to depend on the source in a remote git repository or a
binary that's there? If the latter, you would have to write your own
custom repository resolver. If the former, could you give more details
of what you're trying to achieve?

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Pull Dependencies from GIT

rosenfeld
I'm curious about this. I always enjoyed the fact that I could point to
git repositories and branches in my Gemfile when using Ruby Bundler.

I'd like to be able to do the same in my Grails projects. Is this
documented somewhere?

Thanks in advance, Peter.

Cheers,
Rodrigo.

Em 14-03-2012 05:40, Peter Ledbrook escreveu:

>> I was putting a plugin together which depended on code in a git repo for
>> it's functionality, I looked into
>>
>> compile ('scm:git:git///myrepo.....')
>>
>> but this failed and the code in IvyDependency... (grails src) doesn't seem
>> to cater for it, is there any way to do this?
> You want to depend on the source in a remote git repository or a
> binary that's there? If the latter, you would have to write your own
> custom repository resolver. If the former, could you give more details
> of what you're trying to achieve?
>
> Peter
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Pull Dependencies from GIT

pledbrook
> I'm curious about this. I always enjoyed the fact that I could point to git
> repositories and branches in my Gemfile when using Ruby Bundler.
>
> I'd like to be able to do the same in my Grails projects. Is this documented
> somewhere?

Is what documented? The use case needs to be well defined in order for
us to work out whether it's possible or not. Certainly we don't have
any documentation that's git-specific.

If people want to store the plugin packages in a git repository, then
they will need to create a custom Ivy resolver. Best bet is to take a
look at an existing resolver such as:

    https://github.com/grails/grails-core/blob/master/grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/GrailsRepoResolver.java

or Ivy's SSHResolver.

The only other technique I can think of is to use a source git
repository combined with the in-place plugin mechanism, but that would
require some work in Grails core.

Cheers,

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Pull Dependencies from GIT

Matthias Hryniszak
I think the clear message is that Grails ain't RoR nor Ruby Gems. What you're trying to do is to use concepts from Ruby world in Java which obviously will not work. It's a different universe all along.

Matthias

2012/3/14 Peter Ledbrook <[hidden email]>
> I'm curious about this. I always enjoyed the fact that I could point to git
> repositories and branches in my Gemfile when using Ruby Bundler.
>
> I'd like to be able to do the same in my Grails projects. Is this documented
> somewhere?

Is what documented? The use case needs to be well defined in order for
us to work out whether it's possible or not. Certainly we don't have
any documentation that's git-specific.

If people want to store the plugin packages in a git repository, then
they will need to create a custom Ivy resolver. Best bet is to take a
look at an existing resolver such as:

   https://github.com/grails/grails-core/blob/master/grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/GrailsRepoResolver.java

or Ivy's SSHResolver.

The only other technique I can think of is to use a source git
repository combined with the in-place plugin mechanism, but that would
require some work in Grails core.

Cheers,

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Pull Dependencies from GIT

Roberto Guerra
It sounds like a good idea to me.

On Wed, Mar 14, 2012 at 9:21 AM, Matthias Hryniszak <[hidden email]> wrote:
I think the clear message is that Grails ain't RoR nor Ruby Gems. What you're trying to do is to use concepts from Ruby world in Java which obviously will not work. It's a different universe all along.

Matthias

2012/3/14 Peter Ledbrook <[hidden email]>
> I'm curious about this. I always enjoyed the fact that I could point to git
> repositories and branches in my Gemfile when using Ruby Bundler.
>
> I'd like to be able to do the same in my Grails projects. Is this documented
> somewhere?

Is what documented? The use case needs to be well defined in order for
us to work out whether it's possible or not. Certainly we don't have
any documentation that's git-specific.

If people want to store the plugin packages in a git repository, then
they will need to create a custom Ivy resolver. Best bet is to take a
look at an existing resolver such as:

   https://github.com/grails/grails-core/blob/master/grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/GrailsRepoResolver.java

or Ivy's SSHResolver.

The only other technique I can think of is to use a source git
repository combined with the in-place plugin mechanism, but that would
require some work in Grails core.

Cheers,

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email






--
The Journey Is The Reward.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Pull Dependencies from GIT

rosenfeld
In reply to this post by pledbrook
Sorry Peter, I wasn't specific. I don't want to use packages but sources
when pointing to a git repository.

Is this already possible? If so, could you please provide an example of
how I would do that in my BuildConfig.groovy?

Thank you in advance,
Rodrigo.

Em 14-03-2012 12:06, Peter Ledbrook escreveu:

>> I'm curious about this. I always enjoyed the fact that I could point to git
>> repositories and branches in my Gemfile when using Ruby Bundler.
>>
>> I'd like to be able to do the same in my Grails projects. Is this documented
>> somewhere?
> Is what documented? The use case needs to be well defined in order for
> us to work out whether it's possible or not. Certainly we don't have
> any documentation that's git-specific.
>
> If people want to store the plugin packages in a git repository, then
> they will need to create a custom Ivy resolver. Best bet is to take a
> look at an existing resolver such as:
>
>      https://github.com/grails/grails-core/blob/master/grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/GrailsRepoResolver.java
>
> or Ivy's SSHResolver.
>
> The only other technique I can think of is to use a source git
> repository combined with the in-place plugin mechanism, but that would
> require some work in Grails core.
>
> Cheers,
>
> Peter
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Pull Dependencies from GIT

alxndrsn
This doesn't sound entirely stupid to me either - my team's run into a
few WTFs trying to resolve Maven SNAPSHOT dependencies in a grails
project.  We've tried a couple of automated workarounds for this, but
our current fix is just communicating clearly when a SNAPSHOT needs to
be manually updated.

I suspect this StackOverflow question is relevant:
http://stackoverflow.com/questions/9294996/ivy-custom-resolvers-for-git-or-tfs
Pluggable CVS resolvers for Ivy would be cool, and being able to
specify source repos in Grails BuildConfig even cooler.


On 15 March 2012 02:43, Rodrigo Rosenfeld Rosas <[hidden email]> wrote:

> Sorry Peter, I wasn't specific. I don't want to use packages but sources
> when pointing to a git repository.
>
> Is this already possible? If so, could you please provide an example of how
> I would do that in my BuildConfig.groovy?
>
> Thank you in advance,
> Rodrigo.
>
> Em 14-03-2012 12:06, Peter Ledbrook escreveu:
>
>>> I'm curious about this. I always enjoyed the fact that I could point to
>>> git
>>> repositories and branches in my Gemfile when using Ruby Bundler.
>>>
>>> I'd like to be able to do the same in my Grails projects. Is this
>>> documented
>>> somewhere?
>>
>> Is what documented? The use case needs to be well defined in order for
>> us to work out whether it's possible or not. Certainly we don't have
>> any documentation that's git-specific.
>>
>> If people want to store the plugin packages in a git repository, then
>> they will need to create a custom Ivy resolver. Best bet is to take a
>> look at an existing resolver such as:
>>
>>
>> https://github.com/grails/grails-core/blob/master/grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/GrailsRepoResolver.java
>>
>> or Ivy's SSHResolver.
>>
>> The only other technique I can think of is to use a source git
>> repository combined with the in-place plugin mechanism, but that would
>> require some work in Grails core.
>>
>> Cheers,
>>
>> Peter
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Pull Dependencies from GIT

pledbrook
> This doesn't sound entirely stupid to me either - my team's run into a
> few WTFs trying to resolve Maven SNAPSHOT dependencies in a grails
> project.  We've tried a couple of automated workarounds for this, but
> our current fix is just communicating clearly when a SNAPSHOT needs to
> be manually updated.

Which version of Grails? 2.0.x no longer checks every single time it
runs whether a snapshot dependency has changed, but you can force it
with the --refresh-dependencies command-line switch.

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Pull Dependencies from GIT

pledbrook
In reply to this post by rosenfeld
On 14 March 2012 23:43, Rodrigo Rosenfeld Rosas <[hidden email]> wrote:
> Sorry Peter, I wasn't specific. I don't want to use packages but sources
> when pointing to a git repository.
>
> Is this already possible? If so, could you please provide an example of how
> I would do that in my BuildConfig.groovy?

You can only do this with local repositories via the in-place plugin
mechanism - and that of course has no support for branches (it takes
whatever the current branch is).

That said, because Grails uses source plugins I don't think there's
any technical reason you couldn't do what you want. But I think taking
Ivy as the starting point is the wrong approach, since it's only for
zips (packaged source plugins) or jars (binary plugins). Instead, you
would have to hook into the mechanics of post plugin resolution when
plugins are effectively installed into an application, i.e. unpacked.

I don't think think this is feasible right now. I'm pretty sure some
refactoring in Grails core would be required, but it makes sense in my
mind to have an abstraction over installed plugins and in-place
plugins that a user may be able to provide a git-based implementation
for.

Anyway, it's just an idea. There's nothing on the roadmap for it.

Hope that explains things,

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Pull Dependencies from GIT

rosenfeld
Em 15-03-2012 06:12, Peter Ledbrook escreveu:

> On 14 March 2012 23:43, Rodrigo Rosenfeld Rosas<[hidden email]>  wrote:
>> Sorry Peter, I wasn't specific. I don't want to use packages but sources
>> when pointing to a git repository.
>>
>> Is this already possible? If so, could you please provide an example of how
>> I would do that in my BuildConfig.groovy?
> You can only do this with local repositories via the in-place plugin
> mechanism - and that of course has no support for branches (it takes
> whatever the current branch is).
>
> That said, because Grails uses source plugins I don't think there's
> any technical reason you couldn't do what you want. But I think taking
> Ivy as the starting point is the wrong approach, since it's only for
> zips (packaged source plugins) or jars (binary plugins). Instead, you
> would have to hook into the mechanics of post plugin resolution when
> plugins are effectively installed into an application, i.e. unpacked.
>
> I don't think think this is feasible right now. I'm pretty sure some
> refactoring in Grails core would be required, but it makes sense in my
> mind to have an abstraction over installed plugins and in-place
> plugins that a user may be able to provide a git-based implementation
> for.
>
> Anyway, it's just an idea. There's nothing on the roadmap for it.
>
> Hope that explains things,

Thank you, Peter. That explains everything. :)

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Pull Dependencies from GIT

Alan
I was away for a day and couldn't catch up on this,

What I wanted to do was check .java source out from a github repo, jar it and add it as a dependency - this way my plugin would always have  latest version of the code I depend on, at the moment I have to jar it manually. I looked into a custom resolver and just thought I'd ask this first....

Alan

On 15 March 2012 11:07, Rodrigo Rosenfeld Rosas <[hidden email]> wrote:
Em 15-03-2012 06:12, Peter Ledbrook escreveu:

On 14 March 2012 23:43, Rodrigo Rosenfeld Rosas<[hidden email]>  wrote:
Sorry Peter, I wasn't specific. I don't want to use packages but sources
when pointing to a git repository.

Is this already possible? If so, could you please provide an example of how
I would do that in my BuildConfig.groovy?
You can only do this with local repositories via the in-place plugin
mechanism - and that of course has no support for branches (it takes
whatever the current branch is).

That said, because Grails uses source plugins I don't think there's
any technical reason you couldn't do what you want. But I think taking
Ivy as the starting point is the wrong approach, since it's only for
zips (packaged source plugins) or jars (binary plugins). Instead, you
would have to hook into the mechanics of post plugin resolution when
plugins are effectively installed into an application, i.e. unpacked.

I don't think think this is feasible right now. I'm pretty sure some
refactoring in Grails core would be required, but it makes sense in my
mind to have an abstraction over installed plugins and in-place
plugins that a user may be able to provide a git-based implementation
for.

Anyway, it's just an idea. There's nothing on the roadmap for it.

Hope that explains things,

Thank you, Peter. That explains everything. :)


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Pull Dependencies from GIT

Jeff Brown-3
On Thu, Mar 15, 2012 at 8:49 AM, Alan Ryan <[hidden email]> wrote:

> I was away for a day and couldn't catch up on this,
>
> What I wanted to do was check .java source out from a github repo, jar it
> and add it as a dependency - this way my plugin would always have  latest
> version of the code I depend on, at the moment I have to jar it manually. I
> looked into a custom resolver and just thought I'd ask this first....
>
> Alan
>
>

Can you set the dependency up as a git submodule in your project?



jb
--
Jeff Brown
SpringSource
http://www.springsource.com/

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Pull Dependencies from GIT

Alan
Hi Jeff,

Yeah, that would work for me locally,  but . .

and  correct me if I'm wrong here as this is the first plugin I have looked at developing,   that wouldn't allow me to distribute it as a plugin - the reason I think this is that if the dependency updated then the plugin would still be using a static jar built at distribution time?

Al


On 16 March 2012 02:01, Jeff Brown <[hidden email]> wrote:
On Thu, Mar 15, 2012 at 8:49 AM, Alan Ryan <[hidden email]> wrote:
> I was away for a day and couldn't catch up on this,
>
> What I wanted to do was check .java source out from a github repo, jar it
> and add it as a dependency - this way my plugin would always have  latest
> version of the code I depend on, at the moment I have to jar it manually. I
> looked into a custom resolver and just thought I'd ask this first....
>
> Alan
>
>

Can you set the dependency up as a git submodule in your project?



jb
--
Jeff Brown
SpringSource
http://www.springsource.com/

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Pull Dependencies from GIT

Matthias Hryniszak
In reply to this post by Alan
Not true what you just mentioned. Once the sources are retrieved they are compiled - not Jar'ed. I really don't see the benefit here: if it's compilation time you're interested in shortening then use binary versions of those plugins. If it's the sources use those as mentioned in docs:

grails.plugin.location.'plugin-name' = '../plugins/some-place-else'

And that's all it takes. Then you can setup svn:externals or git submodules or what not. Would this help?

Matthias.

2012/3/15 Alan Ryan <[hidden email]>
I was away for a day and couldn't catch up on this,

What I wanted to do was check .java source out from a github repo, jar it and add it as a dependency - this way my plugin would always have  latest version of the code I depend on, at the moment I have to jar it manually. I looked into a custom resolver and just thought I'd ask this first....

Alan


On 15 March 2012 11:07, Rodrigo Rosenfeld Rosas <[hidden email]> wrote:
Em <a href="tel:15-03-2012" value="+4815032012" target="_blank">15-03-2012 06:12, Peter Ledbrook escreveu:

On 14 March 2012 23:43, Rodrigo Rosenfeld Rosas<[hidden email]>  wrote:
Sorry Peter, I wasn't specific. I don't want to use packages but sources
when pointing to a git repository.

Is this already possible? If so, could you please provide an example of how
I would do that in my BuildConfig.groovy?
You can only do this with local repositories via the in-place plugin
mechanism - and that of course has no support for branches (it takes
whatever the current branch is).

That said, because Grails uses source plugins I don't think there's
any technical reason you couldn't do what you want. But I think taking
Ivy as the starting point is the wrong approach, since it's only for
zips (packaged source plugins) or jars (binary plugins). Instead, you
would have to hook into the mechanics of post plugin resolution when
plugins are effectively installed into an application, i.e. unpacked.

I don't think think this is feasible right now. I'm pretty sure some
refactoring in Grails core would be required, but it makes sense in my
mind to have an abstraction over installed plugins and in-place
plugins that a user may be able to provide a git-based implementation
for.

Anyway, it's just an idea. There's nothing on the roadmap for it.

Hope that explains things,

Thank you, Peter. That explains everything. :)


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Pull Dependencies from GIT

Alan
Hi Matthias,

I think wires might be crossed here, and I don't know enough about the dependency system. I'm not looking to reduce compilation time, what I want to do is release a plugin that depends on Java source code in a github repository - but I can't see a means of pulling this source down into my project via the BuildConfig script...



On 16 March 2012 20:57, Matthias Hryniszak <[hidden email]> wrote:
Not true what you just mentioned. Once the sources are retrieved they are compiled - not Jar'ed. I really don't see the benefit here: if it's compilation time you're interested in shortening then use binary versions of those plugins. If it's the sources use those as mentioned in docs:

grails.plugin.location.'plugin-name' = '../plugins/some-place-else'

And that's all it takes. Then you can setup svn:externals or git submodules or what not. Would this help?

Matthias.


2012/3/15 Alan Ryan <[hidden email]>
I was away for a day and couldn't catch up on this,

What I wanted to do was check .java source out from a github repo, jar it and add it as a dependency - this way my plugin would always have  latest version of the code I depend on, at the moment I have to jar it manually. I looked into a custom resolver and just thought I'd ask this first....

Alan


On 15 March 2012 11:07, Rodrigo Rosenfeld Rosas <[hidden email]> wrote:
Em <a href="tel:15-03-2012" value="+4815032012" target="_blank">15-03-2012 06:12, Peter Ledbrook escreveu:

On 14 March 2012 23:43, Rodrigo Rosenfeld Rosas<[hidden email]>  wrote:
Sorry Peter, I wasn't specific. I don't want to use packages but sources
when pointing to a git repository.

Is this already possible? If so, could you please provide an example of how
I would do that in my BuildConfig.groovy?
You can only do this with local repositories via the in-place plugin
mechanism - and that of course has no support for branches (it takes
whatever the current branch is).

That said, because Grails uses source plugins I don't think there's
any technical reason you couldn't do what you want. But I think taking
Ivy as the starting point is the wrong approach, since it's only for
zips (packaged source plugins) or jars (binary plugins). Instead, you
would have to hook into the mechanics of post plugin resolution when
plugins are effectively installed into an application, i.e. unpacked.

I don't think think this is feasible right now. I'm pretty sure some
refactoring in Grails core would be required, but it makes sense in my
mind to have an abstraction over installed plugins and in-place
plugins that a user may be able to provide a git-based implementation
for.

Anyway, it's just an idea. There's nothing on the roadmap for it.

Hope that explains things,

Thank you, Peter. That explains everything. :)


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email





Loading...