Skip to content

Commit

Permalink
Merge pull request #986 from magento-frontend/MAGETWO-66799
Browse files Browse the repository at this point in the history
Story
- MAGETWO-66799 Remove legacy implementation of static content deployment
  • Loading branch information
VladimirZaets authored Apr 1, 2017
2 parents 26fd5fb + f892baf commit 180d459
Show file tree
Hide file tree
Showing 67 changed files with 948 additions and 3,334 deletions.
6 changes: 2 additions & 4 deletions app/code/Magento/Deploy/Collector/Collector.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
use Magento\Framework\View\Asset\PreProcessor\FileNameResolver;

/**
* Class Collector
* Deployable files collector
*
* Default implementation uses Source Pool object which provides collection of static files sources
*
* @see SourcePool
* Default implementation uses Source Pool object (@see SourcePool)
*/
class Collector implements CollectorInterface
{
Expand Down
2 changes: 0 additions & 2 deletions app/code/Magento/Deploy/Collector/CollectorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
* Interface CollectorInterface
*
* Collector returns packages with files which share same properties (e.g. area, theme, locale, etc)
*
* @api
*/
interface CollectorInterface
{
Expand Down
4 changes: 1 addition & 3 deletions app/code/Magento/Deploy/Config/BundleConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
use Magento\Framework\View\Design\Theme\ThemeProviderInterface;

/**
* Class BundleConfig
* Static files bundling configuration
*
* Use this to get configuration settings related to JavaScript built-in bundling
*
* @api
*/
class BundleConfig
{
Expand Down
4 changes: 1 addition & 3 deletions app/code/Magento/Deploy/Console/ConsoleLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
use Magento\Framework\Filesystem\Directory\ReadInterface;

/**
* Class ConsoleLogger
*
* @api
* PSR logger implementation for CLI
*/
class ConsoleLogger extends AbstractLogger
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@
* See COPYING.txt for license details.
*/

namespace Magento\Deploy\Console\Command;
namespace Magento\Deploy\Console;

use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;

/**
* Class DeployStaticOptions
* Static Content Deployment Options helper
*
* This class contains the list options and their related constants,
* which must be used to refer to static content deployment CLI commands arguments.
*
* @api
* which can be used for static content deployment CLI command
*/
class DeployStaticOptions
{
Expand Down Expand Up @@ -132,9 +130,18 @@ class DeployStaticOptions
* Deploy static command options list
*
* @return array
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function getOptionsList()
{
return array_merge($this->getBasicOptions(), $this->getSkipOptions());
}

/**
* Basic options
*
* @return array
*/
private function getBasicOptions()
{
return [
new InputOption(
Expand All @@ -144,52 +151,25 @@ public function getOptionsList()
'Deploy files in any mode.'
),
new InputOption(
self::NO_JAVASCRIPT,
null,
InputOption::VALUE_NONE,
'Do not deploy JavaScript files.'
),
new InputOption(
self::NO_CSS,
null,
InputOption::VALUE_NONE,
'Do not deploy CSS files.'
),
new InputOption(
self::NO_LESS,
null,
InputOption::VALUE_NONE,
'Do not deploy LESS files.'
),
new InputOption(
self::NO_IMAGES,
null,
InputOption::VALUE_NONE,
'Do not deploy images.'
),
new InputOption(
self::NO_FONTS,
null,
InputOption::VALUE_NONE,
'Do not deploy font files.'
),
new InputOption(
self::NO_HTML,
null,
InputOption::VALUE_NONE,
'Do not deploy HTML files.'
self::STRATEGY,
'-s',
InputOption::VALUE_OPTIONAL,
'Deploy files using specified strategy.',
'quick'
),
new InputOption(
self::NO_MISC,
null,
InputOption::VALUE_NONE,
'Do not deploy files of other types (.md, .jbf, .csv, etc.).'
self::AREA,
'-a',
InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
'Generate files only for the specified areas.',
['all']
),
new InputOption(
self::NO_HTML_MINIFY,
self::EXCLUDE_AREA,
null,
InputOption::VALUE_NONE,
'Do not minify HTML files.'
InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
'Do not generate files for the specified areas.',
['none']
),
new InputOption(
self::THEME,
Expand Down Expand Up @@ -219,20 +199,6 @@ public function getOptionsList()
'Do not generate files for the specified languages.',
['none']
),
new InputOption(
self::AREA,
'-a',
InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
'Generate files only for the specified areas.',
['all']
),
new InputOption(
self::EXCLUDE_AREA,
null,
InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
'Do not generate files for the specified areas.',
['none']
),
new InputOption(
self::JOBS_AMOUNT,
'-j',
Expand All @@ -247,18 +213,72 @@ public function getOptionsList()
'Create symlinks for the files of those locales, which are passed for deployment, '
. 'but have no customizations'
),
new InputOption(
self::STRATEGY,
'-s',
InputOption::VALUE_OPTIONAL,
'Deploy files using specified strategy.',
'quick'
),
new InputArgument(
self::LANGUAGES_ARGUMENT,
InputArgument::IS_ARRAY,
'Space-separated list of ISO-636 language codes for which to output static view files.'
),
];
}

/**
* Additional options
*
* Used to re-deploy specific types of static files
*
* @return array
*/
private function getSkipOptions()
{
return [
new InputOption(
self::NO_JAVASCRIPT,
null,
InputOption::VALUE_NONE,
'Do not deploy JavaScript files.'
),
new InputOption(
self::NO_CSS,
null,
InputOption::VALUE_NONE,
'Do not deploy CSS files.'
),
new InputOption(
self::NO_LESS,
null,
InputOption::VALUE_NONE,
'Do not deploy LESS files.'
),
new InputOption(
self::NO_IMAGES,
null,
InputOption::VALUE_NONE,
'Do not deploy images.'
),
new InputOption(
self::NO_FONTS,
null,
InputOption::VALUE_NONE,
'Do not deploy font files.'
),
new InputOption(
self::NO_HTML,
null,
InputOption::VALUE_NONE,
'Do not deploy HTML files.'
),
new InputOption(
self::NO_MISC,
null,
InputOption::VALUE_NONE,
'Do not deploy files of other types (.md, .jbf, .csv, etc.).'
),
new InputOption(
self::NO_HTML_MINIFY,
null,
InputOption::VALUE_NONE,
'Do not minify HTML files.'
)
];
}
}
8 changes: 3 additions & 5 deletions app/code/Magento/Deploy/Console/InputValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
namespace Magento\Deploy\Console;

use Magento\Setup\Console\Command\DeployStaticContentCommand;
use Magento\Deploy\Console\Command\DeployStaticOptions as Options;
use Magento\Deploy\Console\DeployStaticOptions as Options;
use Magento\Framework\Validator\Locale;
use Symfony\Component\Console\Input\InputInterface;

/**
* Class InputValidator
*
* @api
* Command input arguments validator class
*/
class InputValidator
{
Expand Down Expand Up @@ -84,7 +82,7 @@ public function validate(InputInterface $input)
$input->getOption(Options::EXCLUDE_THEME)
);
$this->checkLanguagesInput(
$input->getArgument(DeployStaticContentCommand::LANGUAGES_ARGUMENT) ?: ['all'],
$input->getArgument(Options::LANGUAGES_ARGUMENT) ?: ['all'],
$input->getOption(Options::EXCLUDE_LANGUAGE)
);
}
Expand Down
28 changes: 0 additions & 28 deletions app/code/Magento/Deploy/Model/Deploy/DeployInterface.php

This file was deleted.

Loading

0 comments on commit 180d459

Please sign in to comment.