Skip to content

Commit 7882d44

Browse files
author
graeme
committed
fixed problem with url mappings being overriden
git-svn-id: https://svn.codehaus.org/grails/trunk@4632 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d
1 parent c4c4eb7 commit 7882d44

File tree

1 file changed

+31
-24
lines changed

1 file changed

+31
-24
lines changed

scripts/Upgrade.groovy

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -100,30 +100,37 @@ move it to the new location of '${basedir}/test/integration'. Please move the di
100100
tofile:"${basedir}/web-app/WEB-INF/applicationContext.xml", overwrite:true)
101101

102102
// These will still overwrite as the src name differs from target and the src name is not in target
103-
copy(tofile:"${basedir}/grails-app/conf/log4j.development.properties") {
104-
fileset(file:"${grailsHome}/src/war/WEB-INF/log4j.properties") {
105-
present(present:"srconly", targetdir:"${basedir}/grails-app/conf")
106-
}
107-
}
108-
copy(tofile:"${basedir}/grails-app/conf/log4j.test.properties") {
109-
fileset(file:"${grailsHome}/src/war/WEB-INF/log4j.properties") {
110-
present(present:"srconly", targetdir:"${basedir}/grails-app/conf")
111-
}
112-
}
113-
copy(tofile:"${basedir}/grails-app/conf/log4j.production.properties") {
114-
fileset(file:"${grailsHome}/src/war/WEB-INF/log4j.properties") {
115-
present(present:"srconly", targetdir:"${basedir}/grails-app/conf")
116-
}
117-
}
118-
119-
copy(tofile:"${basedir}/grails-app/conf/${appClassName}UrlMappings.groovy") {
120-
fileset(file:"${grailsHome}/src/grails/templates/artifacts/UrlMappings.groovy") {
121-
present(present:"srconly", targetdir:"${basedir}/grails-app/conf")
122-
}
123-
}
124-
replace(file:"${basedir}/grails-app/conf/${appClassName}UrlMappings.groovy",
125-
token:"@artifact.name@", value:"${appClassName}UrlMappings" )
126-
103+
if(!new File("${basedir}/grails-app/conf/log4j.development.properties").exists()) {
104+
copy(tofile:"${basedir}/grails-app/conf/log4j.development.properties") {
105+
fileset(file:"${grailsHome}/src/war/WEB-INF/log4j.properties") {
106+
present(present:"srconly", targetdir:"${basedir}/grails-app/conf")
107+
}
108+
}
109+
}
110+
if(!new File("${basedir}/grails-app/conf/log4j.test.properties").exists()) {
111+
copy(tofile:"${basedir}/grails-app/conf/log4j.test.properties") {
112+
fileset(file:"${grailsHome}/src/war/WEB-INF/log4j.properties") {
113+
present(present:"srconly", targetdir:"${basedir}/grails-app/conf")
114+
}
115+
}
116+
}
117+
if(!new File("${basedir}/grails-app/conf/log4j.production.properties").exists()) {
118+
copy(tofile:"${basedir}/grails-app/conf/log4j.production.properties") {
119+
fileset(file:"${grailsHome}/src/war/WEB-INF/log4j.properties") {
120+
present(present:"srconly", targetdir:"${basedir}/grails-app/conf")
121+
}
122+
}
123+
}
124+
125+
if(!new File("${basedir}/grails-app/conf/${appClassName}UrlMappings.groovy").exists()) {
126+
copy(tofile:"${basedir}/grails-app/conf/${appClassName}UrlMappings.groovy") {
127+
fileset(file:"${grailsHome}/src/grails/templates/artifacts/UrlMappings.groovy") {
128+
present(present:"srconly", targetdir:"${basedir}/grails-app/conf")
129+
}
130+
}
131+
replace(file:"${basedir}/grails-app/conf/${appClassName}UrlMappings.groovy",
132+
token:"@artifact.name@", value:"${appClassName}UrlMappings" )
133+
}
127134

128135
copy(file:"${grailsHome}/src/war/WEB-INF/web${servletVersion}.template.xml",
129136
tofile:"${basedir}/web-app/WEB-INF/web.template.xml",

0 commit comments

Comments
 (0)