Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 51 lines (44 sloc) 1.853 kB
3e17890 1.1 branch is now trunk
graeme authored
1 /*
2 * Copyright 2004-2005 the original author or authors.
5b573a6 @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
5b573a6 @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
5b573a6 @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
5b573a6 @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)
9d8e63d @jeffbrown GRAILS-7121 - fire new events InstallTemplatesStart and InstallTempla…
jeffbrown authored
29 event 'InstallTemplatesStart', [ 'Installing Templates...' ]
5b573a6 @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()) {
835947f @burtbeckwith cleanup
burtbeckwith authored
35 if (!isInteractive || confirmInput("Overwrite existing templates? [y/n]","overwrite.templates")) {
5b573a6 @burtbeckwith Fix for GRAILS-5889; was ignoring y/n answer
burtbeckwith authored
36 overwrite = true
835947f @burtbeckwith cleanup
burtbeckwith authored
37 }
5b573a6 @burtbeckwith Fix for GRAILS-5889; was ignoring y/n answer
burtbeckwith authored
38 }
39 else {
40 ant.mkdir(dir: targetDir)
41 }
3e17890 1.1 branch is now trunk
graeme authored
42
5b573a6 @burtbeckwith Fix for GRAILS-5889; was ignoring y/n answer
burtbeckwith authored
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)
3e17890 1.1 branch is now trunk
graeme authored
47
48 event("StatusUpdate", [ "Templates installed successfully"])
9d8e63d @jeffbrown GRAILS-7121 - fire new events InstallTemplatesStart and InstallTempla…
jeffbrown authored
49 event 'InstallTemplatesEnd', [ 'Finished Installing Templates.' ]
3e17890 1.1 branch is now trunk
graeme authored
50 }
Something went wrong with that request. Please try again.