Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 49 lines (41 sloc) 1.707 kb
3e17890 1.1 branch is now trunk
graeme authored
1 /*
2 * Copyright 2004-2005 the original author or authors.
057a857 @burtbeckwith Fix for GRAILS-5889; was ignoring y/n answer
burtbeckwith authored
3 *
3e17890 1.1 branch is now trunk
graeme authored
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
057a857 @burtbeckwith Fix for GRAILS-5889; was ignoring y/n answer
burtbeckwith authored
7 *
3e17890 1.1 branch is now trunk
graeme authored
8 * http://www.apache.org/licenses/LICENSE-2.0
057a857 @burtbeckwith Fix for GRAILS-5889; was ignoring y/n answer
burtbeckwith authored
9 *
3e17890 1.1 branch is now trunk
graeme authored
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
057a857 @burtbeckwith Fix for GRAILS-5889; was ignoring y/n answer
burtbeckwith authored
19 *
3e17890 1.1 branch is now trunk
graeme authored
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)
29
057a857 @burtbeckwith Fix for GRAILS-5889; was ignoring y/n answer
burtbeckwith authored
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()) {
35 if (!isInteractive || confirmInput("Overwrite existing templates? [y/n]","overwrite.templates"))
36 overwrite = true
37 }
38 else {
39 ant.mkdir(dir: targetDir)
40 }
3e17890 1.1 branch is now trunk
graeme authored
41
057a857 @burtbeckwith Fix for GRAILS-5889; was ignoring y/n answer
burtbeckwith authored
42 copyGrailsResources("$targetDir/artifacts", "src/grails/templates/artifacts/*", overwrite)
43 copyGrailsResources("$targetDir/scaffolding", "src/grails/templates/scaffolding/*", overwrite)
44 ant.mkdir(dir:"${targetDir}/war")
45 copyGrailsResource("${targetDir}/war/web.xml", grailsResource("src/war/WEB-INF/web${servletVersion}.template.xml"), overwrite)
3e17890 1.1 branch is now trunk
graeme authored
46
47 event("StatusUpdate", [ "Templates installed successfully"])
48 }
Something went wrong with that request. Please try again.