diff --git a/phing/build.xml b/phing/build.xml index 004139296..5b8ff96cb 100644 --- a/phing/build.xml +++ b/phing/build.xml @@ -7,6 +7,7 @@ + @@ -89,7 +90,7 @@ Executing command in ${target-hooks.${hook-name}.dir}: - + The directory ${target-hooks.${hook-name}.dir} does not exist. Will not run command for ${hook-name}. diff --git a/phing/build.yml b/phing/build.yml index c022850ab..663d5fed6 100644 --- a/phing/build.yml +++ b/phing/build.yml @@ -13,15 +13,25 @@ behat: # - ${docroot}/profiles - ${repo.root}/tests/behat tags: '~ajax' + verbose: ${blt.verbose} blt: update: ignore-existing-file: ${blt.root}/scripts/blt/ignore-existing.txt + # Default verbosity level for tasks. + exec_level: verbose + # If blt.level >= info, this will be changed to true. Affects verbosity of tasks like Drush, Behat. + verbose: false + # From most to least verbose: debug, verbose, info, warn, error. + # Equivalent of using Phing arguments -debug, -verbose, [none], -quiet, -silent + # Note that this does not affect passthru output. + level: info composer: bin: ${repo.root}/vendor/bin deploy: + # If true, dependencies will be built during deploy. If false, you should commit dependencies directly. build-dependencies: true dir: ${repo.root}/deploy exclude_file: ${blt.root}/phing/files/deploy-exclude.txt @@ -44,7 +54,7 @@ drush: uri: ${multisite.name} assume: yes passthru: yes - verbose: yes + verbose: ${blt.verbose} multisite: # The docroot/sites/default directory is used by default. diff --git a/phing/phingcludes/BehatTask.php b/phing/phingcludes/BehatTask.php index f54a50a5d..8d4eb2e47 100644 --- a/phing/phingcludes/BehatTask.php +++ b/phing/phingcludes/BehatTask.php @@ -289,7 +289,7 @@ public function setStrict($strict) */ public function setVerbose($verbose) { - $this->verbose = StringHelper::booleanValue($verbose); + $this->verbose = StringHelper::booleanValue($verbose) || StringHelper::booleanValue((bool) $verbose); } /** @@ -385,6 +385,13 @@ protected function behatExists($executable) return (empty($return) ? false : true); } + /** + * Initialize the task. + */ + public function init() { + $this->setVerbose($this->getProject()->getProperty('behat.verbose')); + } + /** * The main entry point method. * @@ -471,6 +478,10 @@ public function main() $this->options[] = 'verbose'; } + if (Phing::getMsgOutputLevel() >= Project::MSG_VERBOSE) { + $this->options[] = 'verbose'; + } + if ($this->colors) { $this->options[] = 'colors'; } @@ -488,7 +499,12 @@ public function main() $command[] = $this->createOption($name, $value); } $command = implode(' ', $command); - $this->log("Running '$command'"); + if ($this->verbose) { + $this->log("Running '$command'", Project::MSG_INFO); + } + else { + $this->log("Running '$command'", Project::MSG_VERBOSE); + } // Run Behat. $last_line = system($command, $return); diff --git a/phing/phingcludes/VerbosityTask.php b/phing/phingcludes/VerbosityTask.php new file mode 100644 index 000000000..c7a7156cb --- /dev/null +++ b/phing/phingcludes/VerbosityTask.php @@ -0,0 +1,52 @@ +level = $str; + } + + + /** + * The main entry point method. + * + * @return bool + * @throws BuildException + */ + public function main() { + + $map = [ + 'debug' => Project::MSG_DEBUG, + 'verbose' => Project::MSG_VERBOSE, + 'info' => Project::MSG_INFO, + 'warn' => Project::MSG_WARN, + 'error' => Project::MSG_ERR, + ]; + + if (is_numeric($this->level)) { + $this->setLoggerLevel($this->level); + } + elseif (array_key_exists($this->level, $map)) { + $this->setLoggerLevel($map[$this->level]); + } + else { + $this->log("blt.level '{$this->level}' is invalid. Acceptable values are " . implode(', ', array_keys($map)), Project::MSG_ERR); + } + } + public function setLoggerLevel($level) { + $listeners = $this->getProject()->getBuildListeners(); + foreach ($listeners as $listener) { + $listener->setMessageOutputLevel($level); + } + } + +} diff --git a/phing/tasks/acsf.xml b/phing/tasks/acsf.xml index 187a36144..84f8f02bb 100644 --- a/phing/tasks/acsf.xml +++ b/phing/tasks/acsf.xml @@ -2,7 +2,7 @@ Adding acsf module as a dependency. - + Executing initialization command for acsf module. diff --git a/phing/tasks/blt.xml b/phing/tasks/blt.xml index cd7b6ae6a..781fb5d32 100644 --- a/phing/tasks/blt.xml +++ b/phing/tasks/blt.xml @@ -1,10 +1,10 @@ @@ -17,10 +17,10 @@ @@ -52,14 +52,14 @@ Merging BLT's project.yml template with your project's project.yml. This WILL NOT overwrite existing values. - + - + project.yml has been modified. - + + + + + + + + + + + + + + + Executing commands against multisite "${multisite.name}" diff --git a/phing/tasks/setup.xml b/phing/tasks/setup.xml index c7db741b5..1412dcb75 100644 --- a/phing/tasks/setup.xml +++ b/phing/tasks/setup.xml @@ -23,7 +23,7 @@ - + Found PhantomJS at ${phantomjs.bin} @@ -89,11 +89,11 @@ - + - + @@ -115,7 +115,7 @@ Making ${docroot}/sites/default/settings.php writable. Ensuring that blt.settings.php is required by settings.php - + Generating local settings files. @@ -177,8 +177,13 @@ description="Installs a specific Drupal site." depends="setup:drupal:settings, setup:drush:settings, setup:hash-salt"> - Printing drush status. - + + + + Printing drush status. + + + Installing Drupal. @@ -217,7 +222,7 @@ - + @@ -231,7 +236,7 @@ Symlinking ${repo.root}/scripts/git-hooks to ${repo.root}/.git/hooks. - + Making git hooks executable. @@ -251,7 +256,7 @@ Writing hash salt to ${repo.root}/salt.txt - + ${repo.root}/salt.txt already exists. diff --git a/phing/tasks/simplesamlphp.xml b/phing/tasks/simplesamlphp.xml index bed215753..0c5da0929 100644 --- a/phing/tasks/simplesamlphp.xml +++ b/phing/tasks/simplesamlphp.xml @@ -13,7 +13,7 @@ Updating project.yml. - + Creating a symbolic link from ${docroot}/simplesaml to web accessible directory in the simplesamlphp library @@ -31,7 +31,7 @@ diff --git a/phing/tasks/tests.xml b/phing/tasks/tests.xml index 175dd7cca..7ce54de9a 100644 --- a/phing/tasks/tests.xml +++ b/phing/tasks/tests.xml @@ -20,7 +20,7 @@ - + @@ -31,7 +31,7 @@ + level="${blt.exec_level}"/> @@ -81,7 +81,7 @@ @@ -121,8 +121,8 @@ - - + + @@ -141,7 +141,7 @@ description="Check local Drupal installation for security updates."> diff --git a/phing/tasks/validate.xml b/phing/tasks/validate.xml index 6cf4924a4..5f2e970d2 100644 --- a/phing/tasks/validate.xml +++ b/phing/tasks/validate.xml @@ -10,7 +10,7 @@ - + diff --git a/phing/tasks/vm.xml b/phing/tasks/vm.xml index c44a9a2b0..59418b60e 100644 --- a/phing/tasks/vm.xml +++ b/phing/tasks/vm.xml @@ -30,8 +30,8 @@ diff --git a/template/project.yml b/template/project.yml index ba1403fb0..704261b68 100644 --- a/template/project.yml +++ b/template/project.yml @@ -42,13 +42,13 @@ target-hooks: # E.g., ${docroot}/sites/all/themes/custom/mytheme. dir: ${docroot} # E.g., `npm install` or `bower install`. - command: echo 'No frontend setup configured.' + command: echo 'No frontend-setup configured.' # Executed when front end assets should be generated. frontend-build: # E.g., ${docroot}/sites/all/themes/custom/mytheme. dir: ${docroot} # E.g., `npm run build`. - command: echo 'No frontend build configured.' + command: echo 'No frontend-build configured.' # Executed after deployment artifact is created. post-deploy-build: # E.g., ${docroot}/sites/all/themes/custom/mytheme.