Skip to content

Commit f00be77

Browse files
committed
Use publishing shell script - Gradle 9 can't inline commands any more
1 parent 75b74f7 commit f00be77

2 files changed

Lines changed: 35 additions & 33 deletions

File tree

thymeleaf-layout-dialect-docs/build.gradle

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
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

6639
tasks.register('cleanDocs', Exec) {
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
#
3+
# Copyright 2026, Emanuel Rabina (http://www.ultraq.net.nz/)
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
git init
19+
git checkout -b gh-pages
20+
git add _sass
21+
git add groovydoc --force # Is in .gitignore but needed for docs
22+
git add processors
23+
git add _config.yml
24+
git add favicon.ico
25+
git add Gemfile*
26+
git add *.md
27+
git commit -m "Update docs"
28+
git push git@github.com:ultraq/thymeleaf-layout-dialect gh-pages --force
29+
rm -rf .git

0 commit comments

Comments
 (0)