1- /*
1+ /*
22 * Copyright 2019, Emanuel Rabina (http://www.ultraq.net.nz/)
3- *
3+ *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
66 * You may obtain a copy of the License at
7- *
7+ *
88 * http://www.apache.org/licenses/LICENSE-2.0
9- *
9+ *
1010 * Unless required by applicable law or agreed to in writing, software
1111 * distributed under the License is distributed on an "AS IS" BASIS,
1212 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,36 +31,9 @@ tasks.register('serveDocs', Exec) {
3131 commandLine ' bundle' , ' exec' , ' jekyll' , ' serve' , ' --baseurl' , " "
3232}
3333
34- tasks. register(' publishDocs' ) {
34+ tasks. register(' publishDocs' , Exec ) {
3535 dependsOn copyGroovyDocs
36- doLast {
37- execute([" git" , " init" ])
38- execute([" git" , " checkout" , " -b" , " gh-pages" ])
39- execute([" git" , " add" , " _sass" ])
40- execute([" git" , " add" , " groovydoc" , " --force" ]) // Is in .gitignore but needed for docs
41- execute([" git" , " add" , " processors" ])
42- execute([" git" , " add" , " _config.yml" ])
43- execute([" git" , " add" , " favicon.ico" ])
44- execute([" git" , " add" , " Gemfile*" ])
45- execute([" git" , " add" , " *.md" ])
46- execute([" git" , " commit" , " -m" , " 'Update docs'" ])
47- execute([" git" , " push" , " git@github.com:ultraq/thymeleaf-layout-dialect" , " gh-pages" , " --force" ])
48- execute([" rm" , " -rf" , " .git" ])
49- }
50- }
51-
52- /**
53- * Execute an individual command and wait for the process to complete.
54- *
55- * @param command
56- */
57- def execute (command ) {
58- println " Executing: ${ command.join(" ")} "
59- def proc = command. execute(null , projectDir)
60- proc. waitForProcessOutput(System . out, System . err)
61- if (proc. exitValue() > 0 ) {
62- println " ${ proc.err.text} "
63- }
36+ commandLine ' ./publishDocs.sh'
6437}
6538
6639tasks. register(' cleanDocs' , Exec ) {
0 commit comments