From 2ffb24e7ec1dc89fee2c2bed6b8f0cc71b7be6d2 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 30 Sep 2020 15:42:29 -0700 Subject: [PATCH] Greenwich - Switch to composer-compile-lib --- Civi/Compile/Scss.php | 49 ----------------------------- ext/greenwich/composer.compile.json | 9 +++--- 2 files changed, 4 insertions(+), 54 deletions(-) delete mode 100644 Civi/Compile/Scss.php diff --git a/Civi/Compile/Scss.php b/Civi/Compile/Scss.php deleted file mode 100644 index b695a89ce2..0000000000 --- a/Civi/Compile/Scss.php +++ /dev/null @@ -1,49 +0,0 @@ -addImportPath($include); - } - - if (empty($task['scss-files'])) { - throw new \InvalidArgumentException("Invalid task: required argument 'scss-files' is missing"); - } - foreach ($task['scss-files'] as $inputFile => $outputFile) { - if (!file_exists($inputFile)) { - throw new \InvalidArgumentException("File does not exist: " . $inputFile); - } - $inputScss = file_get_contents($inputFile); - $css = $scssCompiler->compile($inputScss); - $autoprefixer = new \Padaliyajay\PHPAutoprefixer\Autoprefixer($css); - - if (!file_exists(dirname($outputFile))) { - mkdir(dirname($outputFile), 0777, TRUE); - } - $outputCss = $autoprefixer->compile(); - if (!file_put_contents($outputFile, $outputCss)) { - throw new \RuntimeException("Failed to write file: $outputFile"); - } - } - } - -} diff --git a/ext/greenwich/composer.compile.json b/ext/greenwich/composer.compile.json index 310523df0c..5ddfeb1553 100644 --- a/ext/greenwich/composer.compile.json +++ b/ext/greenwich/composer.compile.json @@ -3,13 +3,12 @@ { "title": "Greenwich CSS (dist/bootstrap3.css)", "run": [ - "@php-eval mkdir('extern/select2', 0777, TRUE);", - "@php-eval $ok = copy('../../bower_components/select2/select2-bootstrap.css', 'extern/select2/select2-bootstrap.scss'); exit($ok?0:1);", - "@php-method \\Civi\\Compile\\Scss::build" + "@php-eval \\CCL::copy('../../bower_components/select2/select2-bootstrap.css', 'extern/select2/select2-bootstrap.scss');", + "@php-method \\CCL\\Tasks::scss" ], "watch-files": ["scss", "../../bower_components/select2/select2-bootstrap.css"], - "scss-files": {"scss/main.scss": "dist/bootstrap3.css"}, - "scss-includes": ["scss", "extern/bootstrap3/assets/stylesheets", "extern/select2"] + "scss-files": {"dist/bootstrap3.css": "scss/main.scss"}, + "scss-imports": ["scss", "extern/bootstrap3/assets/stylesheets", "extern/select2"] } ] } -- 2.25.1