Proposal: convert all platform dependent scripts under "tools" to Groovy scripts

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Proposal: convert all platform dependent scripts under "tools" to Groovy scripts

Jacopo Cappellato-4
Hi all,

the proposal is about migrating all the *.sh and *bat scripts to *groovy scripts: as you know Groovy scripts can be called from the command line and executed like OS scipts.
The only prerequisite is to have the Groovy jars in the classpath, but this is easy to implement since it is already included in the OFBiz distribution.
In this way we could have less platform dependent files and scripts written in a language that is already widely used in OFBiz.

What do you think?

Jacopo


Reply | Threaded
Open this post in threaded view
|

Re: Proposal: convert all platform dependent scripts under "tools" to Groovy scripts

Pierre Smits
Jacopo,

+1

Just a reminder, the prerequisite must then also be stated in
implementation documentation.

Regards,

Pierre

Pierre Smits


On Tue, Aug 20, 2013 at 9:48 AM, Jacopo Cappellato <
[hidden email]> wrote:

> Hi all,
>
> the proposal is about migrating all the *.sh and *bat scripts to *groovy
> scripts: as you know Groovy scripts can be called from the command line and
> executed like OS scipts.
> The only prerequisite is to have the Groovy jars in the classpath, but
> this is easy to implement since it is already included in the OFBiz
> distribution.
> In this way we could have less platform dependent files and scripts
> written in a language that is already widely used in OFBiz.
>
> What do you think?
>
> Jacopo
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: convert all platform dependent scripts under "tools" to Groovy scripts

Jacques Le Roux
Administrator
In reply to this post by Jacopo Cappellato-4
That sounds like a good idea indeed, I guess that's what Moqui already does, right?

Are there any restrictions/constraints compared with OS scripting languages?

Jacques

----- Original Message -----
From: "Jacopo Cappellato" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, August 20, 2013 9:48 AM
Subject: Proposal: convert all platform dependent scripts under "tools" to Groovy scripts


> Hi all,
>
> the proposal is about migrating all the *.sh and *bat scripts to *groovy scripts: as you know Groovy scripts can be called from the command line and executed like OS scipts.
> The only prerequisite is to have the Groovy jars in the classpath, but this is easy to implement since it is already included in the OFBiz distribution.
> In this way we could have less platform dependent files and scripts written in a language that is already widely used in OFBiz.
>
> What do you think?
>
> Jacopo
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: convert all platform dependent scripts under "tools" to Groovy scripts

taher
In reply to this post by Jacopo Cappellato-4
There is a small possible problem in the implementation. In linux you can
immediatly execute a groovy script starting with a #!/usr/bin/env groovy
Declaration. In windows however you must run java -jar groovy.jar
scriptname. So perhaps a workaround is to have only two shell scripts that
are platform dependent (e.g. groovy.sh and groovy.bat) which point to the
groovy library inside OFBiz and is used to launch all groovy scripts.

I also think groovy.util.CliBuilder might prove very helpful in the
implementation

Taher Alkhateeb
On Aug 20, 2013 10:48 AM, "Jacopo Cappellato" <
[hidden email]> wrote:

> Hi all,
>
> the proposal is about migrating all the *.sh and *bat scripts to *groovy
> scripts: as you know Groovy scripts can be called from the command line and
> executed like OS scipts.
> The only prerequisite is to have the Groovy jars in the classpath, but
> this is easy to implement since it is already included in the OFBiz
> distribution.
> In this way we could have less platform dependent files and scripts
> written in a language that is already widely used in OFBiz.
>
> What do you think?
>
> Jacopo
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: convert all platform dependent scripts under "tools" to Groovy scripts

Jacopo Cappellato-4
Hi Taher,

On Aug 20, 2013, at 12:53 PM, Taher Alkhateeb <[hidden email]> wrote:

> So perhaps a workaround is to have only two shell scripts that
> are platform dependent (e.g. groovy.sh and groovy.bat) which point to the
> groovy library inside OFBiz and is used to launch all groovy scripts.

yes this is what I was thinking too; it is similar to what we are doing already with the ant.sh and ant.bat files.

Jacopo

Reply | Threaded
Open this post in threaded view
|

Re: Proposal: convert all platform dependent scripts under "tools" to Groovy scripts

David E. Jones-2
In reply to this post by Jacques Le Roux

Moqui does use groovy for a lot more, including all expressions (no juel) and all string expansions. Moqui does not have any deployment scripts other than ant/gradle tasks because it deploys as a single war file so it uses whatever the server container uses, ie the Tomcat or Jetty or whatever scripts.

-David


On Aug 20, 2013, at 2:18, Jacques Le Roux <[hidden email]> wrote:

> That sounds like a good idea indeed, I guess that's what Moqui already does, right?
>
> Are there any restrictions/constraints compared with OS scripting languages?
>
> Jacques
>
> ----- Original Message -----
> From: "Jacopo Cappellato" <[hidden email]>
> To: <[hidden email]>
> Sent: Tuesday, August 20, 2013 9:48 AM
> Subject: Proposal: convert all platform dependent scripts under "tools" to Groovy scripts
>
>
>> Hi all,
>>
>> the proposal is about migrating all the *.sh and *bat scripts to *groovy scripts: as you know Groovy scripts can be called from the command line and executed like OS scipts.
>> The only prerequisite is to have the Groovy jars in the classpath, but this is easy to implement since it is already included in the OFBiz distribution.
>> In this way we could have less platform dependent files and scripts written in a language that is already widely used in OFBiz.
>>
>> What do you think?
>>
>> Jacopo
>>
>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: convert all platform dependent scripts under "tools" to Groovy scripts

Jacques Le Roux
Administrator
Thanks for clarifying David,

Indeed, after writing I guessed there is only the war way in Moqui, better that you confirmed.
You did not encouter any restrictions doing so?

Jacques

----- Original Message -----
From: "David E Jones" <[hidden email]>
To: <[hidden email]>
Cc: <[hidden email]>
Sent: Tuesday, August 20, 2013 3:00 PM
Subject: Re: Proposal: convert all platform dependent scripts under "tools" to Groovy scripts


>
> Moqui does use groovy for a lot more, including all expressions (no juel) and all string expansions. Moqui does not have any deployment scripts other than ant/gradle tasks because it deploys as a single war file so it uses whatever the server container uses, ie the Tomcat or Jetty or whatever scripts.
>
> -David
>
>
> On Aug 20, 2013, at 2:18, Jacques Le Roux <[hidden email]> wrote:
>
>> That sounds like a good idea indeed, I guess that's what Moqui already does, right?
>>
>> Are there any restrictions/constraints compared with OS scripting languages?
>>
>> Jacques
>>
>> ----- Original Message -----
>> From: "Jacopo Cappellato" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Tuesday, August 20, 2013 9:48 AM
>> Subject: Proposal: convert all platform dependent scripts under "tools" to Groovy scripts
>>
>>
>>> Hi all,
>>>
>>> the proposal is about migrating all the *.sh and *bat scripts to *groovy scripts: as you know Groovy scripts can be called from the command line and executed like OS scipts.
>>> The only prerequisite is to have the Groovy jars in the classpath, but this is easy to implement since it is already included in the OFBiz distribution.
>>> In this way we could have less platform dependent files and scripts written in a language that is already widely used in OFBiz.
>>>
>>> What do you think?
>>>
>>> Jacopo
>>>
>>>
>>>
>