Skip to content

Commit

Permalink
LPS-51081 Create theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Ithildir committed Mar 20, 2015
1 parent 2e5312b commit 6d8294c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
31 changes: 31 additions & 0 deletions sdk.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import org.apache.commons.codec.digest.DigestUtils
import org.apache.tools.ant.filters.ReplaceTokens

apply from: "util.gradle"

buildscript {
dependencies {
classpath group: "commons-codec", name: "commons-codec", version: "1.9"
Expand All @@ -15,6 +17,7 @@ buildscript {

task compareDists
task createLayouttpl
task createTheme

compareDists << {
Closure compareDistFileContents
Expand Down Expand Up @@ -191,3 +194,31 @@ createLayouttpl << {
}
}
}

createTheme << {
File themeDir = file("themes/${themeName}-theme")

if (themeDir.exists()) {
println "${themeName} already exists."

return
}

copy {
filter(ReplaceTokens, tokens: [
"theme.display.name": themeDisplayName,
"theme.name": themeName,
"plugin.type.dir": ".."
])

from "${rootDir}/tools/templates/theme_tmpl"

into themeDir
}

mkdirs("${themeDir}/docroot/_diffs")
mkdirs("${themeDir}/docroot/WEB-INF/src/resources-importer/document_library/documents")
mkdirs("${themeDir}/docroot/WEB-INF/src/resources-importer/journal/articles")
mkdirs("${themeDir}/docroot/WEB-INF/src/resources-importer/journal/structures")
mkdirs("${themeDir}/docroot/WEB-INF/src/resources-importer/journal/templates")
}
6 changes: 6 additions & 0 deletions util.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ class UtilPluginConvention {
file.exists()
}

void mkdirs(String pathName) {
File file = _project.file(pathName)

file.mkdirs()
}

private Project _project

}

0 comments on commit 6d8294c

Please sign in to comment.