Fixed `xfw build` + added statistics + log

This commit is contained in:
xdrm-brackets 2016-12-07 12:51:13 +01:00
parent 93653d8680
commit b98a8419d4
36 changed files with 89 additions and 74 deletions

View File

@ -33,25 +33,40 @@
/* [1] Builds project's base file structure /* [1] Builds project's base file structure
=========================================================*/ =========================================================*/
/* (1) Copy from src/files */ /* (1) Copy from src/files */
echo "(1) Building file structure\n";
shell_exec("cp -r ".__ROOT__."/src/files/* ".$this->root); shell_exec("cp -r ".__ROOT__."/src/files/* ".$this->root);
/* [2] Browse each package to load /* [2] Browse each package to load
=========================================================*/ =========================================================*/
foreach($this->packages as $package=>$version){ echo "(2) Building packages\n";
$path = "/$package/$version"; $count = 1;
foreach($this->packages as $package=>$version){
$path = "$package/$version";
echo " ($count) $package:$version\n";
/* (1) Copy package folder if it exists */ /* (1) Copy package folder if it exists */
if( file_exists(__ROOT__."/src/packages$path/") && is_dir(__ROOT__."/src/packages$path/") && count(scandir(__ROOT__."/src/packages$path/")) > 2 ) if( file_exists(__ROOT__."/src/packages/$path") && is_dir(__ROOT__."/src/packages/$path") && count(scandir(__ROOT__."/src/packages/$path")) > 2 )
shell_exec("cp -r ".__ROOT__."/src/packages$path ".$this->root."/build/$package"); shell_exec("cp -r ".__ROOT__."/src/packages/$path ".$this->root."/build/$package");
/* (2) Copy package config if it exists */ /* (2) Copy package config if it exists */
if( file_exists(__ROOT__."/src/config$path/") && is_dir(__ROOT__."/src/config$path/") && count(scandir(__ROOT__."/src/config$path/")) > 2 ) if( file_exists(__ROOT__."/src/config/$path") && is_dir(__ROOT__."/src/config/$path") && count(scandir(__ROOT__."/src/config/$path")) > 2 )
shell_exec("cp -r ".__ROOT__."/src/config$path/* ".$this->root."/config/"); shell_exec("cp -r ".__ROOT__."/src/config/$path/* ".$this->root."/config/");
$count++;
} }
echo "(*) Build finished\n";
/* [3] Start stats
=========================================================*/
echo "\n\nStatistics:\n";
echo shell_exec("du -hs ".$this->root."/*;");
echo "--\n";
echo shell_exec("du -hs ".$this->root."/;");
} }

View File

@ -18,7 +18,7 @@
"2.0" "2.0"
] ]
}, },
"2.1": { "2.2": {
"error": [ "error": [
"2.0" "2.0"
], ],
@ -59,7 +59,7 @@
} }
}, },
"installed": { "installed": {
"api": "2.1", "api": "2.2",
"error": "2.0", "error": "2.0",
"http": "1.0", "http": "1.0",
"orm": "0.8.2", "orm": "0.8.2",