-
Notifications
You must be signed in to change notification settings - Fork 0
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 in README. Document digipolis:package-project Read properties first if available. Fix use statements. Add command traits.
- Loading branch information
Showing
10 changed files
with
198 additions
and
47 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\Commands; | ||
|
||
trait PackageProject | ||
{ | ||
|
||
use \DigipolisGent\Robo\Task\Package\Traits\PackageProjectTrait; | ||
|
||
public function digipolisPackageProject($archiveFile, $dir = null, $opts = ['ignore|i' => '']) | ||
{ | ||
if (is_callable([$this, 'readProperties'])) { | ||
$this->readProperties(); | ||
} | ||
$this->taskPackageProject($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,16 @@ | ||
<?php | ||
|
||
namespace DigipolisGent\Robo\Task\Package\Commands; | ||
|
||
trait ThemeClean | ||
{ | ||
use \DigipolisGent\Robo\Task\Package\Traits\ThemeCleanTrait; | ||
|
||
public function digipolisThemeClean($dir = null) | ||
{ | ||
if (is_callable([$this, 'readProperties'])) { | ||
$this->readProperties(); | ||
} | ||
$this->taskThemeClean($dir)->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,16 @@ | ||
<?php | ||
|
||
namespace DigipolisGent\Robo\Task\Package\Commands; | ||
|
||
trait ThemeCompile | ||
{ | ||
use \DigipolisGent\Robo\Task\Package\Traits\ThemeCompileTrait; | ||
|
||
public function digipolisThemeCompile($dir = null, $command = 'compile') | ||
{ | ||
if (is_callable([$this, 'readProperties'])) { | ||
$this->readProperties(); | ||
} | ||
$this->taskThemeCompile($dir, $command)->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\Commands; | ||
|
||
trait loadCommands | ||
{ | ||
use PackageProject; | ||
use ThemeClean; | ||
use ThemeCompile; | ||
} |
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\Traits; | ||
|
||
use DigipolisGent\Robo\Task\Package\PackageProject; | ||
|
||
trait PackageProjectTrait | ||
{ | ||
/** | ||
* Creates a PackageProject 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\PackageProject | ||
* The package project task. | ||
*/ | ||
protected function taskPackageProject($archiveFile, $dir = null) | ||
{ | ||
return $this->task(PackageProject::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,22 @@ | ||
<?php | ||
|
||
namespace DigipolisGent\Robo\Task\Package\Traits; | ||
|
||
use DigipolisGent\Robo\Task\Package\ThemeClean; | ||
|
||
trait ThemeCleanTrait | ||
{ | ||
/** | ||
* Creates a ThemeClean task. | ||
* | ||
* @param string $dir | ||
* The directory of the theme to clean, defaults to the current directory. | ||
* | ||
* @return \DigipolisGent\Robo\Task\Package\ThemeClean | ||
* The theme clean task. | ||
*/ | ||
protected function taskThemeClean($dir = null) | ||
{ | ||
return $this->task(ThemeClean::class, $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,25 @@ | ||
<?php | ||
|
||
namespace DigipolisGent\Robo\Task\Package\Traits; | ||
|
||
use DigipolisGent\Robo\Task\Package\ThemeCompile; | ||
|
||
trait ThemeCompileTrait | ||
{ | ||
/** | ||
* Creates a ThemeCompile task. | ||
* | ||
* @param string $dir | ||
* The directory of the theme to compile. Defaults to the current | ||
* directory. | ||
* @param string $command | ||
* The grunt/gulp command to execute. Defaults to 'compile'. | ||
* | ||
* @return \DigipolisGent\Robo\Task\Package\ThemeCompile | ||
* The theme compile task. | ||
*/ | ||
protected function taskThemeCompile($dir = null, $command = 'compile') | ||
{ | ||
return $this->task(ThemeCompile::class, $dir, $command); | ||
} | ||
} |
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