[jira] [Commented] (OFBIZ-10430) Use `in` and spread operator in `gradlewSubprocess`

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

[jira] [Commented] (OFBIZ-10430) Use `in` and spread operator in `gradlewSubprocess`

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-10430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16519039#comment-16519039 ]

Jacques Le Roux commented on OFBIZ-10430:
-----------------------------------------

Hi Mathieu,

As I partly reported at OFBIZ-10428 for the in operator, this does not work on Windows. Also I got an error on line
bq. exec \{ commandLine [gradleRunner, "--no-daemon", *commandList] }
while using
{{gradlew pullPluginSource -PpluginId=ebay}}
with this code
 {code}
def gradlewSubprocess(commandList) {
    def gradleRunner = os.contains('windows') ? 'gradlew.bat' : './gradlew'
    exec { commandLine [gradleRunner, "--no-daemon", *commandList] }
 {code}

 {code}
C:\projectsASF\ofbiz>gradlew pullPluginSource -PpluginId=ebay
:pullPluginFromSvn
:pullPluginSource FAILED

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\projectsASF\ofbiz\build.gradle' line: 1045

* What went wrong:
Execution failed for task ':pullPluginSource'.
> Cannot cast object 'gradlew.bat' with class 'java.lang.String' to class 'int'
 {code}

> Use `in` and spread operator in `gradlewSubprocess`
> ---------------------------------------------------
>
>                 Key: OFBIZ-10430
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10430
>             Project: OFBiz
>          Issue Type: Improvement
>            Reporter: Mathieu Lirzin
>            Assignee: Jacques Le Roux
>            Priority: Minor
>             Fix For: Trunk
>
>         Attachments: OFBIZ-10430_Use-in-and-spread-operator-in-gradlewSubprocess.patch
>
>
> No functional change.  The idea of using the spread operator is to have less mutation involved.  In Groovy, using operator overloads like {{in}} is more idiomatic  than using explicitly the associated method.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)