From 80c8fd97942e55f08a6526c9f6ab688696d4f8bd Mon Sep 17 00:00:00 2001 From: Francisco Ryan Tolmasky I Date: Sat, 2 Jul 2011 08:36:55 -0700 Subject: [PATCH] Fix bundletask to include .js files. Reviewed by @tolmasky. --- .../lib/objective-j/jake/bundletask.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Objective-J/CommonJS/lib/objective-j/jake/bundletask.js b/Objective-J/CommonJS/lib/objective-j/jake/bundletask.js index 76f7abb92..156c855ab 100644 --- a/Objective-J/CommonJS/lib/objective-j/jake/bundletask.js +++ b/Objective-J/CommonJS/lib/objective-j/jake/bundletask.js @@ -836,8 +836,7 @@ BundleTask.prototype.defineSourceTasks = function() environmentSources.forEach(function(/*String*/ aFilename) { - // if this file doesn't exist or isn't a .j file, don't preprocess it. - if (!FILE.exists(aFilename) || FILE.extension(aFilename) !== '.j') + if (!FILE.exists(aFilename)) return; var relativePath = aFilename.substring(basePathLength ? basePathLength + 1 : basePathLength), @@ -845,8 +844,19 @@ BundleTask.prototype.defineSourceTasks = function() filedir (compiledEnvironmentSource, [aFilename], function() { - TERM.stream.write("Compiling [\0blue(" + anEnvironment + "\0)] \0purple(" + aFilename + "\0)").flush(); - var compiled = require("objective-j/compiler").compile(aFilename, environmentCompilerFlags); + var compile + // if this file doesn't exist or isn't a .j file, don't preprocess it. + if (FILE.extension(aFilename) !== ".j") + { + TERM.stream.write("Including [\0blue(" + anEnvironment + "\0)] \0purple(" + aFilename + "\0)").flush(); + var compiled = FILE.read(aFilename, { charset:"UTF-8" }); + } + else + { + TERM.stream.write("Compiling [\0blue(" + anEnvironment + "\0)] \0purple(" + aFilename + "\0)").flush(); + var compiled = require("objective-j/compiler").compile(aFilename, environmentCompilerFlags); + } + TERM.stream.print(Array(Math.round(compiled.length / 1024) + 3).join(".")); FILE.write(compiledEnvironmentSource, compiled, { charset:"UTF-8" }); });