Repository: tapestry-5
Updated Branches:
  refs/heads/master d2ccbe2df -> ef7f9c43e


add a task to update the Bootstrap resources


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/1a4e8b08
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/1a4e8b08
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/1a4e8b08

Branch: refs/heads/master
Commit: 1a4e8b087393e7a35eaa0e790b92bc78b1c2f474
Parents: d2ccbe2
Author: Jochen Kemnade <jochen.kemn...@eddyson.de>
Authored: Mon Jun 30 10:19:07 2014 +0200
Committer: Jochen Kemnade <jochen.kemn...@eddyson.de>
Committed: Mon Jun 30 10:19:07 2014 +0200

----------------------------------------------------------------------
 build.gradle | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/1a4e8b08/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index e8948fc..1869f64 100755
--- a/build.gradle
+++ b/build.gradle
@@ -572,3 +572,44 @@ boolean checkJDK() {
         true
     }
 }
+
+task updateBootstrap << {
+  def bootstrapVersion = '3.2.0'
+  def target = new File(temporaryDir, 'bootstrap.zip')
+  ant.get(src: 
"https://github.com/twbs/bootstrap/archive/v${bootstrapVersion}.zip";, dest: 
target)
+
+  def adjustDirectory = {
+      def relativePath = it.relativePath
+      if (relativePath.pathString.contains('/dist/')){
+          relativePath = new RelativePath(!it.file.isDirectory(), 
relativePath.segments[2..-1] as String[])
+      } else {
+          relativePath = new RelativePath(!it.file.isDirectory(), 
relativePath.segments[1..-1] as String[])
+      }
+      println "copying $it.relativePath to $relativePath"
+      it.relativePath = relativePath
+
+  }
+
+  copy {
+    from(zipTree(target)){
+        include('*/js/*.js')
+        include('*/dist/fonts/*')
+        include('*/dist/css/bootstrap.css')
+        include('*/dist/css/bootstrap-theme.css')
+
+        eachFile adjustDirectory
+    }
+    
into('tapestry-core/src/main/resources/META-INF/assets/tapestry5/bootstrap/')
+  }
+
+  copy {
+    from(zipTree(target)){
+        include('*/js/*.js')
+        include('*/dist/fonts/*')
+        include('*/less/**/*.less')
+
+        eachFile adjustDirectory
+    }
+    into('tapestry-webresources/src/test/webapp/bootstrap/')
+  }
+}
\ No newline at end of file

Reply via email to