buildSDK/less-bootstrap-compiler.php
authoredward <edward@roojs.com>
Thu, 30 Nov 2017 07:14:14 +0000 (15:14 +0800)
committeredward <edward@roojs.com>
Thu, 30 Nov 2017 07:14:14 +0000 (15:14 +0800)
buildSDK/less-bootstrap-compiler.php

index dec00cd..d21d4a8 100644 (file)
@@ -2,17 +2,51 @@
 
 $cwd = getcwd();
 
-if(array_pop(explode('/', $cwd)) !== 'roojs1'){
+if (array_pop(explode('/', $cwd)) !== 'roojs1') {
     echo "this should be run in roojs1 directory...\n";
     exit;
 }
 
- ini_set('include_path', 
-            dirname(__FILE__). '/../:' . 
-        
-            dirname(__FILE__).'/../../pear:' . 
-            ini_get('include_path'));
+ini_set('include_path', 
+    dirname(__FILE__) . '/../:' .
+    dirname(__FILE__) . '/../../pear:' .
+    ini_get('include_path')
+);
+
+$files = array(
+    "roojs1/less/bootstrap/bootstrap.less" => array(
+        "roojs1/css-bootstrap/bootstrap.css",
+        "roojs1/css-bootstrap/bootstrap.min.css"
+    ),
+    "roojs1/less/roojs-bootstrap/roojs-bootstrap.less" => array(
+        "roojs1/css-bootstrap/roojs-bootstrap-debug.css",
+        "roojs1/css-bootstrap/roojs-bootstrap.css"
+    )
+);
 
 require_once 'HTML/Less.php';
+        
+$less = new HTML_Less();
+
+foreach ($files as $src => $file){
+
+    if(!file_exists($src)){
+        echo "{$src} does not exist...\n";
+        continue;
+    }
+    
+    echo "{$src} exist \n";
+
+//    try {
+//
+//        foreach ($file as $f){
+//            echo "Compiling - {$src} To {$f}\n";
+//
+//            $less->compileFile($src, $f);
+//        }
+//
+//    } catch (Exception $ex) {
+//        echo "lessphp fatal error: {$ex->getMessage()}\n";
+//    }
 
-$less = new HTML_Less();
\ No newline at end of file
+}
\ No newline at end of file