Skip to content

Commit 90a817f

Browse files
committed
MAGETWO-35298: Deploy script modifies LESS files with "@urls-resolved: true" line(-s)
- added core less file publication
1 parent 481915f commit 90a817f

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

dev/tools/Magento/Tools/Webdev/App/FileAssembler.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\Framework\App;
1010
use Magento\Framework\App\State;
1111
use Magento\Framework\AppInterface;
12+
use Magento\Framework\Filesystem;
1213
use Magento\Tools\Webdev\CliParams;
1314
use Magento\Tools\View\Deployer\Log;
1415
use Magento\Framework\View\Asset\Source;
@@ -18,6 +19,7 @@
1819
use Magento\Framework\App\ObjectManager\ConfigLoader;
1920
use Magento\Framework\View\Asset\SourceFileGeneratorPool;
2021
use Magento\Framework\View\Asset\PreProcessor\ChainFactoryInterface;
22+
use Magento\Framework\App\Filesystem\DirectoryList;
2123

2224
/**
2325
* Class FileAssembler
@@ -77,6 +79,11 @@ class FileAssembler implements AppInterface
7779
*/
7880
private $chainFactory;
7981

82+
/**
83+
* @var Filesystem
84+
*/
85+
private $filesystem;
86+
8087
/**
8188
* @param ObjectManagerInterface $objectManager
8289
* @param Response $response
@@ -88,6 +95,7 @@ class FileAssembler implements AppInterface
8895
* @param \Magento\Framework\View\Asset\SourceFileGeneratorPool $sourceFileGeneratorPoll
8996
* @param \Magento\Tools\View\Deployer\Log $logger
9097
* @param ChainFactoryInterface $chainFactory
98+
* @param Filesystem $filesystem,
9199
*
92100
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
93101
*/
@@ -101,7 +109,8 @@ public function __construct(
101109
Source $assetSource,
102110
SourceFileGeneratorPool $sourceFileGeneratorPoll,
103111
Log $logger,
104-
ChainFactoryInterface $chainFactory
112+
ChainFactoryInterface $chainFactory,
113+
Filesystem $filesystem
105114
) {
106115
$this->response = $response;
107116
$this->params = $params;
@@ -113,6 +122,7 @@ public function __construct(
113122
$this->assetSource = $assetSource;
114123
$this->logger = $logger;
115124
$this->chainFactory = $chainFactory;
125+
$this->filesystem = $filesystem;
116126
}
117127

118128
/**
@@ -152,7 +162,13 @@ public function launch()
152162
]
153163
);
154164

155-
$sourceFileGenerator->generateFileTree($chain);
165+
$processedCoreFile = $sourceFileGenerator->generateFileTree($chain);
166+
167+
$targetDir = $this->filesystem->getDirectoryWrite(DirectoryList::STATIC_VIEW);
168+
$rootDir = $this->filesystem->getDirectoryWrite(DirectoryList::ROOT);
169+
$source = $rootDir->getRelativePath($processedCoreFile);
170+
$destination = $asset->getPath();
171+
$rootDir->copyFile($source, $destination, $targetDir);
156172

157173
$this->logger->logMessage("Done");
158174
}

0 commit comments

Comments
 (0)