move rhino_modules/ to lib/

This commit is contained in:
Jeff Williams 2012-12-23 14:09:37 -08:00
parent 4e0e4c2b97
commit d5877c1217
39 changed files with 32 additions and 35 deletions

View File

@ -83,7 +83,7 @@ Or on OS X, Linux, and other POSIX-compliant systems:
If you can't get the short-form commands to work, try invoking Java directly:
java -cp lib/js.jar org.mozilla.javascript.tools.debugger.Main \
-debug -modules node_modules -modules rhino_modules -modules . \
-debug -modules node_modules -modules rhino -modules lib -modules . \
jsdoc.js your/script.js
Note: `--debug` must be the first argument to the short-form command.

4
jsdoc
View File

@ -36,9 +36,9 @@ if test "$1" = "-T"
then
echo "Running Tests"
cd -P "$(dirname "$SOURCE")"
java -classpath "${BASEPATH}/rhino/js.jar" ${CMD} -opt -1 -modules "${URLPATH}/node_modules" -modules "${URLPATH}/rhino" -modules "${URLPATH}/rhino_modules" -modules "${URLPATH}" "${BASEPATH}/jsdoc.js" $ARGS --dirname="${BASEPATH}/"
java -classpath "${BASEPATH}/rhino/js.jar" ${CMD} -opt -1 -modules "${URLPATH}/node_modules" -modules "${URLPATH}/rhino" -modules "${URLPATH}/lib" -modules "${URLPATH}" "${BASEPATH}/jsdoc.js" $ARGS --dirname="${BASEPATH}/"
else
# normal mode should be quiet
java -classpath "${BASEPATH}/rhino/js.jar" ${CMD} -modules "${URLPATH}/node_modules" -modules "${URLPATH}/rhino" -modules "${URLPATH}/rhino_modules" -modules "${URLPATH}" "${BASEPATH}/jsdoc.js" $ARGS --dirname="${BASEPATH}/"
java -classpath "${BASEPATH}/rhino/js.jar" ${CMD} -modules "${URLPATH}/node_modules" -modules "${URLPATH}/rhino" -modules "${URLPATH}/lib" -modules "${URLPATH}" "${BASEPATH}/jsdoc.js" $ARGS --dirname="${BASEPATH}/"
fi

View File

