Example about tasks parameters

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

Example about tasks parameters

Jacques Le Roux
Administrator
Hi,

Maybe it's an old habit, like I used ant -p (which was quite faster), I rely on "gradlew ta" to look for tasks and their parameters rather than
searching in the README.md file

Unfortunately the "Rules" part (patterns) misses examples about tasks parameters I suggest to add at least one example:

Index: build.gradle
===================================================================
--- build.gradle    (revision 1763752)
+++ build.gradle    (working copy)
@@ -833,7 +833,7 @@
   * Rules-based OFBiz server commands
   * ======================================================== */

-tasks.addRule('Pattern: ofbiz <Commands>: Execute OFBiz startup commands') { String taskName ->
+tasks.addRule('Pattern: ofbiz <Commands>: Execute OFBiz startup commands, eg "ofbiz --start --portoffset 10000"') { String taskName ->
      if (taskName ==~ /^ofbiz\s.*/ || taskName == 'ofbiz') {
          def arguments = (taskName - 'ofbiz').toLowerCase().tokenize(' ')
          createOfbizCommandTask(taskName, arguments, jvmArguments, false)

Jacques

Reply | Threaded
Open this post in threaded view
|

Re: Example about tasks parameters

taher
I like to think of documentation to be similar to programming in that you
start at high level and go to low level details. I think your dependence on
only one source "gradlew tasks" and therefore wanting to put all the
documentation with examples in there would make the output very verbose.

Take for example the following
- running "git help" vs running "man git"
- running "svn help" vs running "svn help commit"
- running "java -help" vs
https://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html

Documentation needs to be broken down into different levels of details. I
think the code example in your patch is a detail that should not be exposed
through "gradlew tasks". In fact, it is very important for users to read
README.md to understand what is a "server command" and its syntax which is
defined through gradle rule-tasks. Hence I think "gradlew tasks" is really
there just as a quick reminder of the kind of tasks available, not how to
use them.


On Sat, Oct 8, 2016 at 12:00 PM, Jacques Le Roux <
[hidden email]> wrote:

> Hi,
>
> Maybe it's an old habit, like I used ant -p (which was quite faster), I
> rely on "gradlew ta" to look for tasks and their parameters rather than
> searching in the README.md file
>
> Unfortunately the "Rules" part (patterns) misses examples about tasks
> parameters I suggest to add at least one example:
>
> Index: build.gradle
> ===================================================================
> --- build.gradle    (revision 1763752)
> +++ build.gradle    (working copy)
> @@ -833,7 +833,7 @@
>   * Rules-based OFBiz server commands
>   * ======================================================== */
>
> -tasks.addRule('Pattern: ofbiz <Commands>: Execute OFBiz startup
> commands') { String taskName ->
> +tasks.addRule('Pattern: ofbiz <Commands>: Execute OFBiz startup commands,
> eg "ofbiz --start --portoffset 10000"') { String taskName ->
>      if (taskName ==~ /^ofbiz\s.*/ || taskName == 'ofbiz') {
>          def arguments = (taskName - 'ofbiz').toLowerCase().tokenize(' ')
>          createOfbizCommandTask(taskName, arguments, jvmArguments, false)
>
> Jacques
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Example about tasks parameters

Jacques Le Roux
Administrator
OK got it, I'll use g "ofbiz --help"

Thanks

Jacques

Le 09/10/2016 à 09:34, Taher Alkhateeb a écrit :

> I like to think of documentation to be similar to programming in that you
> start at high level and go to low level details. I think your dependence on
> only one source "gradlew tasks" and therefore wanting to put all the
> documentation with examples in there would make the output very verbose.
>
> Take for example the following
> - running "git help" vs running "man git"
> - running "svn help" vs running "svn help commit"
> - running "java -help" vs
> https://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html
>
> Documentation needs to be broken down into different levels of details. I
> think the code example in your patch is a detail that should not be exposed
> through "gradlew tasks". In fact, it is very important for users to read
> README.md to understand what is a "server command" and its syntax which is
> defined through gradle rule-tasks. Hence I think "gradlew tasks" is really
> there just as a quick reminder of the kind of tasks available, not how to
> use them.
>
>
> On Sat, Oct 8, 2016 at 12:00 PM, Jacques Le Roux <
> [hidden email]> wrote:
>
>> Hi,
>>
>> Maybe it's an old habit, like I used ant -p (which was quite faster), I
>> rely on "gradlew ta" to look for tasks and their parameters rather than
>> searching in the README.md file
>>
>> Unfortunately the "Rules" part (patterns) misses examples about tasks
>> parameters I suggest to add at least one example:
>>
>> Index: build.gradle
>> ===================================================================
>> --- build.gradle    (revision 1763752)
>> +++ build.gradle    (working copy)
>> @@ -833,7 +833,7 @@
>>    * Rules-based OFBiz server commands
>>    * ======================================================== */
>>
>> -tasks.addRule('Pattern: ofbiz <Commands>: Execute OFBiz startup
>> commands') { String taskName ->
>> +tasks.addRule('Pattern: ofbiz <Commands>: Execute OFBiz startup commands,
>> eg "ofbiz --start --portoffset 10000"') { String taskName ->
>>       if (taskName ==~ /^ofbiz\s.*/ || taskName == 'ofbiz') {
>>           def arguments = (taskName - 'ofbiz').toLowerCase().tokenize(' ')
>>           createOfbizCommandTask(taskName, arguments, jvmArguments, false)
>>
>> Jacques
>>
>>