Permalink
Browse files

Add a less compiler to the build folder.

  • Loading branch information...
1 parent b7a025e commit 619af174220053d1302c8ada2469840821505924 @realityking realityking committed Sep 1, 2012
View
@@ -0,0 +1,74 @@
+<?php
+/**
+ * @package Joomla.Build
+ *
+ * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE.txt
+ */
+
+// Set flag that this is a parent file.
+const _JEXEC = 1;
+
+// Load system defines
+if (file_exists(dirname(__DIR__) . '/defines.php'))
+{
+ require_once dirname(__DIR__) . '/defines.php';
+}
+
+if (!defined('_JDEFINES'))
+{
+ define('JPATH_BASE', dirname(__DIR__));
+ require_once JPATH_BASE . '/includes/defines.php';
+}
+
+require_once JPATH_LIBRARIES . '/import.php';
+
+JLoader::registerPrefix('J', __DIR__ . '/libraries');
+
+require_once JPATH_LIBRARIES . '/cms.php';
+
+// Load the configuration
+require_once JPATH_CONFIGURATION . '/configuration.php';
+
+/**
+ * This script will fetch the update information for all extensions and store
+ * them in the database, speeding up your administrator.
+ *
+ * @package Joomla.Build
+ * @since 3.0
+ */
+class GenerateCss extends JApplicationCli
+{
+ /**
+ * Entry point for the script
+ *
+ * @return void
+ *
+ * @since 3.0
+ */
+ public function doExecute()
+ {
+ $templates = array(
+ JPATH_ADMINISTRATOR . '/templates/isis/less/template.less' => JPATH_ADMINISTRATOR . '/templates/isis/css/template.css',
+ JPATH_ADMINISTRATOR . '/templates/hathor/less/template.less' => JPATH_ADMINISTRATOR . '/templates/hathor/css/template.css',
+ JPATH_ADMINISTRATOR . '/templates/hathor/less/colour_blue.less' => JPATH_ADMINISTRATOR . '/templates/hathor/css/colour_blue.css',
+ JPATH_ADMINISTRATOR . '/templates/hathor/less/colour_standard.less' => JPATH_ADMINISTRATOR . '/templates/hathor/css/colour_standard.css',
+ JPATH_SITE . '/templates/protostar/less/template.less' => JPATH_SITE . '/templates/protostar/css/template.css'
+ );
+ $less = new JLess;
+
+ foreach ($templates as $source => $output)
+ {
+ try
+ {
+ $less->compileFile($source, $output);
+ }
+ catch (Exception $e)
+ {
+ echo $e->getMessage();
+ }
+ }
+ }
+}
+
+JApplicationCli::getInstance('GenerateCss')->execute();
Oops, something went wrong.

0 comments on commit 619af17

Please sign in to comment.