Skip to content

Commit 180d459

Browse files
Merge pull request #986 from magento-frontend/MAGETWO-66799
Story - MAGETWO-66799 Remove legacy implementation of static content deployment
2 parents 26fd5fb + f892baf commit 180d459

File tree

67 files changed

+948
-3334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+948
-3334
lines changed

app/code/Magento/Deploy/Collector/Collector.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111
use Magento\Framework\View\Asset\PreProcessor\FileNameResolver;
1212

1313
/**
14-
* Class Collector
14+
* Deployable files collector
1515
*
16-
* Default implementation uses Source Pool object which provides collection of static files sources
17-
*
18-
* @see SourcePool
16+
* Default implementation uses Source Pool object (@see SourcePool)
1917
*/
2018
class Collector implements CollectorInterface
2119
{

app/code/Magento/Deploy/Collector/CollectorInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
* Interface CollectorInterface
1212
*
1313
* Collector returns packages with files which share same properties (e.g. area, theme, locale, etc)
14-
*
15-
* @api
1614
*/
1715
interface CollectorInterface
1816
{

app/code/Magento/Deploy/Config/BundleConfig.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99
use Magento\Framework\View\Design\Theme\ThemeProviderInterface;
1010

1111
/**
12-
* Class BundleConfig
12+
* Static files bundling configuration
1313
*
1414
* Use this to get configuration settings related to JavaScript built-in bundling
15-
*
16-
* @api
1715
*/
1816
class BundleConfig
1917
{

app/code/Magento/Deploy/Console/ConsoleLogger.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
use Magento\Framework\Filesystem\Directory\ReadInterface;
1616

1717
/**
18-
* Class ConsoleLogger
19-
*
20-
* @api
18+
* PSR logger implementation for CLI
2119
*/
2220
class ConsoleLogger extends AbstractLogger
2321
{

app/code/Magento/Deploy/Console/Command/DeployStaticOptions.php renamed to app/code/Magento/Deploy/Console/DeployStaticOptions.php

Lines changed: 88 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
namespace Magento\Deploy\Console\Command;
7+
namespace Magento\Deploy\Console;
88

99
use Symfony\Component\Console\Input\InputOption;
1010
use Symfony\Component\Console\Input\InputArgument;
1111

1212
/**
13-
* Class DeployStaticOptions
13+
* Static Content Deployment Options helper
1414
*
1515
* This class contains the list options and their related constants,
16-
* which must be used to refer to static content deployment CLI commands arguments.
17-
*
18-
* @api
16+
* which can be used for static content deployment CLI command
1917
*/
2018
class DeployStaticOptions
2119
{
@@ -132,9 +130,18 @@ class DeployStaticOptions
132130
* Deploy static command options list
133131
*
134132
* @return array
135-
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
136133
*/
137134
public function getOptionsList()
135+
{
136+
return array_merge($this->getBasicOptions(), $this->getSkipOptions());
137+
}
138+
139+
/**
140+
* Basic options
141+
*
142+
* @return array
143+
*/
144+
private function getBasicOptions()
138145
{
139146
return [
140147
new InputOption(
@@ -144,52 +151,25 @@ public function getOptionsList()
144151
'Deploy files in any mode.'
145152
),
146153
new InputOption(
147-
self::NO_JAVASCRIPT,
148-
null,
149-
InputOption::VALUE_NONE,
150-
'Do not deploy JavaScript files.'
151-
),
152-
new InputOption(
153-
self::NO_CSS,
154-
null,
155-
InputOption::VALUE_NONE,
156-
'Do not deploy CSS files.'
157-
),
158-
new InputOption(
159-
self::NO_LESS,
160-
null,
161-
InputOption::VALUE_NONE,
162-
'Do not deploy LESS files.'
163-
),
164-
new InputOption(
165-
self::NO_IMAGES,
166-
null,
167-
InputOption::VALUE_NONE,
168-
'Do not deploy images.'
169-
),
170-
new InputOption(
171-
self::NO_FONTS,
172-
null,
173-
InputOption::VALUE_NONE,
174-
'Do not deploy font files.'
175-
),
176-
new InputOption(
177-
self::NO_HTML,
178-
null,
179-
InputOption::VALUE_NONE,
180-
'Do not deploy HTML files.'
154+
self::STRATEGY,
155+
'-s',
156+
InputOption::VALUE_OPTIONAL,
157+
'Deploy files using specified strategy.',
158+
'quick'
181159
),
182160
new InputOption(
183-
self::NO_MISC,
184-
null,
185-
InputOption::VALUE_NONE,
186-
'Do not deploy files of other types (.md, .jbf, .csv, etc.).'
161+
self::AREA,
162+
'-a',
163+
InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
164+
'Generate files only for the specified areas.',
165+
['all']
187166
),
188167
new InputOption(
189-
self::NO_HTML_MINIFY,
168+
self::EXCLUDE_AREA,
190169
null,
191-
InputOption::VALUE_NONE,
192-
'Do not minify HTML files.'
170+
InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
171+
'Do not generate files for the specified areas.',
172+
['none']
193173
),
194174
new InputOption(
195175
self::THEME,
@@ -219,20 +199,6 @@ public function getOptionsList()
219199
'Do not generate files for the specified languages.',
220200
['none']
221201
),
222-
new InputOption(
223-
self::AREA,
224-
'-a',
225-
InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
226-
'Generate files only for the specified areas.',
227-
['all']
228-
),
229-
new InputOption(
230-
self::EXCLUDE_AREA,
231-
null,
232-
InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
233-
'Do not generate files for the specified areas.',
234-
['none']
235-
),
236202
new InputOption(
237203
self::JOBS_AMOUNT,
238204
'-j',
@@ -247,18 +213,72 @@ public function getOptionsList()
247213
'Create symlinks for the files of those locales, which are passed for deployment, '
248214
. 'but have no customizations'
249215
),
250-
new InputOption(
251-
self::STRATEGY,
252-
'-s',
253-
InputOption::VALUE_OPTIONAL,
254-
'Deploy files using specified strategy.',
255-
'quick'
256-
),
257216
new InputArgument(
258217
self::LANGUAGES_ARGUMENT,
259218
InputArgument::IS_ARRAY,
260219
'Space-separated list of ISO-636 language codes for which to output static view files.'
261220
),
262221
];
263222
}
223+
224+
/**
225+
* Additional options
226+
*
227+
* Used to re-deploy specific types of static files
228+
*
229+
* @return array
230+
*/
231+
private function getSkipOptions()
232+
{
233+
return [
234+
new InputOption(
235+
self::NO_JAVASCRIPT,
236+
null,
237+
InputOption::VALUE_NONE,
238+
'Do not deploy JavaScript files.'
239+
),
240+
new InputOption(
241+
self::NO_CSS,
242+
null,
243+
InputOption::VALUE_NONE,
244+
'Do not deploy CSS files.'
245+
),
246+
new InputOption(
247+
self::NO_LESS,
248+
null,
249+
InputOption::VALUE_NONE,
250+
'Do not deploy LESS files.'
251+
),
252+
new InputOption(
253+
self::NO_IMAGES,
254+
null,
255+
InputOption::VALUE_NONE,
256+
'Do not deploy images.'
257+
),
258+
new InputOption(
259+
self::NO_FONTS,
260+
null,
261+
InputOption::VALUE_NONE,
262+
'Do not deploy font files.'
263+
),
264+
new InputOption(
265+
self::NO_HTML,
266+
null,
267+
InputOption::VALUE_NONE,
268+
'Do not deploy HTML files.'
269+
),
270+
new InputOption(
271+
self::NO_MISC,
272+
null,
273+
InputOption::VALUE_NONE,
274+
'Do not deploy files of other types (.md, .jbf, .csv, etc.).'
275+
),
276+
new InputOption(
277+
self::NO_HTML_MINIFY,
278+
null,
279+
InputOption::VALUE_NONE,
280+
'Do not minify HTML files.'
281+
)
282+
];
283+
}
264284
}

app/code/Magento/Deploy/Console/InputValidator.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
namespace Magento\Deploy\Console;
77

88
use Magento\Setup\Console\Command\DeployStaticContentCommand;
9-
use Magento\Deploy\Console\Command\DeployStaticOptions as Options;
9+
use Magento\Deploy\Console\DeployStaticOptions as Options;
1010
use Magento\Framework\Validator\Locale;
1111
use Symfony\Component\Console\Input\InputInterface;
1212

1313
/**
14-
* Class InputValidator
15-
*
16-
* @api
14+
* Command input arguments validator class
1715
*/
1816
class InputValidator
1917
{
@@ -84,7 +82,7 @@ public function validate(InputInterface $input)
8482
$input->getOption(Options::EXCLUDE_THEME)
8583
);
8684
$this->checkLanguagesInput(
87-
$input->getArgument(DeployStaticContentCommand::LANGUAGES_ARGUMENT) ?: ['all'],
85+
$input->getArgument(Options::LANGUAGES_ARGUMENT) ?: ['all'],
8886
$input->getOption(Options::EXCLUDE_LANGUAGE)
8987
);
9088
}

app/code/Magento/Deploy/Model/Deploy/DeployInterface.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)