X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=buildSDK%2Fless-bootstrap-compiler.php;h=be9fce7fadbc43b830181d8d07d1a02d21683c25;hb=fc32d3336ffe6a4ac93549dab21fd04b7d7056d3;hp=e4c4e187e18d462a062413e5555dfd73ac0be40e;hpb=599f2080c1fb09613e4d0d20c21effbd338a7672;p=roojs1 diff --git a/buildSDK/less-bootstrap-compiler.php b/buildSDK/less-bootstrap-compiler.php index e4c4e187e1..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', @@ -44,23 +53,11 @@ foreach ($files as $src => $file){ $variable = "{$dir}variables.less"; - if(file_exists($variable)){ - echo "exist??"; - echo "\n"; - - echo filemtime($variable); - - echo "\n"; - + if(file_exists($variable) && filemtime("{$dir}variables.less") > filemtime($css)){ continue; } - echo "not exist??"; - exit; - - if(filemtime("{$dir}variables.less") > filemtime($css)){ - continue; - } + $isLatest = true; foreach(scandir($dir) as $f) { @@ -68,19 +65,21 @@ foreach ($files as $src => $file){ continue; } - $less = "{$dir}/{$f}"; - - if(filemtime($less) < filemtime($css)){ - 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){ @@ -130,5 +129,4 @@ foreach ($files as $src => $file){ } catch (Exception $ex) { echo "lessphp fatal error: {$ex->getMessage()}\n"; } - } \ No newline at end of file