////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////

Grails ships with a lot of command line functionality out of the box that you may find useful in your own scripts (See the command line reference in the reference guide for info on all the commands). 

Any script you create can invoke another Grails script simply by invoking a method:

[source,groovy]
----
testApp()
----

The above will invoke the `test-app` command. You can also pass arguments using the method arguments:

[source,groovy]
----
testApp('--debug-jvm')
----


==== Invoking Gradle 


Instead of invoking another Grails CLI command you can invoke Gradle directory using the `gradle` property.

[source,groovy]
----
gradle.compileGroovy()
----


==== Invoking Ant


You can also invoke Ant tasks from scripts which can help if you need to writing code generation and automation tasks:

[source,groovy]
----
ant.mkdir(dir:"path")
----
