diff --git a/Objective-J/CommonJS/lib/objective-j.js b/Objective-J/CommonJS/lib/objective-j.js index e349f5e48..9dbf5ebd9 100644 --- a/Objective-J/CommonJS/lib/objective-j.js +++ b/Objective-J/CommonJS/lib/objective-j.js @@ -94,7 +94,6 @@ exports.run = function(args) print(" -I, --objj-include-paths include a specific framework paths") print(" -h, --help print this help"); print(" -m, --multifiles launch objj on several files") - print(" -c, --objc generate the objective-c class of the given file to the given folder. [file] [destination]") return; } @@ -111,14 +110,6 @@ exports.run = function(args) argv.shift(); multipleFiles = true; break - - case "-c": - case "--objc": - argv.shift(); - argv.unshift(require("file").path(module.path).dirname().join("objective-j/objective-c-parser.j")); - argv.unshift("objj"); - - return OS.system(argv); } } } diff --git a/Tools/Jakefile b/Tools/Jakefile index b0f0b52a8..92d48b9f9 100644 --- a/Tools/Jakefile +++ b/Tools/Jakefile @@ -2,6 +2,6 @@ require("../common.jake"); // nib2cib uses fontinfo and imagesize and capp uses nib2cib -subtasks(["fontinfo", "imagesize", "nib2cib", "capp", "capp_lint", "dump_theme", "XcodeCapp"], ["build", /*"clean", "clobber"*/]); +subtasks(["fontinfo", "imagesize", "nib2cib", "objj2objcskeleton", "capp", "capp_lint", "dump_theme", "XcodeCapp"], ["build", /*"clean", "clobber"*/]); subtasks(["fontinfo", "imagesize"], ["clean", "clobber"]); diff --git a/Tools/objj2objcskeleton/Jakefile b/Tools/objj2objcskeleton/Jakefile new file mode 100644 index 000000000..5d8bb01f0 --- /dev/null +++ b/Tools/objj2objcskeleton/Jakefile @@ -0,0 +1,9 @@ + +require ("../../common.jake"); + +var FILE = require("file"), + SYSTEM = require("system"), + path = FILE.Path(FILE.join(SYSTEM.prefix, "bin", "objj2objcskeleton")); + +sudo(["cp", "-f", "objj2objcskeleton", path]); +sudo(["chmod", "755", path]); diff --git a/Objective-J/CommonJS/lib/objective-j/objective-c-parser.j b/Tools/objj2objcskeleton/objj2objcskeleton similarity index 94% rename from Objective-J/CommonJS/lib/objective-j/objective-c-parser.j rename to Tools/objj2objcskeleton/objj2objcskeleton index f5ac0b3c1..08d604a06 100644 --- a/Objective-J/CommonJS/lib/objective-j/objective-c-parser.j +++ b/Tools/objj2objcskeleton/objj2objcskeleton @@ -1,33 +1,29 @@ -/* - * parser.j - * - * Created by Francisco Tolmasky. - * Modified by Antoine Mercadal, with great help from Martin Carlberg - * Copyright 2008-2013, 280 North, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ +#!/usr/bin/env objj @import var FILE = require("file"), OS = require("os"), - stream = require("narwhal/term").stream, + stream = require("narwhal/term").stream, SLASH_REPLACEMENT = "∕"; // DIVISION SLASH, Unicode: U+2215 +function main(args) +{ + args.shift(); + + if (args.length < 1) + return printUsage(); + + parser(args); +} + +function printUsage() +{ + print("objj2objskeleton [FILE] [DESTINATION]"); + print("Convert a objective-j file to an objective-c files skeleton (.h and .m)") +} + // Debug function to print some JS objects function dump(obj) { @@ -152,12 +148,12 @@ function removeLastSlashIfNecessary(path) $1 Full project source path $2 Destination */ -function main(args) +function parser(args) { try { - var projectBasePath = removeLastSlashIfNecessary(args[2]), - sourcePath = args[1], + var projectBasePath = removeLastSlashIfNecessary(args[1]), + sourcePath = args[0], outputDirectory = projectBasePath, baseFilename = shadowBaseNameForPath(projectBasePath, sourcePath), outputHeaderURL = new CFURL([outputDirectory stringByAppendingPathComponent:baseFilename + ".h"]),