From 82c32bb4482a5c1c442fbb742294c6d02e4c55ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= <interface@p3k.org>
Date: Sat, 15 Jun 2024 12:23:03 +0200
Subject: [PATCH 01/14] Slightly modify the format of the build date

---
 build.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.gradle b/build.gradle
index 7fbd71a4..4289728a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -157,7 +157,7 @@ run {
 }
 
 task processSource(type: Sync) {
-  def date = new Date().format("MMMM dd, yyyy")
+  def date = new Date().format("d MMM yyyy")
   def gitOutput = new ByteArrayOutputStream()
 
   exec {

From 3a9c14898bbf12c267d1e8b4e08ffe35951fbac2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= <interface@p3k.org>
Date: Sat, 15 Jun 2024 12:24:17 +0200
Subject: [PATCH 02/14] Update run configuration to always use the correct
 dependencies

---
 build.gradle | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/build.gradle b/build.gradle
index 4289728a..9274574b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -102,6 +102,8 @@ distributions {
 }
 
 application {
+  mainClass = 'helma.main.Server'
+
   applicationDistribution.from(projectDir) {
     include 'modules/**'
     include 'LICENSE.md'
@@ -152,8 +154,8 @@ installDist {
 }
 
 run {
-  classpath = files('launcher.jar')
   jvmArgs jettyLogLevel, suppressMacosDockIcon
+  classpath += fileTree(dir: 'lib/ext', include: '*.jar')
 }
 
 task processSource(type: Sync) {

From ed56cf72f7c1509e2a07503c1b418ce9c7b6b7bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= <interface@p3k.org>
Date: Sat, 15 Jun 2024 12:37:16 +0200
Subject: [PATCH 03/14] Slightly modify the version string (still a date
 representation)

---
 build.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.gradle b/build.gradle
index 9274574b..026e1380 100644
--- a/build.gradle
+++ b/build.gradle
@@ -25,7 +25,7 @@ allprojects {
   }
 }
 
-version = new Date().format("yyyyMMdd")
+version = new Date().format("yy.M.d")
 
 tasks.build.dependsOn javadoc, 'jsdoc', 'generateLicenseReport'
 tasks.compileJava.dependsOn 'processSource'

From 196794cd933151343b19fc16bbe75acbe82d4eae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= <interface@p3k.org>
Date: Sat, 15 Jun 2024 12:38:04 +0200
Subject: [PATCH 04/14] Reorder the tasks

---
 build.gradle | 56 ++++++++++++++++++++++++++--------------------------
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/build.gradle b/build.gradle
index 026e1380..70590c86 100644
--- a/build.gradle
+++ b/build.gradle
@@ -76,29 +76,9 @@ def rhinoJar = configurations.library.files.find { jar ->
   jar.name.startsWith('rhino')
 }
 
-startScripts {
-  applicationName = 'helma'
-  classpath = files('../launcher.jar')
-  mainClass = 'helma.main.launcher.Main'
-
-  defaultJvmOpts = [jettyLogLevel, suppressMacosDockIcon]
-
-  doLast {
-    // Work-around to make the classpath above work (launcher.jar is located outside of `lib` dir)
-    // See https://discuss.gradle.org/t/classpath-in-application-plugin-is-building-always-relative-to-app-home-lib-directory/2012
-    def unixScriptFile = file getUnixScript()
-    def windowsScriptFile = file getWindowsScript()
-    unixScriptFile.text = unixScriptFile.text.replace('$APP_HOME/lib', '$APP_HOME')
-    windowsScriptFile.text = windowsScriptFile.text.replace('%APP_HOME%\\lib', '%APP_HOME%')
-  }
-}
-
-distributions {
-  main {
-    contents {
-      from project(':launcher').jar
-    }
-  }
+run {
+  jvmArgs jettyLogLevel, suppressMacosDockIcon
+  classpath += fileTree(dir: 'lib/ext', include: '*.jar')
 }
 
 application {
@@ -127,6 +107,31 @@ application {
   }
 }
 
+startScripts {
+  applicationName = 'helma'
+  classpath = files('../launcher.jar')
+  mainClass = 'helma.main.launcher.Main'
+
+  defaultJvmOpts = [jettyLogLevel, suppressMacosDockIcon]
+
+  doLast {
+    // Work-around to make the classpath above work (launcher.jar is located outside of `lib` dir)
+    // See https://discuss.gradle.org/t/classpath-in-application-plugin-is-building-always-relative-to-app-home-lib-directory/2012
+    def unixScriptFile = file getUnixScript()
+    def windowsScriptFile = file getWindowsScript()
+    unixScriptFile.text = unixScriptFile.text.replace('$APP_HOME/lib', '$APP_HOME')
+    windowsScriptFile.text = windowsScriptFile.text.replace('%APP_HOME%\\lib', '%APP_HOME%')
+  }
+}
+
+distributions {
+  main {
+    contents {
+      from project(':launcher').jar
+    }
+  }
+}
+
 distTar {
   dependsOn ':generateLicenseReport', ':javadoc', ':jsdoc'
 
@@ -153,11 +158,6 @@ installDist {
   }
 }
 
-run {
-  jvmArgs jettyLogLevel, suppressMacosDockIcon
-  classpath += fileTree(dir: 'lib/ext', include: '*.jar')
-}
-
 task processSource(type: Sync) {
   def date = new Date().format("d MMM yyyy")
   def gitOutput = new ByteArrayOutputStream()

From 79b7e8092b6b41c0ba45efa48c6daf2df08f2d27 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= <interface@p3k.org>
Date: Sat, 15 Jun 2024 13:02:11 +0200
Subject: [PATCH 05/14] Decouple update task from install

Now that Gradle runs Helma with the configured dependencies, updating the installation directory has become less crucial
---
 README.md    | 6 ++++--
 build.gradle | 6 ++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index 2a134485..e93af8d1 100644
--- a/README.md
+++ b/README.md
@@ -33,10 +33,12 @@ Helma is built with [Gradle](https://gradle.org), the build task depends on the
 
 ### Additional Prerequisites
 
-* [Rsync](https://rsync.samba.org) version ≥ 3.1.0
 * [Node.js](https://nodejs.org) LTS version
+* [Rsync](https://rsync.samba.org) version ≥ 3.1.0
 
-Clone this repository to your machine and start the build process with `./gradlew install`. The build script is going to ask you if you want to update the installation, enter `yes` or `no`.
+Clone this repository to your machine and run Helma with `./gradlew run`.
+
+To update the installation from a build, run `./gradlew update` and enter `yes` at the prompt.
 
 > ⚠️    
 > Please be aware that this step is going to overwrite files in the installation directory – escpecially at a later time when there might be substantial changes. Should this happen by accident you find the previous installation in the `backups` directory.
diff --git a/build.gradle b/build.gradle
index 70590c86..6a6e36be 100644
--- a/build.gradle
+++ b/build.gradle
@@ -152,10 +152,6 @@ distZip {
 
 installDist {
   dependsOn build
-
-  if (!System.getenv('CI')) {
-    finalizedBy 'update'
-  }
 }
 
 task processSource(type: Sync) {
@@ -183,6 +179,8 @@ task processSource(type: Sync) {
 }
 
 task update {
+  dependsOn installDist
+
   def rsyncArgs = ['--archive', '--filter', '- backups']
 
   def confirm = {

From 6b694a83ed535e1b9600bcb3babd2340921e52cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= <interface@p3k.org>
Date: Sat, 15 Jun 2024 14:59:33 +0200
Subject: [PATCH 06/14] Add setup for Gradle debugging in VS Codium

---
 .vscode/launch.json | 128 ++++++++++++++++----------------------------
 .vscode/tasks.json  |  66 +++++++++++++++++++++++
 build.gradle        |   8 +++
 3 files changed, 119 insertions(+), 83 deletions(-)
 create mode 100644 .vscode/tasks.json

diff --git a/.vscode/launch.json b/.vscode/launch.json
index 8310c621..d1cf813f 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -1,84 +1,46 @@
 {
-    // Use IntelliSense to learn about possible attributes.
-    // Hover to view descriptions of existing attributes.
-    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
-    "version": "0.2.0",
-    "configurations": [
-        {
-            "type": "java",
-            "name": "Current File",
-            "request": "launch",
-            "mainClass": "${file}"
-        },
-        {
-            "type": "java",
-            "name": "ImageInfo",
-            "request": "launch",
-            "mainClass": "helma.image.ImageInfo",
-            "projectName": "helma_"
-        },
-        {
-            "type": "java",
-            "name": "CommandlineRunner",
-            "request": "launch",
-            "mainClass": "helma.main.CommandlineRunner",
-            "projectName": "helma_"
-        },
-        {
-            "type": "java",
-            "name": "Server",
-            "request": "launch",
-            "mainClass": "helma.main.Server",
-            "projectName": "helma_"
-        },
-        {
-            "type": "java",
-            "name": "XmlConverter",
-            "request": "launch",
-            "mainClass": "helma.objectmodel.dom.XmlConverter",
-            "projectName": "helma_"
-        },
-        {
-            "type": "java",
-            "name": "Crypt",
-            "request": "launch",
-            "mainClass": "helma.util.Crypt",
-            "projectName": "helma_"
-        },
-        {
-            "type": "java",
-            "name": "HtmlEncoder",
-            "request": "launch",
-            "mainClass": "helma.util.HtmlEncoder",
-            "projectName": "helma_"
-        },
-        {
-            "type": "java",
-            "name": "Logo",
-            "request": "launch",
-            "mainClass": "helma.util.Logo",
-            "projectName": "helma_"
-        },
-        {
-            "type": "java",
-            "name": "MarkdownProcessor",
-            "request": "launch",
-            "mainClass": "helma.util.MarkdownProcessor",
-            "projectName": "helma_"
-        },
-        {
-            "type": "java",
-            "name": "Commandline",
-            "request": "launch",
-            "mainClass": "helma.main.launcher.Commandline",
-            "projectName": "launcher"
-        },
-        {
-            "type": "java",
-            "name": "Main",
-            "request": "launch",
-            "mainClass": "helma.main.launcher.Main",
-            "projectName": "launcher"
-        }
-    ]
-}
\ No newline at end of file
+  // Use IntelliSense to learn about possible attributes.
+  // Hover to view descriptions of existing attributes.
+  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+  "version": "0.2.0",
+  "configurations": [
+    {
+      "type": "java",
+      "name": "Current File",
+      "request": "launch",
+      "mainClass": "${file}"
+    },
+    {
+      "type": "java",
+      "name": "Run with Gradle",
+      "request": "launch",
+      "mainClass": "helma.main.Server",
+      "projectName": "helma",
+      "preLaunchTask": "Run with Gradle",
+      "console": "internalConsole",
+      "stopOnEntry": false
+    },
+    {
+      "name": "Debug with Gradle",
+      "type": "java",
+      "request": "attach",
+      "hostName": "localhost",
+      "port": 5005,
+      "preLaunchTask": "Debug with Gradle"
+    },
+    {
+      "type": "java",
+      "name": "Commandline",
+      "request": "launch",
+      "mainClass": "helma.main.launcher.Commandline",
+      "projectName": "launcher"
+    },
+    {
+      "type": "java",
+      "name": "Main",
+      "request": "launch",
+      "mainClass": "helma.main.launcher.Main",
+      "projectName": "launcher"
+    }
+  ]
+}
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644
index 00000000..78bedb1f
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,66 @@
+{
+  // See https://go.microsoft.com/fwlink/?LinkId=733558
+  // for the documentation about the tasks.json format
+  "version": "2.0.0",
+  "tasks": [
+    {
+      "label": "Run with Gradle",
+      "type": "shell",
+      "command": "./gradlew run",
+      "isBackground": true,
+      "group": {
+        "isDefault": true
+      },
+      "problemMatcher": {
+        "owner": "java",
+        "fileLocation": "absolute",
+        "pattern": [
+          {
+            // [2024/06/15 16:23:22] [ERROR] [antville-1] GET:main.css helma.scripting.ScriptingException: TypeError: Cannot find function getStaticFile in object HopObject Skin. (/home/tobi/Projects/helma/repo/./apps/antville/code/Site/Site.js#474)
+            "regexp": "^\\[.+\\] \\[(.+)\\] \\[.+\\] \\S+ \\s+: (.+) \\(([^#]+)#(\\d+)\\)$",
+            "severity": 1,
+            "message": 2,
+            "file": 3,
+            "line": 4
+          },
+          {
+            // [2024/06/15 17:26:00] [INFO] [antville-1] INTERNAL:onStart done in 381 millis
+            "regexp": "^.+INTERNAL:onStart done in \\d+ millis",
+            "kind": "file",
+            "file": 0
+          }
+        ],
+        "background": {
+          "activeOnStart": true,
+          "beginsPattern": "^.+(INTERNAL):onStart done in \\d+ millis",
+          "endsPattern": "terminated with exit code"
+        }
+      }
+    },
+    {
+      "label": "Debug with Gradle",
+      "type": "shell",
+      "command": "./gradlew debug",
+      "isBackground": true,
+      "problemMatcher": {
+        "owner": "custom",
+        "fileLocation": "absolute",
+        "pattern": [
+          {
+            // [2024/06/15 16:23:22] [ERROR] [antville-1] GET:main.css helma.scripting.ScriptingException: TypeError: Cannot find function getStaticFile in object HopObject Skin. (/home/tobi/Projects/helma/repo/./apps/antville/code/Site/Site.js#474)
+            "regexp": "^\\[.+\\] \\[(.+)\\] \\[.+\\] \\S+ \\s+: (.+) \\(([^#]+)#(\\d+)\\)$",
+            "severity": 1,
+            "message": 2,
+            "file": 3,
+            "line": 4
+          }
+        ],
+        "background": {
+          "activeOnStart": true,
+          "beginsPattern": "Listening for transport dt_socket at address",
+          "endsPattern": "terminated with exit code"
+        }
+      }
+    }
+  ]
+}
diff --git a/build.gradle b/build.gradle
index 6a6e36be..51f1e798 100644
--- a/build.gradle
+++ b/build.gradle
@@ -290,3 +290,11 @@ task commandLine(type: JavaExec) {
   mainClass = 'helma.main.launcher.Commandline'
   args '-h', projectDir, function
 }
+
+tasks.register('debug', JavaExec) {
+  group = 'application'
+  main = 'helma.main.Server'
+  classpath = sourceSets.main.runtimeClasspath
+  jvmArgs = ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005']
+  classpath += fileTree(dir: 'lib/ext', include: '*.jar')
+}

From c1ad40ef72270d24323505892ce003a01c5d7d4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= <interface@p3k.org>
Date: Sat, 15 Jun 2024 18:01:30 +0200
Subject: [PATCH 07/14] Remove over-complicated launch and tasks configuration
 in favor of Gradle plugin
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Starting run/debug tasks with the plugin works out of the box;
one just has to avoid the default “Run and Debug” button.
---
 .vscode/extensions.json |  3 +-
 .vscode/launch.json     | 46 ----------------------------
 .vscode/tasks.json      | 66 -----------------------------------------
 3 files changed, 2 insertions(+), 113 deletions(-)
 delete mode 100644 .vscode/launch.json
 delete mode 100644 .vscode/tasks.json

diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index 0d95f065..c52f6863 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -1,5 +1,6 @@
 {
     "recommendations": [
-        "vscjava.vscode-java-pack"
+        "vscjava.vscode-java-pack",
+        "vscjava.vscode-gradle"
     ]
 }
diff --git a/.vscode/launch.json b/.vscode/launch.json
deleted file mode 100644
index d1cf813f..00000000
--- a/.vscode/launch.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
-  // Use IntelliSense to learn about possible attributes.
-  // Hover to view descriptions of existing attributes.
-  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
-  "version": "0.2.0",
-  "configurations": [
-    {
-      "type": "java",
-      "name": "Current File",
-      "request": "launch",
-      "mainClass": "${file}"
-    },
-    {
-      "type": "java",
-      "name": "Run with Gradle",
-      "request": "launch",
-      "mainClass": "helma.main.Server",
-      "projectName": "helma",
-      "preLaunchTask": "Run with Gradle",
-      "console": "internalConsole",
-      "stopOnEntry": false
-    },
-    {
-      "name": "Debug with Gradle",
-      "type": "java",
-      "request": "attach",
-      "hostName": "localhost",
-      "port": 5005,
-      "preLaunchTask": "Debug with Gradle"
-    },
-    {
-      "type": "java",
-      "name": "Commandline",
-      "request": "launch",
-      "mainClass": "helma.main.launcher.Commandline",
-      "projectName": "launcher"
-    },
-    {
-      "type": "java",
-      "name": "Main",
-      "request": "launch",
-      "mainClass": "helma.main.launcher.Main",
-      "projectName": "launcher"
-    }
-  ]
-}
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
deleted file mode 100644
index 78bedb1f..00000000
--- a/.vscode/tasks.json
+++ /dev/null
@@ -1,66 +0,0 @@
-{
-  // See https://go.microsoft.com/fwlink/?LinkId=733558
-  // for the documentation about the tasks.json format
-  "version": "2.0.0",
-  "tasks": [
-    {
-      "label": "Run with Gradle",
-      "type": "shell",
-      "command": "./gradlew run",
-      "isBackground": true,
-      "group": {
-        "isDefault": true
-      },
-      "problemMatcher": {
-        "owner": "java",
-        "fileLocation": "absolute",
-        "pattern": [
-          {
-            // [2024/06/15 16:23:22] [ERROR] [antville-1] GET:main.css helma.scripting.ScriptingException: TypeError: Cannot find function getStaticFile in object HopObject Skin. (/home/tobi/Projects/helma/repo/./apps/antville/code/Site/Site.js#474)
-            "regexp": "^\\[.+\\] \\[(.+)\\] \\[.+\\] \\S+ \\s+: (.+) \\(([^#]+)#(\\d+)\\)$",
-            "severity": 1,
-            "message": 2,
-            "file": 3,
-            "line": 4
-          },
-          {
-            // [2024/06/15 17:26:00] [INFO] [antville-1] INTERNAL:onStart done in 381 millis
-            "regexp": "^.+INTERNAL:onStart done in \\d+ millis",
-            "kind": "file",
-            "file": 0
-          }
-        ],
-        "background": {
-          "activeOnStart": true,
-          "beginsPattern": "^.+(INTERNAL):onStart done in \\d+ millis",
-          "endsPattern": "terminated with exit code"
-        }
-      }
-    },
-    {
-      "label": "Debug with Gradle",
-      "type": "shell",
-      "command": "./gradlew debug",
-      "isBackground": true,
-      "problemMatcher": {
-        "owner": "custom",
-        "fileLocation": "absolute",
-        "pattern": [
-          {
-            // [2024/06/15 16:23:22] [ERROR] [antville-1] GET:main.css helma.scripting.ScriptingException: TypeError: Cannot find function getStaticFile in object HopObject Skin. (/home/tobi/Projects/helma/repo/./apps/antville/code/Site/Site.js#474)
-            "regexp": "^\\[.+\\] \\[(.+)\\] \\[.+\\] \\S+ \\s+: (.+) \\(([^#]+)#(\\d+)\\)$",
-            "severity": 1,
-            "message": 2,
-            "file": 3,
-            "line": 4
-          }
-        ],
-        "background": {
-          "activeOnStart": true,
-          "beginsPattern": "Listening for transport dt_socket at address",
-          "endsPattern": "terminated with exit code"
-        }
-      }
-    }
-  ]
-}

From 0f8bace3dd184ee5406c1ef13c502a9b80f5c8af Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= <interface@p3k.org>
Date: Sat, 15 Jun 2024 18:20:36 +0200
Subject: [PATCH 08/14] Keep the lib/ext directory around

---
 lib/ext/.keep | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 lib/ext/.keep

diff --git a/lib/ext/.keep b/lib/ext/.keep
new file mode 100644
index 00000000..e69de29b

From bd70d2fb625a5f83981ca1b680cc5423de37b9bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= <interface@p3k.org>
Date: Sat, 15 Jun 2024 19:08:12 +0200
Subject: [PATCH 09/14] Disable automatic deployment

---
 .github/workflows/deploy.yml | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index fb6355e9..557fdb16 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -1,10 +1,6 @@
 name: Deploy (Production)
 
-on:
-  workflow_dispatch: {}
-  push:
-    branches:
-      - helma-🐜
+on: workflow_dispatch
 
 jobs:
   deploy:

From 5de4616df076b03673836f42ab5e2c3a10e602b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= <interface@p3k.org>
Date: Sat, 15 Jun 2024 19:09:11 +0200
Subject: [PATCH 10/14] Use main website as environment

---
 .github/workflows/deploy.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 557fdb16..c01702e5 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -7,8 +7,8 @@ jobs:
     runs-on: ubuntu-latest
 
     environment:
-      name: p3k.org
-      url: https://blog.p3k.org
+      name: weblogs.at
+      url: https://weblogs.at
 
     steps:
       - name: Set up SSH agent

From efb7ad89b322d77ab623e1b1005e7f463564de60 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= <interface@p3k.org>
Date: Sat, 15 Jun 2024 22:43:26 +0200
Subject: [PATCH 11/14] Add static fields for build date and commit hash

---
 build.gradle                         | 13 ++++---------
 src/main/java/helma/main/Server.java |  8 +++++++-
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/build.gradle b/build.gradle
index 51f1e798..186076f6 100644
--- a/build.gradle
+++ b/build.gradle
@@ -155,26 +155,21 @@ installDist {
 }
 
 task processSource(type: Sync) {
-  def date = new Date().format("d MMM yyyy")
   def gitOutput = new ByteArrayOutputStream()
 
   exec {
-    commandLine 'git', 'describe'
+    commandLine 'git', 'rev-parse', '--short', 'HEAD'
     standardOutput = gitOutput
     errorOutput = new ByteArrayOutputStream()
     ignoreExitValue = true
   }
 
-  def description = date
-  def tag = gitOutput.toString().trim()
-
-  // TODO: Implement extended description in Java code
-  if (tag) description = "$tag; $description"
-
   from 'src'
 
   filter {
-    line -> line.replaceAll('__builddate__', date)
+    line -> line
+      .replaceAll('__builddate__', new Date().format("d MMM yyyy"))
+      .replaceAll('__commithash__', gitOutput.toString().trim())
   } into "${project.buildDir}/src"
 }
 
diff --git a/src/main/java/helma/main/Server.java b/src/main/java/helma/main/Server.java
index 4966551c..b747f11e 100644
--- a/src/main/java/helma/main/Server.java
+++ b/src/main/java/helma/main/Server.java
@@ -36,7 +36,13 @@ import helma.util.ResourceProperties;
  */
 public class Server implements Runnable {
     // version string
-    public static final String version = "🐜 (__builddate__)";
+    public static final String version = "🐜";
+
+    // build date
+    public static final String buildDate = "__builddate__";
+
+    // commit hash
+    public static final String commitHash = "__commithash__";
 
     // static server instance
     private static Server server;

From 87675fd6cd674f8cb24813599e0d9e931a339af9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= <interface@p3k.org>
Date: Sat, 15 Jun 2024 23:01:45 +0200
Subject: [PATCH 12/14] Fix deprecation warning for Java plugin conventions

---
 build.gradle | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/build.gradle b/build.gradle
index 186076f6..d609eb5f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -17,8 +17,10 @@ def textFiles = ['**/*.hac', '**/.html', '**/*.js', '**/*.md', '**/*.properties'
 allprojects {
   apply plugin: 'java'
 
-  sourceCompatibility = JavaVersion.VERSION_11
-  targetCompatibility = JavaVersion.VERSION_11
+  java {
+    sourceCompatibility = JavaVersion.VERSION_11
+    targetCompatibility = JavaVersion.VERSION_11
+  }
 
   repositories {
     mavenCentral()

From 608fd695c443a9c422a25824b3921334894b81e2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= <interface@p3k.org>
Date: Sat, 15 Jun 2024 23:06:35 +0200
Subject: [PATCH 13/14] Switch to tasks.register() to define custom tasks

---
 build.gradle                          | 14 +++++++-------
 modules/helma/build.gradle            |  2 +-
 modules/jala/build.gradle             |  2 +-
 modules/jala/util/HopKit/build.gradle |  2 +-
 modules/jala/util/Test/build.gradle   |  2 +-
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/build.gradle b/build.gradle
index d609eb5f..452375fb 100644
--- a/build.gradle
+++ b/build.gradle
@@ -156,7 +156,7 @@ installDist {
   dependsOn build
 }
 
-task processSource(type: Sync) {
+tasks.register('processSource', Sync) {
   def gitOutput = new ByteArrayOutputStream()
 
   exec {
@@ -175,7 +175,7 @@ task processSource(type: Sync) {
   } into "${project.buildDir}/src"
 }
 
-task update {
+tasks.register('update') {
   dependsOn installDist
 
   def rsyncArgs = ['--archive', '--filter', '- backups']
@@ -221,7 +221,7 @@ task update {
   }
 }
 
-task jsdoc(type: Exec) {
+tasks.register('jsdoc', Exec) {
   description 'Generates JSDoc API documentation for the included JavaScript modules.'
   group 'Documentation'
 
@@ -235,7 +235,7 @@ task jsdoc(type: Exec) {
   args = ['jsdoc', '-d', "$destination"].plus(sources)
 }
 
-task xgettext(type: JavaExec) {
+tasks.register('xgettext', JavaExec) {
   description 'Extracts translatable message strings from source code.'
   group 'i18n'
 
@@ -252,7 +252,7 @@ task xgettext(type: JavaExec) {
   ]
 }
 
-task po2js(type: JavaExec) {
+tasks.register('po2js', JavaExec) {
   description 'Converts translated message strings from PO format to JavaScript.'
   group 'i18n'
 
@@ -267,7 +267,7 @@ task po2js(type: JavaExec) {
   ]
 }
 
-task rhinoShell(type: JavaExec) {
+tasks.register('rhinoShell', JavaExec) {
   description 'Runs the interactive Rhino JavaScript shell.'
   group 'Application'
 
@@ -279,7 +279,7 @@ task rhinoShell(type: JavaExec) {
 
 // Call this task with a function definition using the `-P` parameter, e.g.
 // `./gradlew commandLine -Pfunction=manage.getAllApplications`
-task commandLine(type: JavaExec) {
+tasks.register('commandLine', JavaExec) {
   description 'Runs a function in a Helma application with `-Pfunction=app.functionName`.'
   group 'Application'
 
diff --git a/modules/helma/build.gradle b/modules/helma/build.gradle
index f78f66d4..401dd406 100644
--- a/modules/helma/build.gradle
+++ b/modules/helma/build.gradle
@@ -12,7 +12,7 @@ processResources.enabled = false
 processTestResources.enabled = false
 test.enabled = false
 
-task deps(type: Copy) {
+tasks.register('deps', Copy) {
 	from sourceSets.main.runtimeClasspath
 	into '.'
 }
diff --git a/modules/jala/build.gradle b/modules/jala/build.gradle
index e1ef800f..3b9b6684 100644
--- a/modules/jala/build.gradle
+++ b/modules/jala/build.gradle
@@ -15,7 +15,7 @@ processResources.enabled = false
 processTestResources.enabled = false
 test.enabled = false
 
-task deps(type: Copy) {
+tasks.register('deps', Copy) {
 	from sourceSets.main.runtimeClasspath
 	into 'lib'
 }
diff --git a/modules/jala/util/HopKit/build.gradle b/modules/jala/util/HopKit/build.gradle
index f6b40342..f8c9778e 100644
--- a/modules/jala/util/HopKit/build.gradle
+++ b/modules/jala/util/HopKit/build.gradle
@@ -10,7 +10,7 @@ processResources.enabled = false
 processTestResources.enabled = false
 test.enabled = false
 
-task deps(type: Copy) {
+tasks.register('deps', Copy) {
 	from sourceSets.main.runtimeClasspath
 	into 'lib'
 }
diff --git a/modules/jala/util/Test/build.gradle b/modules/jala/util/Test/build.gradle
index 91015efc..7e596efa 100644
--- a/modules/jala/util/Test/build.gradle
+++ b/modules/jala/util/Test/build.gradle
@@ -10,7 +10,7 @@ processResources.enabled = false
 processTestResources.enabled = false
 test.enabled = false
 
-task deps(type: Copy) {
+tasks.register('deps', Copy) {
 	from sourceSets.main.runtimeClasspath
 	into 'code'
 }

From 44f23757498a5f6c150e94a93f00edeed82fb1cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= <interface@p3k.org>
Date: Thu, 8 Aug 2024 19:35:22 +0200
Subject: [PATCH 14/14] Update URL of stage environment

---
 .github/workflows/stage.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/stage.yml b/.github/workflows/stage.yml
index 692beac1..4f015093 100644
--- a/.github/workflows/stage.yml
+++ b/.github/workflows/stage.yml
@@ -8,7 +8,7 @@ jobs:
 
     environment:
       name: stage
-      url: https://antville-test.click
+      url: https://antville-test.online
 
     steps:
       - uses: actions/checkout@v4