diff --git a/ALCL.iml b/ALCL.iml index c5485cb..485ea5c 100644 --- a/ALCL.iml +++ b/ALCL.iml @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/Binary/Hashlink/out.hl b/Binary/Hashlink/out.hl index 2da2527..dd9c33c 100644 Binary files a/Binary/Hashlink/out.hl and b/Binary/Hashlink/out.hl differ diff --git a/Scripts/git_test_linux.sh b/Scripts/git_test_linux.sh index 8717bf5..1af708c 100644 --- a/Scripts/git_test_linux.sh +++ b/Scripts/git_test_linux.sh @@ -11,5 +11,5 @@ do echo "- $file" done -./ALCL -cwd ./Tests -compile cmake -std ../Stdlib -output ../Env/Out/Tests $TEST_FILES +./ALCL -verbose yes -cwd ./Tests -compile cmake -std ../Stdlib -output ../Env/Out/Tests $TEST_FILES echo "Tests generated!" diff --git a/Scripts/git_test_windows.bat b/Scripts/git_test_windows.bat index f5736db..cf8499a 100644 --- a/Scripts/git_test_windows.bat +++ b/Scripts/git_test_windows.bat @@ -14,7 +14,7 @@ cd /d .. echo Test files: for %%F in (!TEST_FILES!) do echo - %%F -ALCL -cwd ./Tests -compile cmake -std ../Stdlib -output ../Env/Out/Tests !TEST_FILES! +ALCL -verbose yes -cwd ./Tests -compile cmake -std ../Stdlib -output ../Env/Out/Tests !TEST_FILES! echo Tests generated! endlocal \ No newline at end of file diff --git a/Source/Main.hx b/Source/Main.hx index 203c5d4..e7daf30 100644 --- a/Source/Main.hx +++ b/Source/Main.hx @@ -25,6 +25,7 @@ class Main { public static function main() { cli_main(); } + public static function cli_main() { var project = new ProjectData(); diff --git a/Source/cbuild/CMakeInterface.hx b/Source/cbuild/CMakeInterface.hx index f43062e..4d457b8 100644 --- a/Source/cbuild/CMakeInterface.hx +++ b/Source/cbuild/CMakeInterface.hx @@ -52,14 +52,29 @@ class CMakeInterface extends CBuild { var problems: Bool = false; for (cmd in cmds) { + if (_project.getVerbose()) { + Logging.print("running: " + cmd); + Sys.command(cmd); + continue; + } + + if (problems) { + continue; + } + var cmdArgs = cmd.split(" "); var cmdName = cmdArgs.shift(); - var process = new Process(cmdName, cmdArgs); - var err = process.stderr.readAll().toString(); + try { + var process = new Process(cmdName, cmdArgs); + var err = process.stderr.readAll().toString(); - if (process.exitCode(true) != 0) { - Logging.print(process.stdout.readAll().toString()); - Logging.error(err); + if (process.exitCode(true) != 0) { + Logging.print(process.stdout.readAll().toString()); + Logging.error(err); + problems = true; + } + } catch (e: Dynamic) { + Logging.error("Failed to run CMake command!"); problems = true; } } diff --git a/Source/data/ProjectData.hx b/Source/data/ProjectData.hx index 2d706ee..e93600d 100644 --- a/Source/data/ProjectData.hx +++ b/Source/data/ProjectData.hx @@ -261,26 +261,34 @@ class ProjectData { var start = Sys.time(); for (dependency in _dependencies) { + Logging.debug('Building dependency: ${dependency.getProjectName()}'); dependency.setOutputDirectory(_outputDirectory); dependency.setImportMap(_importMap); dependency.setAstMap(_astMap); dependency.setDumpAst(_dumpAst); dependency.setParserMap(_parserMap); dependency.setBuiltFileMap(_builtFileMap); + dependency.setVerbose(_verbose); dependency.build(true); } - // Logging.info('Start building: ${_projectName}'); + if (getVerbose()) Logging.info('Start building: ${_projectName}'); var errors = new ErrorContainer(); // import map prepass for (file in _files) { var baseLoc = baseLocOf(file); addImport(baseLoc, file); + + Logging.debug('Import map: ${baseLoc} -> ${file}'); } // tokenize + gen ASTs for (file in _files) { + if (getVerbose()) { + Logging.info('- ${file} [parse]'); + } + if (!FileSystem.exists(file)) { errors.addError({ type: ErrorType.FileNotFound, message: file }); continue; @@ -306,6 +314,10 @@ class ProjectData { // typer + verifier for (file in _files) { + if (getVerbose()) { + Logging.info('- ${file} [verify]'); + } + var parser = _parserMap[file]; if (parser == null) { Logging.warn('Missing parser for file "$file"'); @@ -327,6 +339,10 @@ class ProjectData { // print ASTs for (file in _files) { + if (getVerbose()) { + Logging.info('- ${file} [write]'); + } + var parser = _parserMap[file]; if (parser == null) { Logging.warn('Missing parser for file "$file"'); @@ -361,7 +377,10 @@ class ProjectData { Logging.info('Dumped AST to ${outputFilename}'); } - // Logging.success('Done! Took ${Sys.time() - start} seconds.'); + + if (_verbose) { + Logging.success('Generation Done! Took ${Sys.time() - start} seconds.'); + } } }