Compare commits

..

15 commits

Author SHA1 Message Date
78d07cecce
Merge branch 'main' into renovate/major-jetty-packages
# Conflicts:
#	build.gradle
2025-01-10 19:58:40 +01:00
44f2375749
Update URL of stage environment 2024-08-08 19:35:22 +02:00
608fd695c4
Switch to tasks.register() to define custom tasks 2024-06-15 23:08:45 +02:00
87675fd6cd
Fix deprecation warning for Java plugin conventions 2024-06-15 23:01:45 +02:00
efb7ad89b3
Add static fields for build date and commit hash 2024-06-15 22:43:26 +02:00
5de4616df0
Use main website as environment 2024-06-15 21:37:17 +02:00
bd70d2fb62
Disable automatic deployment 2024-06-15 21:37:17 +02:00
0f8bace3dd
Keep the lib/ext directory around 2024-06-15 21:37:17 +02:00
c1ad40ef72
Remove over-complicated launch and tasks configuration in favor of Gradle plugin
Starting run/debug tasks with the plugin works out of the box;
one just has to avoid the default “Run and Debug” button.
2024-06-15 21:37:17 +02:00
6b694a83ed
Add setup for Gradle debugging in VS Codium 2024-06-15 21:37:16 +02:00
79b7e8092b
Decouple update task from install
Now that Gradle runs Helma with the configured dependencies, updating the installation directory has become less crucial
2024-06-15 21:37:16 +02:00
196794cd93
Reorder the tasks 2024-06-15 21:37:16 +02:00
ed56cf72f7
Slightly modify the version string (still a date representation) 2024-06-15 21:37:16 +02:00
3a9c14898b
Update run configuration to always use the correct dependencies 2024-06-15 21:37:16 +02:00
82c32bb448
Slightly modify the format of the build date 2024-06-15 21:37:16 +02:00
9 changed files with 30 additions and 31 deletions

View file

@ -1,18 +1,14 @@
name: Deploy (Production) name: Deploy (Production)
on: on: workflow_dispatch
workflow_dispatch: {}
push:
branches:
- helma-🐜
jobs: jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment: environment:
name: p3k.org name: weblogs.at
url: https://blog.p3k.org url: https://weblogs.at
steps: steps:
- name: Set up SSH agent - name: Set up SSH agent

View file

@ -8,7 +8,7 @@ jobs:
environment: environment:
name: stage name: stage
url: https://antville-test.click url: https://antville-test.online
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View file

@ -17,8 +17,10 @@ def textFiles = ['**/*.hac', '**/.html', '**/*.js', '**/*.md', '**/*.properties'
allprojects { allprojects {
apply plugin: 'java' apply plugin: 'java'
java {
sourceCompatibility = JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17
}
repositories { repositories {
mavenCentral() mavenCentral()
@ -155,31 +157,26 @@ installDist {
dependsOn build dependsOn build
} }
task processSource(type: Sync) { tasks.register('processSource', Sync) {
def date = new Date().format("d MMMM yyyy")
def gitOutput = new ByteArrayOutputStream() def gitOutput = new ByteArrayOutputStream()
exec { exec {
commandLine 'git', 'describe' commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = gitOutput standardOutput = gitOutput
errorOutput = new ByteArrayOutputStream() errorOutput = new ByteArrayOutputStream()
ignoreExitValue = true ignoreExitValue = true
} }
def description = date
def tag = gitOutput.toString().trim()
// TODO: Implement extended description in Java code
if (tag) description = "$tag; $description"
from 'src' from 'src'
filter { 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" } into "${project.buildDir}/src"
} }
task update { tasks.register('update') {
dependsOn installDist dependsOn installDist
def rsyncArgs = ['--archive', '--filter', '- backups'] 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.' description 'Generates JSDoc API documentation for the included JavaScript modules.'
group 'Documentation' group 'Documentation'
@ -239,7 +236,7 @@ task jsdoc(type: Exec) {
args = ['jsdoc', '-d', "$destination"].plus(sources) args = ['jsdoc', '-d', "$destination"].plus(sources)
} }
task xgettext(type: JavaExec) { tasks.register('xgettext', JavaExec) {
description 'Extracts translatable message strings from source code.' description 'Extracts translatable message strings from source code.'
group 'i18n' 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.' description 'Converts translated message strings from PO format to JavaScript.'
group 'i18n' 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.' description 'Runs the interactive Rhino JavaScript shell.'
group 'Application' group 'Application'
@ -283,7 +280,7 @@ task rhinoShell(type: JavaExec) {
// Call this task with a function definition using the `-P` parameter, e.g. // Call this task with a function definition using the `-P` parameter, e.g.
// `./gradlew commandLine -Pfunction=manage.getAllApplications` // `./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`.' description 'Runs a function in a Helma application with `-Pfunction=app.functionName`.'
group 'Application' group 'Application'

0
lib/ext/.keep Normal file
View file

View file

@ -12,7 +12,7 @@ processResources.enabled = false
processTestResources.enabled = false processTestResources.enabled = false
test.enabled = false test.enabled = false
task deps(type: Copy) { tasks.register('deps', Copy) {
from sourceSets.main.runtimeClasspath from sourceSets.main.runtimeClasspath
into '.' into '.'
} }

View file

@ -15,7 +15,7 @@ processResources.enabled = false
processTestResources.enabled = false processTestResources.enabled = false
test.enabled = false test.enabled = false
task deps(type: Copy) { tasks.register('deps', Copy) {
from sourceSets.main.runtimeClasspath from sourceSets.main.runtimeClasspath
into 'lib' into 'lib'
} }

View file

@ -10,7 +10,7 @@ processResources.enabled = false
processTestResources.enabled = false processTestResources.enabled = false
test.enabled = false test.enabled = false
task deps(type: Copy) { tasks.register('deps', Copy) {
from sourceSets.main.runtimeClasspath from sourceSets.main.runtimeClasspath
into 'lib' into 'lib'
} }

View file

@ -10,7 +10,7 @@ processResources.enabled = false
processTestResources.enabled = false processTestResources.enabled = false
test.enabled = false test.enabled = false
task deps(type: Copy) { tasks.register('deps', Copy) {
from sourceSets.main.runtimeClasspath from sourceSets.main.runtimeClasspath
into 'code' into 'code'
} }

View file

@ -36,7 +36,13 @@ import helma.util.ResourceProperties;
*/ */
public class Server implements Runnable { public class Server implements Runnable {
// version string // 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 // static server instance
private static Server server; private static Server server;