X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=buildSDK%2Fless-bootstrap-compiler.php;h=be9fce7fadbc43b830181d8d07d1a02d21683c25;hb=fc32d3336ffe6a4ac93549dab21fd04b7d7056d3;hp=bc30feb683a86f3d17c1cdf2b3c8a008e187396f;hpb=8e499607c506fe69afffe6e795fe715066eae7c0;p=roojs1 diff --git a/buildSDK/less-bootstrap-compiler.php b/buildSDK/less-bootstrap-compiler.php index bc30feb683..be9fce7fad 100644 --- a/buildSDK/less-bootstrap-compiler.php +++ b/buildSDK/less-bootstrap-compiler.php @@ -2,7 +2,8 @@ $cwd = getcwd(); -if (array_pop(explode('/', $cwd)) !== 'roojs1') { +$cc = explode('/', $cwd); +if (array_pop($cc) !== 'roojs1') { echo "this should be run in roojs1 directory...\n"; exit; } @@ -23,6 +24,14 @@ $files = array( 'sourceMapRootpath' => '../less/bootstrap/', 'variables' => array("@import 'variables.less';") ), + "{$rootDir}/roojs1/less/bootstrap/bootstrap-light.less" => array( + 'baseDir' => "{$rootDir}/roojs1/css-bootstrap", + 'name' => 'bootstrap-light.css', + 'minify' => 'bootstrap-light.min.css', + 'sourceMapRootpath' => '../less/bootstrap/', + 'variables' => array("@import 'variables.less';") + ), + "{$rootDir}/roojs1/less/roojs-bootstrap/roojs-bootstrap.less" => array( 'baseDir' => "{$rootDir}/roojs1/css-bootstrap", 'name' => 'roojs-bootstrap-debug.css', @@ -32,6 +41,45 @@ $files = array( ) ); +foreach ($files as $src => $file){ + + $css = "{$file['baseDir']}/{$file['name']}"; + + if(!file_exists($css)){ + continue; + } + + $dir = "{$file['baseDir']}/{$file['sourceMapRootpath']}"; + + $variable = "{$dir}variables.less"; + + if(file_exists($variable) && filemtime("{$dir}variables.less") > filemtime($css)){ + continue; + } + + $isLatest = true; + + foreach(scandir($dir) as $f) { + + if (!strlen($f) || $f[0] == '.') { + continue; + } + + $less = "{$dir}{$f}"; + + if(filemtime($less) > filemtime($css)){ + $isLatest = false; + break; + } + } + + if($isLatest){ + echo "{$css} already up-to-date \n"; + unset($files[$src]); + } + +} + require_once 'HTML/Less.php'; foreach ($files as $src => $file){ @@ -41,10 +89,6 @@ foreach ($files as $src => $file){ continue; } - $css = "{$file['baseDir']}/{$file['name']}"; - - - try { $less = new HTML_Less(); @@ -85,5 +129,4 @@ foreach ($files as $src => $file){ } catch (Exception $ex) { echo "lessphp fatal error: {$ex->getMessage()}\n"; } - } \ No newline at end of file