diff --git a/packages/jshint/plugin/lint-jshint.js b/packages/jshint/plugin/lint-jshint.js index a3365579e3..64fadb5a69 100644 --- a/packages/jshint/plugin/lint-jshint.js +++ b/packages/jshint/plugin/lint-jshint.js @@ -56,7 +56,9 @@ JsHintLinter.prototype.processFilesForTarget = function (files, globals) { return; // skip files we already linted - var hashKey = file.getPackageName() + '/' + file.getPathInPackage(); + var hashKey = JSON.stringify([ + file.getPackageName(), file.getPathInPackage(), file.getArch()]); + if (self.hashDict[hashKey] === file.getSourceHash()) return; self.hashDict[hashKey] = file.getSourceHash(); diff --git a/tools/build-plugin.js b/tools/build-plugin.js index cf6437ca76..88e1053e69 100644 --- a/tools/build-plugin.js +++ b/tools/build-plugin.js @@ -79,6 +79,16 @@ _.extend(exports.InputFile.prototype, { getSourceHash: function () { throw new Error("Not Implemented"); }, + /** + * @summary Returns a string symbol representing the architecture that is + * targetted by processing this file. Can be used to implement caching. + * XXX BBP is this doc string good? + * @memberof InputFile + * @returns {String} + */ + getArch: function () { + throw new Error("Not Implemented"); + }, /** * @summary Returns the full contents of the file as a string. diff --git a/tools/compiler.js b/tools/compiler.js index b93a305a34..5027e15cdd 100644 --- a/tools/compiler.js +++ b/tools/compiler.js @@ -251,7 +251,8 @@ var lintUnibuild = function (options) { relPath: relPath, contents: contents, 'package': isopack.name, - hash: hash + hash: hash, + arch: inputSourceArch.arch }; }); diff --git a/tools/linter-plugin.js b/tools/linter-plugin.js index 5e5e4b8979..07937bd2c0 100644 --- a/tools/linter-plugin.js +++ b/tools/linter-plugin.js @@ -29,6 +29,9 @@ _.extend(LintingFile.prototype, { }, getSourceHash: function () { return this._source.hash; + }, + getArch: function () { + return this._source.arch; } });