Skip to content

Report: using GroovyShell instead of running CLI directly #56

Open
@Luolc

Description

@Luolc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions