Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 51 lines (44 sloc) 1.853 kb
3e17890a »
2009-03-13 1.1 branch is now trunk
1 /*
2 * Copyright 2004-2005 the original author or authors.
5b573a6e »
2010-02-19 Fix for GRAILS-5889; was ignoring y/n answer
3 *
3e17890a »
2009-03-13 1.1 branch is now trunk
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
5b573a6e »
2010-02-19 Fix for GRAILS-5889; was ignoring y/n answer
7 *
3e17890a »
2009-03-13 1.1 branch is now trunk
8 * http://www.apache.org/licenses/LICENSE-2.0
5b573a6e »
2010-02-19 Fix for GRAILS-5889; was ignoring y/n answer
9 *
3e17890a »
2009-03-13 1.1 branch is now trunk
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 /**
18 * Gant script that installs artifact and scaffolding templates
5b573a6e »
2010-02-19 Fix for GRAILS-5889; was ignoring y/n answer
19 *
3e17890a »
2009-03-13 1.1 branch is now trunk
20 * @author Marcel Overdijk
21 *
22 * @since 0.4
23 */
24
25 includeTargets << grailsScript("_GrailsInit")
26
27 target ('default': "Installs the artifact and scaffolding templates") {
28 depends(checkVersion, parseArguments)
9d8e63dc »
2011-01-09 GRAILS-7121 - fire new events InstallTemplatesStart and InstallTempla…
29 event 'InstallTemplatesStart', [ 'Installing Templates...' ]
5b573a6e »
2010-02-19 Fix for GRAILS-5889; was ignoring y/n answer
30 targetDir = "${basedir}/src/templates"
31 overwrite = false
32
33 // only if template dir already exists in, ask to overwrite templates
34 if (new File(targetDir).exists()) {
835947fb »
2010-06-22 cleanup
35 if (!isInteractive || confirmInput("Overwrite existing templates? [y/n]","overwrite.templates")) {
5b573a6e »
2010-02-19 Fix for GRAILS-5889; was ignoring y/n answer
36 overwrite = true
835947fb »
2010-06-22 cleanup
37 }
5b573a6e »
2010-02-19 Fix for GRAILS-5889; was ignoring y/n answer
38 }
39 else {
40 ant.mkdir(dir: targetDir)
41 }
3e17890a »
2009-03-13 1.1 branch is now trunk
42
5b573a6e »
2010-02-19 Fix for GRAILS-5889; was ignoring y/n answer
43 copyGrailsResources("$targetDir/artifacts", "src/grails/templates/artifacts/*", overwrite)
44 copyGrailsResources("$targetDir/scaffolding", "src/grails/templates/scaffolding/*", overwrite)
45 ant.mkdir(dir:"${targetDir}/war")
46 copyGrailsResource("${targetDir}/war/web.xml", grailsResource("src/war/WEB-INF/web${servletVersion}.template.xml"), overwrite)
3e17890a »
2009-03-13 1.1 branch is now trunk
47
48 event("StatusUpdate", [ "Templates installed successfully"])
9d8e63dc »
2011-01-09 GRAILS-7121 - fire new events InstallTemplatesStart and InstallTempla…
49 event 'InstallTemplatesEnd', [ 'Finished Installing Templates.' ]
3e17890a »
2009-03-13 1.1 branch is now trunk
50 }
Something went wrong with that request. Please try again.