diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fb6355e9..c01702e5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,18 +1,14 @@ name: Deploy (Production) -on: - workflow_dispatch: {} - push: - branches: - - helma-🐜 +on: workflow_dispatch jobs: deploy: 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 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 diff --git a/build.gradle b/build.gradle index 94a72550..2f31f466 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_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } repositories { mavenCentral() @@ -155,31 +157,26 @@ installDist { dependsOn build } -task processSource(type: Sync) { - def date = new Date().format("d MMMM yyyy") +tasks.register('processSource', Sync) { 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" } -task update { +tasks.register('update') { dependsOn installDist def rsyncArgs = ['--archive', '--filter', '- backups'] @@ -225,7 +222,7 @@ task update { } } -task jsdoc(type: Exec) { +tasks.register('jsdoc', Exec) { description 'Generates JSDoc API documentation for the included JavaScript modules.' group 'Documentation' @@ -239,7 +236,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' @@ -256,7 +253,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' @@ -271,7 +268,7 @@ task po2js(type: JavaExec) { ] } -task rhinoShell(type: JavaExec) { +tasks.register('rhinoShell', JavaExec) { description 'Runs the interactive Rhino JavaScript shell.' group 'Application' @@ -283,7 +280,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/lib/ext/.keep b/lib/ext/.keep new file mode 100644 index 00000000..e69de29b 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' } 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;