Make css-validator.jar CLI runnable anywhere #100
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change makes it possible to run the css-validator.jar CLI from anywhere.
Prior to this change, the css-validator.jar CLI could be run only from within a
working directory that had the org/w3c/css/css/*.properties Velocity templates.
That’s because the code for the CLI looked for the templates on the filesystem,
or looked for a jar on the filesystem containing the templates.
This change makes the CLI code instead just look for the templates anywhere in
the classpath. And the templates are in the css-validator.jar file, so it works
regardless of whether you invoke the CLI with
java -jar css-validator.jar
orinstead with
java -cp css-validator.jar org.w3c.css.css.CssValidator
.This change also makes the CLI stop looking for the dependency jar files on the
filesystem in a
lib/
subdirectory. In the case where you’re using the fullcss-validator.jar file that contains all the dependency jars, there’s no need to
look for them on the filesystem. And in the case where you’re using the
css-validator.jar that doesn’t have the dependency jars included, you can just
call org.w3c.css.css.CssValidator with the jars in your classpath; for example:
Note that this change replaces the code added in 6b7b237 and c6cbb04 that took
the approach of looking for the templates and lib/ dir on the filesystem.