Skip to content
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

Report: using GroovyShell instead of running CLI directly #56

Open
Luolc opened this issue Jul 19, 2017 · 0 comments
Open

Report: using GroovyShell instead of running CLI directly #56

Luolc opened this issue Jul 19, 2017 · 0 comments

Comments

@Luolc
Copy link
Collaborator

Luolc commented Jul 19, 2017

Taken from #48 (comment)

We are now using CLI way to invoke diff.groovy and it is better to do this by a Groovy invoker library, like GroovyShell.

An example of GroovyShell: https://github.com/Luolc/regression-tool/blob/dd02aa9019a7c02bafb028dcf7ec85e635256aa2/src/main/java/com/github/checkstyle/regression/report/ReportGenerator.java#L49.

More information about invoking Groovy script: http://groovy-lang.org/integrating.html

The reason we don't use GroovyShell now is stated at #48 (comment):

I am impossible to change the working directory of the invoker. There are many relative path used in the script, and we would have problems when invoking it outside its parent folder. Even in CLI, we are not able to run it outside.

Example of relative path in diff.groovy: https://github.com/checkstyle/contribution/blob/master/checkstyle-tester/diff.groovy#L183

The way to get the path of the script: https://stackoverflow.com/questions/1163093/how-do-you-get-the-path-of-the-running-script-in-groovy?answertab=votes#tab-top

We need to update diff.groovy if we want to use GroovyShell way.

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

No branches or pull requests

1 participant