-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* develop: Fix code style issues. Document commands. Fix loadTasks Read properties first if available. Add command traits.
- Loading branch information
Showing
10 changed files
with
231 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace DigipolisGent\Robo\Task\Package\Drupal8\Commands; | ||
|
||
trait PackageDrupal8 | ||
{ | ||
|
||
use \DigipolisGent\Robo\Task\Package\Drupal8\Traits\PackageDrupal8Trait; | ||
|
||
public function digipolisPackageDrupal8($archiveFile, $dir = null, $opts = ['ignore|i' => '']) | ||
{ | ||
if (is_callable([$this, 'readProperties'])) { | ||
$this->readProperties(); | ||
} | ||
$this->taskPackageDrupal8($archiveFile, $dir) | ||
->ignoreFileNames(array_map('trim', explode(',', $opts['ignore']))) | ||
->run(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace DigipolisGent\Robo\Task\Package\Drupal8\Commands; | ||
|
||
trait ThemesCleanDrupal8 | ||
{ | ||
use \DigipolisGent\Robo\Task\Package\Drupal8\Traits\ThemesCleanDrupal8Trait; | ||
|
||
public function digipolisThemesCleanDrupal8($themes = '', $dirs = '') | ||
{ | ||
if (is_callable([$this, 'readProperties'])) { | ||
$this->readProperties(); | ||
} | ||
$this->taskThemesCleanDrupal8( | ||
explode(',', $themes), | ||
explode(',', $dirs) | ||
)->run(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace DigipolisGent\Robo\Task\Package\Drupal8\Commands; | ||
|
||
trait ThemesCompileDrupal8 | ||
{ | ||
use \DigipolisGent\Robo\Task\Package\Drupal8\Traits\ThemesCompileDrupal8Trait; | ||
|
||
public function digipolisThemesCompileDrupal8($themes = '', $dirs = '') | ||
{ | ||
if (is_callable([$this, 'readProperties'])) { | ||
$this->readProperties(); | ||
} | ||
$themesWithCommand = []; | ||
foreach (explode(',', $themes) as $theme) { | ||
$parts = explode(':', $theme); | ||
$themesWithCommand[$parts[0]] = isset($parts[1]) | ||
? $parts[1] | ||
: 'compile'; | ||
} | ||
$this->taskThemesCompileDrupal8( | ||
$themesWithCommand, | ||
explode(',', $dirs) | ||
)->run(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace DigipolisGent\Robo\Task\Package\Drupal8\Commands; | ||
|
||
trait loadCommands | ||
{ | ||
use PackageDrupal8; | ||
use ThemesCleanDrupal8; | ||
use ThemesCompileDrupal8; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace DigipolisGent\Robo\Task\Package\Drupal8\Traits; | ||
|
||
use DigipolisGent\Robo\Task\Package\Drupal8\PackageDrupal8; | ||
|
||
trait PackageDrupal8Trait | ||
{ | ||
/** | ||
* Creates a PackageDrupal8 task. | ||
* | ||
* @param string $archiveFile | ||
* The full path and name of the archive file to create. | ||
* @param string $dir | ||
* The directory to package. Defaults to digipolis.root.project, or to the | ||
* current working directory if that's not set. | ||
* | ||
* @return \DigipolisGent\Robo\Task\Package\Drupal8\PackageDrupal8 | ||
* The package project task. | ||
*/ | ||
protected function taskPackageDrupal8($archiveFile, $dir = null) | ||
{ | ||
return $this->task(PackageDrupal8::class, $archiveFile, $dir); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace DigipolisGent\Robo\Task\Package\Drupal8\Traits; | ||
|
||
use DigipolisGent\Robo\Task\Package\Drupal8\ThemesCleanDrupal8; | ||
|
||
trait ThemesCleanDrupal8Trait | ||
{ | ||
/** | ||
* Creates a ThemesCleanDrupal8 task. | ||
* | ||
* @param array $themes | ||
* An array of Drupal theme machine names. Defaults to the keys of the | ||
* digipolis.themes.drupal8 config value. | ||
* @param array $dirs | ||
* The directories in which to search for the themes. Defaults to the | ||
* digipolis.root.project and digipolis.root.web config values, or the | ||
* current working directory if that is not set. | ||
* | ||
* @return \DigipolisGent\Robo\Task\Package\Drupal8\ThemesCleanDrupal8 | ||
* The theme clean task. | ||
*/ | ||
protected function taskThemesCleanDrupal8($themes = [], $dirs = null) | ||
{ | ||
return $this->task(ThemesCleanDrupal8::class, $themes, $dirs); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace DigipolisGent\Robo\Task\Package\Drupal8\Traits; | ||
|
||
use DigipolisGent\Robo\Task\Package\Drupal8\ThemesCompileDrupal8; | ||
|
||
trait ThemesCompileDrupal8Trait | ||
{ | ||
/** | ||
* Creates a ThemesCompileDrupal8 task. | ||
* | ||
* @param array $themes | ||
* An associative array where the keys are the Drupal theme machine names | ||
* and the values are the respective Grunt/Gulp commands to execute. | ||
* Defaults to the digipolis.themes.drupal8 config value. | ||
* @param array $dirs | ||
* The directories in which to search for the themes. Defaults to the | ||
* digipolis.root.project and digipolis.root.web config values, or the | ||
* current working directory if that is not set. | ||
* | ||
* @return \DigipolisGent\Robo\Task\Package\Drupal8\ThemesCompileDrupal8 | ||
* The theme compile task. | ||
*/ | ||
protected function taskThemesCompileDrupal8($themes = [], $dirs = null) | ||
{ | ||
return $this->task(ThemesCompileDrupal8::class, $themes, $dirs); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters