[jira] [Commented] (OFBIZ-10866) Use the ‘application’ and ‘distribution’ plugins

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

[jira] [Commented] (OFBIZ-10866) Use the ‘application’ and ‘distribution’ plugins

Nicolas Malin (Jira)

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

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

Mathieu,

Since it's about syntax and sugar, I got a quite interesting proposition from the quiet [~pfm.smits] (thanks Pierre): why not renaming the 2 {{gradlew}} and {{gradlew.bat}} scripts to {{ofbiz}} and {{ofbiz.bat}}. It does not solve the "complication" introduced by the {{run}} task but it makes the most used commands clearer:
{noformat}
ofbiz build
ofbiz run
{noformat}
etc.

Of course the other way around would be better:
{noformat}
ofbiz build
ofbiz run
{noformat}
But it would still misses an "s" at the ends of builds and runs. Sorry I could not resist to this private joke :).

Now Iet those who did not read the patch make their own opinion by comparing the pre and post commands (w/o the gradle to ofbiz scripts names change, anyway it does not change the other part of the {{run}} syntax)
{noformat}
-MS Windows: `gradlew ofbiz`
+MS Windows: `gradlew run`

-Unix-like OS: `./gradlew ofbiz`
+Unix-like OS: `./gradlew run`

-`gradlew "ofbiz --help"`
+`gradlew run --args="--help"`

-`gradlew "ofbizDebug --test"`
+`gradlew run --debug-jvm --args="--test"`

-`gradlew "ofbiz --shutdown --portoffset 10000"`
+`gradlew run --args="--shutdown --portoffset 10000"`

-`gradlew ofbiz` (default is --start)
+`gradlew run`

-`gradlew cleanAll loadAll "ofbiz --start --portoffset 10000"`
+`gradlew cleanAll loadAll run --args="--start --portoffset 10000"`

-`gradlew "ofbiz --help"`
+`gradlew run --args="--help"`

-`gradlew "ofbiz --start"`
+`gradlew run`

-`gradlew "ofbiz --shutdown"`
+`gradlew run --args="--shutdown"`

-`gradlew "ofbiz --status"`
+`gradlew run --args="--status"`

-`gradlew "ofbizDebug --start"`
+`gradlew run --debug-jvm`

-`gradlew "ofbiz --start --portoffset 10000"`
+`gradlew run --args="--start --portoffset 10000"`

-`gradlew ofbiz -PjvmArgs="-Xms1024M -Xmx2048M" -Dsome.parameter=hello`
+`gradlew run -PjvmArgs="-Xms1024M -Xmx2048M" -Dsome.parameter=hello`

-`gradlew "ofbiz --load-data readers=<readers-here-comma-separated>"`
+`gradlew run --args="--load-data readers=<readers-here-comma-separated>"`

-`gradlew "ofbiz --load-data readers=seed,seed-initial,ext,ext-demo"`
+`gradlew run --args="--load-data readers=seed,seed-initial,ext,ext-demo"`

-`gradlew "ofbiz --load-data"`
+`gradlew run --args="--load-data"`

-`gradlew "ofbiz --load-data readers=seed"`
+`gradlew run --args="--load-data readers=seed"`

-`gradlew "ofbiz --load-data readers=seed,seed-initial,ext"`
+`gradlew run --args="--load-data readers=seed,seed-initial,ext"`

-`gradlew "ofbiz --load-data readers=seed,seed-initial,ext,ext-test"`
+`gradlew run --args="--load-data readers=seed,seed-initial,ext,ext-test"`

-`gradlew "ofbiz --load-data file=foo/bar/FileNameHere.xml"`
+`gradlew run --args="--load-data file=foo/bar/FileNameHere.xml"`

-`gradlew 'ofbiz --test'`
+`gradlew run --args='--test'`
{noformat}
With the gradle to ofbiz scripts names change it's
{noformat}
-MS Windows: `gradlew ofbiz`
+MS Windows: `ofbiz run`

