From 8a0ad52631493a22278385285bded9527a928363 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Fri, 12 Apr 2024 12:28:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 29714dc..8e3ad7a 100644 --- a/README.md +++ b/README.md @@ -45,9 +45,40 @@ task('ultimate_build_run', 'deps' => ['autogen', 'pack_configs', 'ensure_unity_player_settings', 'unity_defines'] ], function() {}); ``` +### Get help and list all tasks + +You can list all tasks and their definition locations using **help** task (yes, it's a task as well): + +``` +./gamectl help +***** task 'help' start ***** + +Usage: + gamectl [OPTIONS] [,,..] [-D PROP1=value [-D PROP2]] + +Available options: + -c specify PHP script to be included (handy for setting props,config options,etc) + -V be super verbose + -q be quite, only system messages + -b batch mode: be super quite, don't even output any system messages + -- pass all options verbatim after this mark + +Available tasks: +--------------------------------- + apk_install_to_device (/Users/ps/dev/skeletor/gamectl.d/client.inc.php@58) +--------------------------------- + apk_run_on_device (/Users/ps/dev/skeletor/gamectl.d/client.inc.php@67) +--------------------------------- + autogen @deps ["unity_defines","cs_autogen","php_autogen"] (/Users/ps/dev/skeletor/gamectl.d/autogen.inc.php@6) +--------------------------------- + bhl_autogen @deps ["bhl_make_upm_package"] (/Users/ps/dev/skeletor/gamectl.d/bhl.inc.php@19) +***** task 'help' done(0/0.01 sec.) ***** +***** All done (0.01 sec.) ***** +``` + ### Tasks documentation -### Task declaration +#### Task declaration Task must be declared using library **task** function as follows: @@ -57,9 +88,9 @@ The task above now can be invoked from the shell as follows: ```./gamectl name``` -### Task aliases +#### Task aliases -Task may have an alias for less typing in the shell: +Task may have an alias for less typing in the shell. To specify an alias one should put it as an **alias** property of a task declaration: ``` task('name', ['alias' => 'n'], @@ -70,16 +101,16 @@ You can invoke the task by the alias as follows: ```./gamectl n``` -### Task dependencies +#### Task dependencies -Task may have an dependencies on other tasks: +Task may have an dependencies on other tasks. To specify all dependencies one should list them in **deps** section of a task declaration: ``` -task('c', ['deps' => ['a', 'b'], +task('c', ['deps' => ['a', 'b']], function() {}); ``` -All dependencies are executed before running the specified task. Running the task above should output something as follows: +All dependencies are executed before running the specified task. Running the task above yields something as follows: ``` ./gamectl c ***** task 'c' start ***** @@ -91,3 +122,11 @@ All dependencies are executed before running the specified task. Running the tas ***** All done (0.18 sec.) ***** ``` +#### Task executed always + +Sometimes it's convenient to define tasks which should be executed every time without explicit invocation. For example for setting the up the default environment, properties, etc. To achieve that one should specify the **always** property for a task: + +``` +task('setup_env', ['always' => true], + function() {}); +```