Skip to content

Commit

Permalink
Version 0.6 - scripts no longer copy layout files into client app.
Browse files Browse the repository at this point in the history
git-svn-id: http://ala.googlecode.com/svn/trunk/ala-web-theme@244 cf76a52e-83f7-1f8e-e3a8-b8364d34af1a
  • Loading branch information
nickdos committed Jun 19, 2014
1 parent ec820e4 commit 0404a0d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 39 deletions.
2 changes: 1 addition & 1 deletion AlaWebThemeGrailsPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import grails.util.Holders

class AlaWebThemeGrailsPlugin {
// the plugin version
def version = "0.5"
def version = "0.6"
// the version or versions of Grails the plugin is designed for
def grailsVersion = "2.1 > *"
// the other plugins this plugin depends on
Expand Down
74 changes: 37 additions & 37 deletions scripts/_Install.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,41 @@
// backup original project files
//ant.echo("Backing-up project files: index.gsp and layouts/main.gsp")
// copy over plugin files
//ant.echo("Copying over plugin files: index.gsp and layouts/main.gsp")
ant.echo("NOTE: Please copy the plugin file: 'layouts/main.gsp' into your local app")

try {
File layoutFile = new File(new File(new File(basedir, "grails-app"), "views/layouts"), "main.gsp")
def toLayoutFile = "${basedir}/grails-app/views/layouts/main.gsp"
File indexFile = new File(new File(new File(basedir, "grails-app"), "views"), "index.gsp")
def toIndexFile = "${basedir}/grails-app/views/index.gsp"

if (layoutFile.exists()) {
toLayoutFile += ".new"
}
if (indexFile.exists()) {
toIndexFile += ".new"
}
if (!(layoutFile.exists() && indexFile.exists())) {
// assume first time installation - backup original files first
if (layoutFile.exists()) {
ant.copy(file: "${basedir}/grails-app/views/layouts/main.gsp",
toFile: "${basedir}/grails-app/views/layouts/main.gsp.bak")
}
if (indexFile.exists()) {
ant.copy(file: "${basedir}/grails-app/views/index.gsp",
toFile: "${basedir}/grails-app/views/index.gsp.bak")
}
}

//layout file
ant.copy(file: "${pluginBasedir}/grails-app/views/layouts/main.gsp",
toFile: toLayoutFile,
overwrite: true)
// index file
ant.copy(file: "${pluginBasedir}/grails-app/views/index.gsp",
toFile: toIndexFile,
overwrite: true)

} catch (Exception ex) {
ant.echo("Error running install script: " + ex.message)
}
//try {
// File layoutFile = new File(new File(new File(basedir, "grails-app"), "views/layouts"), "main.gsp")
// def toLayoutFile = "${basedir}/grails-app/views/layouts/main.gsp"
// File indexFile = new File(new File(new File(basedir, "grails-app"), "views"), "index.gsp")
// def toIndexFile = "${basedir}/grails-app/views/index.gsp"
//
// if (layoutFile.exists()) {
// toLayoutFile += ".new"
// }
// if (indexFile.exists()) {
// toIndexFile += ".new"
// }
// if (!(layoutFile.exists() && indexFile.exists())) {
// // assume first time installation - backup original files first
// if (layoutFile.exists()) {
// ant.copy(file: "${basedir}/grails-app/views/layouts/main.gsp",
// toFile: "${basedir}/grails-app/views/layouts/main.gsp.bak")
// }
// if (indexFile.exists()) {
// ant.copy(file: "${basedir}/grails-app/views/index.gsp",
// toFile: "${basedir}/grails-app/views/index.gsp.bak")
// }
// }
//
////layout file
// ant.copy(file: "${pluginBasedir}/grails-app/views/layouts/main.gsp",
// toFile: toLayoutFile,
// overwrite: true)
//// index file
// ant.copy(file: "${pluginBasedir}/grails-app/views/index.gsp",
// toFile: toIndexFile,
// overwrite: true)
//
//} catch (Exception ex) {
// ant.echo("Error running install script: " + ex.message)
//}
4 changes: 3 additions & 1 deletion scripts/_Upgrade.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
// ant.mkdir(dir:"${basedir}/grails-app/jobs")
//

evaluate(new File("_Install.groovy"))
//evaluate(new File("_Install.groovy"))

ant.echo("NOTE: Please copy the plugin file: 'layouts/main.gsp' into your local app and check for changed against your local copy, as it may have changed")

0 comments on commit 0404a0d

Please sign in to comment.