-Unix-like OS: `./gradlew ofbiz`
+Unix-like OS: `./ofbiz run`

-`gradlew "ofbiz --help"`
+`ofbiz run --args="--help"`

-`gradlew "ofbizDebug --test"`
+`ofbiz run --debug-jvm --args="--test"`

-`gradlew "ofbiz --shutdown --portoffset 10000"`
+`ofbiz run --args="--shutdown --portoffset 10000"`

-`gradlew ofbiz` (default is --start)
+`ofbiz run`

-`gradlew cleanAll loadAll "ofbiz --start --portoffset 10000"`
+`ofbiz cleanAll loadAll run --args="--start --portoffset 10000"`

-`gradlew "ofbiz --help"`
+`ofbiz run --args="--help"`

-`gradlew "ofbiz --start"`
+`ofbiz run`

-`gradlew "ofbiz --shutdown"`
+`ofbiz run --args="--shutdown"`

-`gradlew "ofbiz --status"`
+`ofbiz run --args="--status"`

-`gradlew "ofbizDebug --start"`
+`ofbiz run --debug-jvm`

-`gradlew "ofbiz --start --portoffset 10000"`
+`ofbiz run --args="--start --portoffset 10000"`

-`gradlew ofbiz -PjvmArgs="-Xms1024M -Xmx2048M" -Dsome.parameter=hello`
+`ofbiz run -PjvmArgs="-Xms1024M -Xmx2048M" -Dsome.parameter=hello`

-`gradlew "ofbiz --load-data readers=<readers-here-comma-separated>"`
+`ofbiz run --args="--load-data readers=<readers-here-comma-separated>"`

-`gradlew "ofbiz --load-data readers=seed,seed-initial,ext,ext-demo"`
+`ofbiz run --args="--load-data readers=seed,seed-initial,ext,ext-demo"`

-`gradlew "ofbiz --load-data"`
+`ofbiz run --args="--load-data"`

-`gradlew "ofbiz --load-data readers=seed"`
+`ofbiz run --args="--load-data readers=seed"`

-`gradlew "ofbiz --load-data readers=seed,seed-initial,ext"`
+`ofbiz run --args="--load-data readers=seed,seed-initial,ext"`

-`gradlew "ofbiz --load-data readers=seed,seed-initial,ext,ext-test"`
+`ofbiz run --args="--load-data readers=seed,seed-initial,ext,ext-test"`

-`gradlew "ofbiz --load-data file=foo/bar/FileNameHere.xml"`
+`ofbiz run --args="--load-data file=foo/bar/FileNameHere.xml"`

-`gradlew 'ofbiz --test'`
+`ofbiz run --args='--test'`
 {noformat}
I let everyone make their own opinion...

> Use the ‘application’ and ‘distribution’ plugins
> ------------------------------------------------
>
>                 Key: OFBIZ-10866
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10866
>             Project: OFBiz
>          Issue Type: Improvement
>    Affects Versions: Trunk
>            Reporter: Mathieu Lirzin
>            Assignee: Mathieu Lirzin
>            Priority: Minor
>             Fix For: Upcoming Branch
>
>         Attachments: OFBIZ-10866_Use-the-application-and-distribution-plugin.patch
>
>
> Gradle provides some useful standard plugins for launching and packaging applications via the the {{application}} and {{distribution}} plugins.
>  * The [{{application}} plugin|https://docs.gradle.org/current/userguide/application_plugin.html] provides a {{run}} task which is an alternative to the rule based generated run tasks.  Arbitrary command line arguments can be passed to OFBiz via the {{--args}} option.
>  * The [{{distribution}} plugin|https://docs.gradle.org/current/userguide/distribution_plugin.html] is complementing the {{application}} plugin by providing a straightforward and easy way to distribute OFBiz with its dependencies which is convenient in a deployment context.  After extracting the distribution archive, OFBiz can then be launched via a robust shell or batch script.
> The default targets must be been refined to not build the distribution archives which can be a bit long in the context of OFBiz where we have a lot of dependencies.



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