Skip to content

Make css-validator.jar CLI runnable anywhere #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 18, 2017

Conversation

sideshowbarker
Copy link
Member

@sideshowbarker sideshowbarker commented Dec 14, 2017

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 or
instead 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 full
css-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:

java -cp ~/css-validator/lib/* org.w3c.css.css.CssValidator https://www.w3.org

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.

@sideshowbarker sideshowbarker force-pushed the sideshowbarker/velocity-classpath-resource-loader branch 2 times, most recently from 8190e3c to 331f31f Compare December 14, 2017 17:16
@sideshowbarker
Copy link
Member Author

@jean-gui You may want to give this a look-over too, since it replaces the changes you made in 6b7b237 and c6cbb04

@sideshowbarker sideshowbarker force-pushed the sideshowbarker/velocity-classpath-resource-loader branch from 331f31f to a69b6b2 Compare December 14, 2017 17:40
@ylafon ylafon requested a review from jean-gui December 14, 2017 20:16
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` or
instead 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 full
css-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:

  java -cp ~/css-validator/lib/* org.w3c.css.css.CssValidator https://www.w3.org

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.
@sideshowbarker sideshowbarker force-pushed the sideshowbarker/velocity-classpath-resource-loader branch from a69b6b2 to ee2e6d6 Compare December 17, 2017 01:27
@ylafon ylafon merged commit 1bc01ba into master Dec 18, 2017
@sideshowbarker sideshowbarker deleted the sideshowbarker/velocity-classpath-resource-loader branch December 19, 2017 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants