Quantcast

Adding jar files to the classpath

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

Adding jar files to the classpath

Merlyn Albery-Speyer
Hey all,

I use Grape fairly regularly and big itch for me is when I have to
launch my scripts like this:

groovy -cp ojbc14.jar:mail.jar:activation.jar myscript.groovy

Any objection to me submitting a patch that would achieve something like this?

@Grab(file='ojdbc14.jar')

Cheers,
Merlyn

---------------------------------------------------------------------
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

Re: Adding jar files to the classpath

Hamlet D'Arcy
sounds good to me. i've been wanting to learn about grapes more so i
can probably take a look at the patch.

Is there similar functionality in maven, gradle or ivy? Can we align
our syntax with theirs?

--
Hamlet D'Arcy
[hidden email]


On Sat, Dec 11, 2010 at 7:13 AM, Merlyn Albery-Speyer
<[hidden email]> wrote:

> Hey all,
>
> I use Grape fairly regularly and big itch for me is when I have to
> launch my scripts like this:
>
> groovy -cp ojbc14.jar:mail.jar:activation.jar myscript.groovy
>
> Any objection to me submitting a patch that would achieve something like this?
>
> @Grab(file='ojdbc14.jar')
>
> Cheers,
> Merlyn
>
> ---------------------------------------------------------------------
> 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

Re: Adding jar files to the classpath

John Hurst-2
In reply to this post by Merlyn Albery-Speyer
This sounds like a logical enhancement to Grapes. It parallels Gradle's "files()" dependency declaration. 

It would be nice (to an anal purist like me) if any Grape mechanism is made as consistent as possible with Gradle and Ivy. It's something of a pity that Gradle and Ivy are already inconsistent with each other! :-)

E.g.

Ivy:
  <dependency org="com.oracle" name="ojdbc14" rev="10.2.0.3.0" conf="compile->master(*);runtime->runtime(*)"/>

Gradle:
  compile group: "com.oracle", name: "ojdbc14", version: "10.2.0.3.0"

Grapes:
  @Grab(group="com.oracle", module="ojdbc14", version="10.2.0.3.0")

I love them anyway. :-)

John Hurst
Wellington, New Zealand  

On Sat, Dec 11, 2010 at 7:13 PM, Merlyn Albery-Speyer <[hidden email]> wrote:
Hey all,

I use Grape fairly regularly and big itch for me is when I have to
launch my scripts like this:

groovy -cp ojbc14.jar:mail.jar:activation.jar myscript.groovy

Any objection to me submitting a patch that would achieve something like this?

@Grab(file='ojdbc14.jar')

Cheers,
Merlyn

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

   http://xircles.codehaus.org/manage_email





--
Life is interfering with my game
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Adding jar files to the classpath

Merlyn Albery-Speyer
On Fri, Dec 10, 2010 at 11:01 PM, John Hurst <[hidden email]> wrote:

> It's something of a pity that
> Gradle and Ivy are already inconsistent with each other! :-)
> E.g.
> Ivy:
>   <dependency org="com.oracle" name="ojdbc14" rev="10.2.0.3.0"
> conf="compile->master(*);runtime->runtime(*)"/>
> Gradle:
>   compile group: "com.oracle", name: "ojdbc14", version: "10.2.0.3.0"
> Grapes:
>   @Grab(group="com.oracle", module="ojdbc14", version="10.2.0.3.0")

I think these differences are only (or need only be) documentation
deep. Grape already supports a number of variations:

"There are synonyms for these parameters. Submitting more than one is
a runtime exception.

    * group:, groupId:, organisation:, organization:, org:
    * module:, artifactId:, artifact:
    * version:, revision:, rev:
    * conf:, scope:, configuration:"

---------------------------------------------------------------------
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

Re: Adding jar files to the classpath

Merlyn Albery-Speyer
In reply to this post by Hamlet D'Arcy
On Fri, Dec 10, 2010 at 10:50 PM, Hamlet D'Arcy <[hidden email]> wrote:
> sounds good to me. i've been wanting to learn about grapes more so i
> can probably take a look at the patch.

The last time I edited the Grape code I resisted any kind of
refactoring as I feared it would obscure my patch and reduce it's
chances of acceptance. I really would like to clean up some of the
code though. Perhaps that would be best done as a separate patch?

---------------------------------------------------------------------
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

Re: Adding jar files to the classpath

Merlyn Albery-Speyer
In reply to this post by Hamlet D'Arcy
On Fri, Dec 10, 2010 at 10:50 PM, Hamlet D'Arcy <[hidden email]> wrote:
> Is there similar functionality in maven, gradle or ivy? Can we align
> our syntax with theirs?

AFAIK the closest in Ivy is using a <filesystem> resolver in the ivy
config, and the closest thing in gradle is the flat directory resolver
syntax. Gradle's is the nearest:

flatDir name: 'localRepository', dirs: 'lib'

Possibly this in addition then?

@Grab(dir="lib')

So many options..

---------------------------------------------------------------------
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

Re: Adding jar files to the classpath

Hamlet D'Arcy
In reply to this post by Merlyn Albery-Speyer
> The last time I edited the Grape code I resisted any kind of
> refactoring as I feared it would obscure my patch and reduce it's
> chances of acceptance. I really would like to clean up some of the
> code though. Perhaps that would be best done as a separate patch?

That would be best, in my opinion. What is the test coverage like in that area?
Hopefully high already.


On Sat, Dec 11, 2010 at 8:12 AM, Merlyn Albery-Speyer
<[hidden email]> wrote:

> On Fri, Dec 10, 2010 at 10:50 PM, Hamlet D'Arcy <[hidden email]> wrote:
>> sounds good to me. i've been wanting to learn about grapes more so i
>> can probably take a look at the patch.
>
> The last time I edited the Grape code I resisted any kind of
> refactoring as I feared it would obscure my patch and reduce it's
> chances of acceptance. I really would like to clean up some of the
> code though. Perhaps that would be best done as a separate patch?
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>



--
Hamlet D'Arcy
[hidden 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

Re: Adding jar files to the classpath

Russel Winder
In reply to this post by Merlyn Albery-Speyer
On Fri, 2010-12-10 at 23:12 -0800, Merlyn Albery-Speyer wrote:

> The last time I edited the Grape code I resisted any kind of
> refactoring as I feared it would obscure my patch and reduce it's
> chances of acceptance. I really would like to clean up some of the
> code though. Perhaps that would be best done as a separate patch?

This sounds like tools interfering for the worse in workflow.  Given
that Groovy is supposed to move from Subversion to Git, mayhap do
everything in a published Git clone so that you can have multiple
concurrent branches that people can then pull from to try things out?

If opportunities for removing redundant code are being lost then the
tools are failing.
--
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:[hidden email]
41 Buckmaster Road    m: +44 7770 465 077   xmpp: [hidden email]
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Adding jar files to the classpath

Robert Kleemann
This post has NOT been accepted by the mailing list yet.
In reply to this post by Merlyn Albery-Speyer
Any news on the "@Grab(file="foo.jar") patch?

I've been looking for how to do this and would really be interested in this feature.

http://stackoverflow.com/questions/6003609/make-groovy-script-grab-a-jar-off-the-filesystem-like-grape

Also, any news on whether this will be a small patch or a large refactor?  I may have to back patch an older version of groovy for our intranet.

Robert.
Loading...