Skip to content

Commit

Permalink
Add a less compiler to the build folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
realityking committed Sep 1, 2012
1 parent b7a025e commit 619af17
Show file tree
Hide file tree
Showing 5 changed files with 4,157 additions and 0 deletions.
74 changes: 74 additions & 0 deletions build/generatecss.php
Original file line number Diff line number Diff line change
@@ -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();
Loading

0 comments on commit 619af17

Please sign in to comment.