// 测试独立可执行文件生成
use std::path::Path;

fn main() {
    let project_dir = Path::new("test_multi_entry");
    
    println!("=== Testing Standalone Executable Generation ===\n");
    
    let mut compiler = match ts_native::project_compiler::ProjectCompiler::from_dir(project_dir) {
        Ok(c) => c,
        Err(e) => {
            eprintln!("Failed to create project compiler: {}", e);
            std::process::exit(1);
        }
    };
    
    match compiler.compile_project() {
        Ok(report) => {
            println!("\n=== Compilation Successful ===");
            println!("Total duration: {}ms", report.total_duration_ms);
            println!("Modules compiled: {}", report.module_results.len());
            println!("Entries generated: {}", report.entry_results.len());
            
            for entry in &report.entry_results {
                if let Some(ref path) = entry.exe_path {
                    println!("  {} -> {}", entry.entry_name, path.display());
                }
            }
        }
        Err(e) => {
            eprintln!("Compilation failed: {}", e);
            std::process::exit(1);
        }
    }
}
