"Fossies" - the Fresh Open Source Software Archive

Member "grails-core-5.2.4/grails-docs/src/test/resources/docs/ref/Command Line/create-script.html" (14 Sep 2022, 60657 Bytes) of package /linux/www/grails-core-5.2.4.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the grails-core-5.2.4.tar.gz project site itself.

(Quick Reference)

create-script

Purpose

The create-script command creates a new Grails code generation script that can be run with the grails command from a terminal window.

Examples

The command:

grails create-script my-script

Creates a script called src/main/scripts/my-script.groovy such as:

description "Example description", "grails example-usage"

println "Example Script"

The command can then be run with:

grails my-script

Description

Each script extends from the super class GroovyScriptCommand which provides an API for achieving a number of different tasks.

Invoking Gradle

You can invoke Gradle using the gradle property:

gradle.assemble()

You can run any other Grails scripts by simply invoking the method:

testApp()

Code generation can be performed using the TemplateRenderer API

For more information, see the section on creating custom scripts.