Last active
August 29, 2015 14:06
-
-
Save juaxix/8281b1c9e5617ec87a36 to your computer and use it in GitHub Desktop.
Shiva :: Create S3DAIModels.cpp file list for Android exports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Example: php5\php.exe buildaimodels.php "C:\\Games\\YourGame\\build\\Android\\eclipse\\jni\\AIModels" | |
*/ | |
echo "Generating list...\n"; | |
$dir = $argv[1] or "C:\\Games\\YourGame\\build\\Android\\eclipse\\jni\\AIModels"; | |
$dh = opendir($dir); | |
$txt = "//File generated by juax\n\n\n"; | |
$n = 0; | |
while (false !== ($filename = readdir($dh))) { | |
if ($filename=="."||$filename==".."||$filename=="AIModels.cpp") continue; //dont include itself or system directories | |
$txt .= '#include "'.$filename.'"'."\n"; | |
$n++; | |
echo "Included...".$filename."\n"; | |
} | |
closedir($dh); | |
echo $n." files added to AIModels.cpp\n"; | |
file_put_contents($dir."\\S3DAIModels.cpp",$txt); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment