From 238da6b80faa6bf905576979fdf3689a3c950dc2 Mon Sep 17 00:00:00 2001 From: Francisco Ryan Tolmasky I Date: Thu, 15 Oct 2009 13:27:27 -0700 Subject: [PATCH] Narwhal fixes for capp gen. Reviewed by me. --- Tools/capp/Generate.j | 24 ++++++++++++++---------- Tools/capp/main.j | 7 +++---- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/Tools/capp/Generate.j b/Tools/capp/Generate.j index f8e0d0368..1dede8b25 100644 --- a/Tools/capp/Generate.j +++ b/Tools/capp/Generate.j @@ -83,15 +83,19 @@ function gen(/*va_args*/) count = files.length, name = FILE.basename(destinationProject), orgIdentifier = [configuration valueForKey:@"organization.identifier"] || ""; -print("yo!"+files); + [configuration setTemporaryValue:name forKey:@"project.name"]; [configuration setTemporaryValue:orgIdentifier + '.' + toIdentifier(name) forKey:@"project.identifier"]; [configuration setTemporaryValue:toIdentifier(name) forKey:@"project.nameasidentifier"]; for (; index < count; ++index) { - var path = files[index], - contents = FILE.read(path, { charset : "UTF-8" }), + var path = files[index]; + + if (FILE.isDirectory(path)) + continue; + + var contents = FILE.read(path, { charset : "UTF-8" }), key = nil, keyEnumerator = [configuration keyEnumerator]; @@ -158,17 +162,17 @@ function createFrameworksInFile(/*String*/ aFile, /*Boolean*/ shouldSymbolically // Release Frameworks FILE.mkdirs(destinationFrameworks); - - FILE.symlink(FILE.join(BUILD + "Release", "Objective-J"), FILE.join(destinationFrameworks, "Objective-J")); - FILE.symlink(FILE.join(BUILD + "Release", "Foundation"), FILE.join(destinationFrameworks, "Foundation")); - FILE.symlink(FILE.join(BUILD + "Release", "AppKit"), FILE.join(destinationFrameworks, "AppKit")); + + FILE.symlink(FILE.join(BUILD, "Release", "Objective-J"), FILE.join(destinationFrameworks, "Objective-J")); + FILE.symlink(FILE.join(BUILD, "Release", "Foundation"), FILE.join(destinationFrameworks, "Foundation")); + FILE.symlink(FILE.join(BUILD, "Release", "AppKit"), FILE.join(destinationFrameworks, "AppKit")); // Debug Frameworks FILE.mkdirs(destinationDebugFrameworks); - FILE.symlink(FILE.join(BUILD + "Debug", "Objective-J"), FILE.join(destinationDebugFrameworks, "Objective-J")); - FILE.symlink(FILE.join(BUILD + "Debug", "Foundation"), FILE.join(destinationDebugFrameworks, "Foundation")); - FILE.symlink(FILE.join(BUILD + "Debug", "AppKit"), FILE.join(destinationDebugFrameworks, "AppKit")); + FILE.symlink(FILE.join(BUILD, "Debug", "Objective-J"), FILE.join(destinationDebugFrameworks, "Objective-J")); + FILE.symlink(FILE.join(BUILD, "Debug", "Foundation"), FILE.join(destinationDebugFrameworks, "Foundation")); + FILE.symlink(FILE.join(BUILD, "Debug", "AppKit"), FILE.join(destinationDebugFrameworks, "AppKit")); } function toIdentifier(/*String*/ aString) diff --git a/Tools/capp/main.j b/Tools/capp/main.j index 15c10517a..0d4715ee2 100644 --- a/Tools/capp/main.j +++ b/Tools/capp/main.j @@ -4,16 +4,15 @@ @import "Configuration.j" @import "Generate.j" -print("what?..."); function main() -{print("insdie?..."); +{ if (system.args.length < 1) return printUsage(); var index = 0, count = system.args.length; -print("p;!"); + for (; index < count; ++index) { var argument = system.args[index]; @@ -28,7 +27,7 @@ print("p;!"); case "config": return config.apply(this, system.args.slice(index + 1)); - case "gen": print("!");return gen.apply(this, system.args.slice(index + 1)); + case "gen": return gen.apply(this, system.args.slice(index + 1)); default: print("unknown command " + argument); }