@ -36,10 +36,10 @@ IF [%1]==[--debug] (
IF [%1]==[-T] (
ECHO Running Tests
java -classpath "%_BASEPATH%/rhino/js.jar" %CMD% -opt -1 -modules "%_URLPATH%/node_modules" -modules "%_URLPATH%/rhino" -modules "%_URLPATH%/rhino_modules" -modules "%_URLPATH%" "%_BASEPATH%/jsdoc.js" %ARGS% --nocolor --dirname="%_BASEPATH%/
java -classpath "%_BASEPATH%/rhino/js.jar" %CMD% -opt -1 -modules "%_URLPATH%/node_modules" -modules "%_URLPATH%/rhino" -modules "%_URLPATH%/lib" -modules "%_URLPATH%" "%_BASEPATH%/jsdoc.js" %ARGS% --nocolor --dirname="%_BASEPATH%/
) ELSE (
REM normal mode should be quiet
java -classpath "%_BASEPATH%/rhino/js.jar" %CMD% -modules "%_URLPATH%/node_modules" -modules "%_URLPATH%/rhino" -modules "%_URLPATH%/rhino_modules" -modules "%_URLPATH%" "%_BASEPATH%/jsdoc.js" %ARGS% --dirname="%_BASEPATH%/
java -classpath "%_BASEPATH%/rhino/js.jar" %CMD% -modules "%_URLPATH%/node_modules" -modules "%_URLPATH%/rhino" -modules "%_URLPATH%/lib" -modules "%_URLPATH%" "%_BASEPATH%/jsdoc.js" %ARGS% --dirname="%_BASEPATH%/
)
ENDLOCAL

View File

@ -22,10 +22,25 @@ env = {
},
/**
The type of VM that is executing jsdoc.
@type string
*/
vm: '',
* The type of VM that is executing jsdoc:
*
* + `rhino`: Mozilla Rhino.
* + `node`: Node.js.
*
* **Note**: Rhino is the only VM that is currently supported.
* @type string
*/
vm: (function() {
if (typeof Packages === 'object' &&
Object.prototype.toString.call(Packages) === '[object JavaPackage]') {
return 'rhino';
} else if ( require && require.main && module && (require.main === module) ) {
return 'node';
} else {
// unknown VM
throw new Error('Unable to identify the current JavaScript runtime.');
}
})(),
/**
The command line arguments passed into jsdoc.
@ -56,8 +71,9 @@ env = {
args = Array.prototype.slice.call(arguments, 0);
// rhino has no native way to get the base dirname of the currently running script
// so this information must be manually passed in from the command line
// Rhino has no native way to get the base dirname of the current script,
// so this information must be manually passed in from the command line.
// TODO: should only run this on Rhino
for (var i = 0; i < args.length; i++) {
if ( /^--dirname(?:=(.+?)(\/|\/\.)?)?$/i.test(args[i]) ) {
if (RegExp.$1) {
@ -70,9 +86,9 @@ for (var i = 0; i < args.length; i++) {
}
}
}
env.args = args;
// TODO: should only run this on Rhino
load(env.dirname + '/rhino/rhino-shim.js');
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
@ -197,23 +213,6 @@ function main() {
taffy = require('taffydb').taffy,
Config = require('jsdoc/config');
/**
Detect the type of VM running jsdoc.
**Note**: Rhino is the only VM that is currently supported.
@return {string} rhino|node
*/
function detectVm() {
if (typeof Packages === "object" &&
Object.prototype.toString.call(Packages) === "[object JavaPackage]") {
return "rhino";
} else if ( require && require.main && module && (require.main === module) ) {
return "node";
} else {
// unknown VM
return;
}
}
/**
* If the current VM is Rhino, convert a path to a URI that meets the operating system's
* requirements. Otherwise, return the original path.
@ -287,8 +286,6 @@ function main() {
return result;
}
env.vm = detectVm();
var defaultOpts = {
destination: './out/'
};

View File

@ -16,7 +16,7 @@ Or on OS X, Linux, and other POSIX-compliant platforms:
If you can't get the short-form commands to work, try invoking Java directly:
java -cp lib/js.jar org.mozilla.javascript.tools.shell.Main \
-modules node_modules -modules rhino_modules -modules . \
-modules node_modules -modules rhino -modules lib -modules . \
jsdoc.js -T
Writing Tests

View File

@ -45,7 +45,7 @@ describe("jsdoc/src/parser", function() {
var fs = require("fs"),
path = require("path"),
parserSrc = "javascript:" + fs.readFileSync( path.join(__dirname,
"rhino_modules", "jsdoc", "src", "parser.js") ),
"lib", "jsdoc", "src", "parser.js") ),
parse = function() {
parser.parse(parserSrc);
};

View File

@ -52,8 +52,8 @@ describe('jshint-clean', function() {
// check all .js files unless they're tests; rhino shim files that probably can't be
// delinted; or third-party modules
source = {
includePattern: '.+[\\|/]rhino_modules[\\|/].+\\.js$|.+[\\|/]plugins[\\|/]\\w+\\.js$',
excludePattern: '.+[\\|/]test[\\|/].+'
includePattern: '.+[\\|/]lib[\\|/].+\\.js$|.+[\\|/]plugins[\\|/]\\w+\\.js$',
excludePattern: '.+[\\|/]test[\\|/].+|.+[\\|/]node_modules[\\|/].+|.+[\\|/]Jake[\\|/].+'
};
filter = new (require('jsdoc/src/filter').Filter)(source);