Dark theme | Light theme

March 8, 2012

Grails Goodness: Shortcut to Open Test Reports in Interactive Console

We can use the open command in the interactive console in Grails to open files. For example to edit the default layout view we can typ in the console:

grails> open grails-app/views/layouts/main.gsp

The application associated with GSP files starts and opens the file main.gsp.

So normally we have to pass actual filename with the complete path to the open command to open them. But Grails provides two shortcuts: test-report and dep-report. To see the output of our tests we can simply type open test-report:

grails> test-app
| Compiling 38 source files

| Tests PASSED - view reports in target/test-reports
grails> open test-report

Grails now opens the file target/test-reports/html/index.html.

The dep-report shortcut open the dependency report after we have run the dependency-report command:

grails> dependency-report
| Dependency report output to [/Users/mrhaki/samples/iconsole/target/dependency-report/index.html]
grails> open dep-report