You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Jacopo Cappellato <ja...@hotwaxmedia.com> on 2013/08/20 09:48:11 UTC

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



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

Posted by Pierre Smits <pi...@gmail.com>.
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 <
jacopo.cappellato@hotwaxmedia.com> 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
>
>
>

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

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
Hi Taher,

On Aug 20, 2013, at 12:53 PM, Taher Alkhateeb <sl...@gmail.com> 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


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

Posted by Taher Alkhateeb <sl...@gmail.com>.
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" <
jacopo.cappellato@hotwaxmedia.com> 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
>
>
>

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

Posted by Jacques Le Roux <ja...@les7arts.com>.
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" <de...@me.com>
To: <de...@ofbiz.apache.org>
Cc: <de...@ofbiz.apache.org>
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 <ja...@les7arts.com> 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" <ja...@hotwaxmedia.com>
>> To: <de...@ofbiz.apache.org>
>> 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
>>> 
>>> 
>>> 
>

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

Posted by David E Jones <de...@me.com>.
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 <ja...@les7arts.com> 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" <ja...@hotwaxmedia.com>
> To: <de...@ofbiz.apache.org>
> 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
>> 
>> 
>> 

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

Posted by Jacques Le Roux <ja...@les7arts.com>.
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" <ja...@hotwaxmedia.com>
To: <de...@ofbiz.apache.org>
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
> 
> 
>