This was causing it to mis-calculate the paths, and end up losing the
output directory entirely, and overwrite the template static files
with themselves, resulting in truncation to zero-length. Of course,
they were also missing in the output.
It was expecting to be able to split paths on
System.getProperty("path.separator"), but that describes how to put a
path together, not how to take one apart, which is more complicated.
In particular, in windows, / is as valid a separator as \ in all but a
few UI contexts.
And since we need to pass / in paths that may get turned into URI's,
it's important to handle this correctly.
Java already provides a File facility to handle these sorts of operations.
This patch makes use of java.io.File to:
1) Find the parent of a File for dirname.
2) Find the name of a File for basename.
It also now makes use of substring for removing the ext for basename,
rather than Array.prototype.slice + join(""). I'm not sure what that
was all about... It does have the effect of ensuring it's a Javascript
String, but calling String() has the same benefit and is much more clear.
You can put that back if there was a reason for it, but it looks just
confused to me.
This first part of the testing framework upgrade:
- enhances the jsdoc script to allow switching to debug mode from the command line
- uses Jasmine to run tests
- adds flexibility to run tests from multiple root directories
- does automatic test discovery, so test files can just be created, dropped in an appropriate folder, and run without having to explicity add it to the test runner
- cleans up the test directory layout
- incorporates env.rhino.js which should make it easier to test templates
- is incomplete: this is just a savepoint. About 1/3 of the tests have been converted. The rest are still run through the old testrunner