From 371be1e5eee04a2822e0ac867b133d3fb1f54f67 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Mon, 8 Sep 2025 12:01:21 +0200 Subject: [PATCH 01/59] add support for unique working dir - allows multiple script runners to be run concurrently - add some additional safe guard checks - improve readme - move JFR logs to logs directory --- .github/workflows/main.yml | 10 ++- .gitignore | 1 + CHANGELOG.md | 58 ++++++++++++++ README.md | 153 +++++++++++++++++++++++++++++++++++-- action.yml | 11 ++- build-run-cfml.xml | 12 ++- build.xml | 142 +++++++++++++++++++++++++++++----- pom.xml | 2 +- 8 files changed, 360 insertions(+), 29 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dab3dab..11af821 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,13 +31,13 @@ jobs: run: ant -DluceeVersionQuery="6/all/jar" -Dexecute="/debug.cfm" - name: Run Lucee 6 Stable - run: ant -DluceeVersion="6.0.3.1" -Dexecute="/debug.cfm" -Dtruth="cfml rocks" -Dauthor="Zac Spitzer" + run: ant -DluceeVersion="6.2.2.91" -Dexecute="/debug.cfm" -Dtruth="cfml rocks" -Dauthor="Zac Spitzer" - name: Run Lucee 5 (using Lucee light, no extensions) run: ant -DluceeVersion="light-5.4.2.17" -Dexecute="/debug.cfm" - name: Run Lucee 6 (using Lucee zero, no extensions, no admin, no docs) - run: ant -DluceeVersion="zero-6.0.3.1" -Dexecute="/debug.cfm" + run: ant -DluceeVersion="zero-6.2.2.91" -Dexecute="/debug.cfm" - name: Run Latest Lucee 5 RC Light run: ant -DluceeVersionQuery="5/rc/light" -Dexecute="/debug.cfm" @@ -48,3 +48,9 @@ jobs: - name: Run Latest Stable Lucee 5, compile webroot (invalid code) continue-on-error: true run: ant -DluceeVersionQuery="5/stable/jar" -Dexecute="/index.cfm" -Dcompile="true" -Dwebroot="${{ github.workspace }}/sampleBad/" + + - name: Test concurrent execution with unique working directories + run: | + ant -DuniqueWorkingDir="true" -Dexecute="/debug.cfm" & + ant -DuniqueWorkingDir="true" -Dexecute="/debug.cfm" & + wait diff --git a/.gitignore b/.gitignore index 4e0eaf7..bf525e7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ lucee-download-cache temp bin +logs diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..2fcac2f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,58 @@ +# Changelog + +All notable changes to the Lucee Script Runner project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added +- **Unique Working Directories**: Added `uniqueWorkingDir` parameter with three modes: + - `false` (default): Uses standard temp/lucee directory + - `true`: Auto-generates unique directory with timestamp and random ID + - Custom path: Uses specified directory path +- **Concurrent Execution Support**: Multiple script-runner instances can now run simultaneously without conflicts +- **Race Condition Detection**: Automatic detection and prevention of directory conflicts +- **Improved JFR Logging**: + - JFR files now output to organized `logs/` directory + - Descriptive filenames: `timestamp-lucee-version-webroot-script-javaversion.jfr` + - Added `logs/` to `.gitignore` +- **Enhanced Error Messages**: + - Git Bash path conversion detection with specific solutions + - Execute script validation with exact file path shown + - Windows trailing backslash validation +- **Cross-Platform Path Handling**: Robust path concatenation logic for Windows and Unix systems + +### Changed +- **Updated Lucee Version**: Standardized all references to version 6.2.2.91 across codebase +- **JFR Filename Format**: Changed from `lucee-version.jar-javaversion.jfr` to descriptive format with timestamp and context +- **Documentation**: Updated README.md with comprehensive working directory behavior explanations + +### Fixed +- **File Path Validation Bug**: Fixed concatenation logic for execute script validation +- **Git Bash Path Conversion Issues**: Added detection and helpful error messages for MSYS path conversion problems +- **Build Script Path Resolution**: Fixed relative path issues when using unique working directories + +### Technical Details + +#### New Ant Properties +- `uniqueWorkingDir`: Controls working directory behavior +- `webroot.name`: Extracted basename of webroot for JFR filenames +- `execute.clean`: Cleaned execute path (removes leading slashes) for JFR filenames +- `execute.fullpath`: Properly concatenated full path for file validation + +#### Build Process Improvements +- Added `set-unique-working-dir` target with timestamp generation and race condition checks +- Enhanced `run-cfml` target with improved validation and path handling +- Updated GitHub Actions workflow with concurrent execution tests + +#### Error Handling +- Early validation of execute script existence under webroot +- Specific error messages for common Git Bash issues +- Clear guidance on workarounds and solutions + +### Migration Notes +- Existing usage remains unchanged (backward compatible) +- New JFR files will appear in `logs/` directory instead of project root +- Git users should add `logs/` to their `.gitignore` if not already present \ No newline at end of file diff --git a/README.md b/README.md index 751c5b3..39dab32 100644 --- a/README.md +++ b/README.md @@ -6,15 +6,44 @@ Quickly run Lucee CFML applications headless (without a HTTP server) via the com Please report any issues, etc in the [Lucee Issue Tracker](https://luceeserver.atlassian.net/issues/?jql=labels%20%3D%20%22script-runner%22) +## Project Structure + +- `build.xml` - Main build file (always use this) +- `build-run-cfml.xml` - Internal file (do not run directly) +- `action.yml` - GitHub Action configuration +- `sample/` - Example CFML files for testing + ## Command line Usage +### Running from Different Directories + +The script-runner can be used from any directory by specifying the build file location: + +```bash +# From the script-runner directory (simple) +ant -Dwebroot="/path/to/your/project" -Dexecute="/yourscript.cfm" + +# From your project directory (recommended for external projects) +ant -buildfile="/path/to/script-runner/build.xml" -Dwebroot="." -Dexecute="/yourscript.cfm" + +# From any directory with absolute paths +ant -buildfile="C:\tools\script-runner\build.xml" -Dwebroot="C:\work\myproject" -Dexecute="/test.cfm" +``` + +**Key Points:** +- `-buildfile` specifies where script-runner is installed +- `-Dwebroot` is the directory containing your CFML code (can be relative to current directory) +- `-Dexecute` is the CFML script to run (relative to webroot) + +### Basic Usage + Default `ant` will run the `sample/index.cfm` file ![image](https://user-images.githubusercontent.com/426404/122402355-b0dbf980-cf7d-11eb-8837-37dec47d0713.png) You can specify: -- Lucee version `-DluceeVersion=` default `6.0.3.1`, (ie. 6.3.0.1, light-6.3.0.1, zero-6.3.0.1 ) +- Lucee version `-DluceeVersion=` default `6.2.2.91`, (ie. 6.2.2.91, light-6.2.2.91, zero-6.2.2.91 ) - Lucee version by query `-DluceeVersionQuery="5.4/stable/light` ( optional overrides luceeVersion, (version)/(stable/rc/snapshot)/(jar,light/zero) ) - Webroot `-Dwebroot=` (default `tests/`) on Windows, avoid a trailing \ as that is treated as an escape character causes script runner to fail - CFML Script to run, `-Dexecute=` (default `/index.cfm`) @@ -26,16 +55,129 @@ You can specify: - use a java debugger `-Ddebugger="true"` opens a java debugging port 5000, with suspend=y - preCleanup `-DpreCleanup="true"` purges the Lucee working dir before starting - postCleanup `-DpostCleanup="true"` purges the Lucee working dir after finishing +- uniqueWorkingDir `-DuniqueWorkingDir=` supports three modes: + - `"false"` (default): Uses standard `temp/lucee` directory + - `"true"`: Auto-generates unique directory `temp-unique/lucee-{VERSION}-{TIMESTAMP}-{RANDOM}` + - `"/custom/path"`: Uses specified custom directory path + +`ant -DluceeVersion="6.2.2.91" -Dwebroot="C:\work\lucee-docs" -Dexecute="import.cfm" -Dlucee.extensions=""` + +`ant -DluceeVersion="6.2.2.91" -DextensionDir="C:\work\lucee-extensions\extension-hibernate\dist"` + +### Quick Reference Examples + +```bash +# Testing Lucee Spreadsheet from its directory +cd D:\work\lucee-spreadsheet +ant -buildfile=D:\work\script-runner\build.xml -Dwebroot=. -Dexecute=/test/index.cfm + +# Testing with specific Lucee version +ant -buildfile=D:\work\script-runner\build.xml -DluceeVersionQuery=6.2/stable/jar -Dwebroot=D:\work\lucee-spreadsheet -Dexecute=/test/index.cfm + +# With unique working directory for concurrent runs +ant -buildfile=D:\work\script-runner\build.xml -DuniqueWorkingDir=true -Dwebroot=D:\work\lucee-spreadsheet -Dexecute=/test/index.cfm +``` + +### Working Directory Behavior + +**Default Mode** (`uniqueWorkingDir=false` or not specified): +- Uses a consistent local `temp/lucee` directory relative to script-runner location +- Same directory is reused across runs (cleaned with `preCleanup`/`postCleanup`) +- **Ideal for CI/CD**: Predictable location, faster subsequent runs due to caching +- **Single instance only**: Cannot run multiple concurrent instances + +**Auto-Unique Mode** (`uniqueWorkingDir=true`): +- Creates unique directories: `temp-unique/lucee-{VERSION}-{TIMESTAMP}-{RANDOM}` +- Each run gets its own isolated working directory +- **Enables concurrent execution**: Multiple instances can run simultaneously +- **Useful for**: Parallel testing, concurrent builds, isolation requirements + +**Custom Path Mode** (`uniqueWorkingDir=/custom/path`): +- Uses your specified directory as the working directory +- Full control over location (e.g., RAM disk, specific drive, shared folder) +- **Race protection**: Still checks for existing directory to prevent conflicts +- **Useful for**: Custom environments, performance optimization, specific storage requirements + +```bash +# Examples of the three modes: +ant -DuniqueWorkingDir=false # Uses: temp/lucee +ant -DuniqueWorkingDir=true # Uses: temp-unique/lucee-6.2.2.91-20250908-090047-669 +ant -DuniqueWorkingDir=C:/fast/work # Uses: C:/fast/work +``` -`ant -DluceeVersion="6.0.0.95-SNAPSHOT" -Dwebroot="C:\work\lucee-docs" -Dexecute="import.cfm" -Dlucee.extensions=""` +### Concurrent Execution + +Multiple script-runner instances can be run simultaneously using unique working directories: + +```bash +# Run multiple instances concurrently +ant -DuniqueWorkingDir="true" -Dexecute="/test1.cfm" & +ant -DuniqueWorkingDir="true" -Dexecute="/test2.cfm" & +ant -DuniqueWorkingDir="true" -Dexecute="/test3.cfm" & +wait +``` + +Each instance will use a unique working directory named `temp-unique/lucee-{VERSION}-{TIMESTAMP}-{RANDOM}` to prevent conflicts. + +## Troubleshooting + +### Common Issues on Windows + +**Problem**: Build fails with path-related errors +**Solution**: Avoid trailing backslashes in webroot paths: +```bash +# ❌ Wrong - trailing backslash causes escape issues +ant -Dwebroot="C:\work\myproject\" + +# ✅ Correct - no trailing backslash +ant -Dwebroot="C:\work\myproject" +ant -Dwebroot="C:/work/myproject/" # Forward slashes work too +``` + +**Problem**: "Could not locate build file" from other directories +**Solution**: Use absolute path to build.xml: +```bash +# ❌ Wrong - looking for build.xml in current directory +ant -Dwebroot="." -Dexecute="/test.cfm" + +# ✅ Correct - specify script-runner location +ant -buildfile="C:\tools\script-runner\build.xml" -Dwebroot="." -Dexecute="/test.cfm" +``` + +**Problem**: "File not found" for CFML scripts +**Solution**: Check webroot and execute paths: +```bash +# Verify your paths - execute is relative to webroot +ant -buildfile="/path/to/script-runner/build.xml" -Dwebroot="/your/project" -Dexecute="/debug.cfm" +``` + +**Problem**: "No shell found" or quote/escape errors on Windows +**Solution**: Use proper quote formatting for Windows command line: +```bash +# ❌ Wrong - excessive escaping or nested quotes +ant -buildfile=\"d:\work\script-runner\" -Dwebroot=\"D:\work\project\" + +# ✅ Correct - Windows Command Prompt (no quotes needed for paths without spaces) +ant -buildfile=d:\work\script-runner\build.xml -Dwebroot=D:\work\project -Dexecute=/test.cfm + +# ✅ Correct - Windows with spaces in paths (use quotes around entire parameter) +ant "-buildfile=C:\Program Files\script-runner\build.xml" "-Dwebroot=C:\My Projects\test" -Dexecute=/test.cfm + +# ✅ Correct - PowerShell (use single quotes to avoid variable expansion) +ant -buildfile='d:\work\script-runner\build.xml' -Dwebroot='D:\work\project' -Dexecute='/test.cfm' +``` -`ant -DluceeVersion="6.0.0.95-SNAPSHOT" -DextensionDir="C:\work\lucee-extensions\extension-hibernate\dist"` +**Important Windows Tips:** +- When using `-buildfile` with a directory, add `\build.xml` explicitly +- Avoid escaped quotes (`\"`) - they're usually not needed +- Use forward slashes (`/`) or double backslashes (`\\`) in scripts to avoid escape issues +- In batch files, use `%%` instead of `%` for variables If no webroot is specfied, you can run the provided debug script, to see which extensions are available and all the env / sys properties `ant -buildfile="C:\work\script-runner" -Dexecute="/debug.cfm"` -`ant -buildfile="C:\work\script-runner" -Dexecute="/debug.cfm" -DluceeVersion="light-6.0.0.95-SNAPSHOT"` (`light` has no bundled extensions, `zero` has no extension or admin) +`ant -buildfile="C:\work\script-runner" -Dexecute="/debug.cfm" -DluceeVersion="light-6.2.2.91"` (`light` has no bundled extensions, `zero` has no extension or admin) ## As a GitHub Action @@ -72,6 +214,7 @@ To use as a GitHub Action, to run the PDF tests after building the PDF Extension debugger: true (optional) runs with java debugging enabled on port 5000 preCleanup: true (purges Lucee working directory before starting) postCleanup: true (purges Lucee working directory after finishing) + uniqueWorkingDir: true (optional) uses unique working directory for concurrent execution env: testLabels: pdf testAdditional: ${{ github.workspace }}/tests @@ -108,5 +251,5 @@ pipelines: - git clone https://github.com/lucee/lucee - export testLabels="PDF" - echo $testLabels - - ant -buildfile script-runner/build.xml -DluceeVersion="light-6.0.0.152-SNAPSHOT" -Dwebroot="$BITBUCKET_CLONE_DIR/lucee/test" -DextensionDir="$BITBUCKET_CLONE_DIR/dist" -Dexecute="/bootstrap-tests.cfm" -DtestAdditional="$BITBUCKET_CLONE_DIR/tests" + - ant -buildfile script-runner/build.xml -DluceeVersion="light-6.2.2.91" -Dwebroot="$BITBUCKET_CLONE_DIR/lucee/test" -DextensionDir="$BITBUCKET_CLONE_DIR/dist" -Dexecute="/bootstrap-tests.cfm" -DtestAdditional="$BITBUCKET_CLONE_DIR/tests" ``` diff --git a/action.yml b/action.yml index 8fc101b..fec6dea 100644 --- a/action.yml +++ b/action.yml @@ -2,7 +2,7 @@ name: 'Lucee Script Runner' description: 'Run Lucee via the command line' inputs: luceeVersion: - description: Lucee Version to run, i.e. "light-6.0.3.1", "5.4.6.9", "zero-6.0.3.1" + description: Lucee Version to run, i.e. "light-6.2.2.91", "5.4.6.9", "zero-6.2.2.91" required: true luceeVersionQuery: description: Lucee Version Query to run (overrides luceeVersion, i.e. "5.4/stable/light", "6.1/snapshot/jar", "6/stable/zero" ) @@ -37,6 +37,9 @@ inputs: postCleanup: description: purge the directory Lucee is deployed into after finishing default: "true" + uniqueWorkingDir: + description: 'Working directory mode: "false" (default temp/lucee), "true" (auto-generate unique), or custom path (e.g., "/custom/work")' + default: "false" runs: using: "composite" steps: @@ -56,7 +59,8 @@ runs: -Dextensions="${{ inputs.extensions }}" -DextensionDir="${{ inputs.extensionDir }}" \ -Dcompile="${{ inputs.compile }}" -Ddebugger="${{ inputs.debugger }}" \ -DluceeCFConfig="${{inputs.luceeCFConfig}}" \ - -DpreCleanup="${{inputs.preCleanup}}" -DpostCleanup="${{inputs.postCleanup}}" + -DpreCleanup="${{inputs.preCleanup}}" -DpostCleanup="${{inputs.postCleanup}}" \ + -DuniqueWorkingDir="${{inputs.uniqueWorkingDir}}" shell: bash - if: runner.os == 'Windows' run: | @@ -74,5 +78,6 @@ runs: -Dwebroot="${{ inputs.webroot }}" -Dexecute="${{ inputs.execute }}" -Dextensions="${{ inputs.extensions }}" ^ -DextensionDir="${{ inputs.extensionDir }}" -Dcompile="${{ inputs.compile }}" ^ -Ddebugger="${{ inputs.debugger }}" -DluceeCFConfig="${{inputs.luceeCFConfig}}" ^ - -DpreCleanup="${{inputs.preCleanup}}" -DpostCleanup="${{inputs.postCleanup}}" + -DpreCleanup="${{inputs.preCleanup}}" -DpostCleanup="${{inputs.postCleanup}}" ^ + -DuniqueWorkingDir="${{inputs.uniqueWorkingDir}}" shell: cmd diff --git a/build-run-cfml.xml b/build-run-cfml.xml index 9a1e61c..0238371 100644 --- a/build-run-cfml.xml +++ b/build-run-cfml.xml @@ -1,5 +1,15 @@ + + + + + + + + + + @@ -163,7 +173,7 @@ try { if ( executeScriptByInclude eq "true"){ - include template="#execute#"; + //include template="#execute#"; } else { _internalRequest( template = execute, diff --git a/build.xml b/build.xml index 33c9fb8..d942532 100644 --- a/build.xml +++ b/build.xml @@ -9,6 +9,7 @@ + @@ -24,17 +25,19 @@ + + - + - + @@ -48,6 +51,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -80,8 +125,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -89,15 +192,18 @@ + - - - - - - + + + + + + + + @@ -105,15 +211,15 @@ --> - + - - - + + + @@ -129,13 +235,15 @@ - - - + - + + + ${errorOut} - + diff --git a/pom.xml b/pom.xml index ffd4263..eb1fd83 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.lucee lucee - 6.0.0.105-SNAPSHOT + 6.2.2.91 jar Lucee Loader Build From 61e712db647a58589f3722d97ce4a356bb621831 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Mon, 8 Sep 2025 13:50:39 +0200 Subject: [PATCH 02/59] ad support for using a locally built jar using -DluceeJar=/path/to/jar --- CHANGELOG.md | 4 ++++ README.md | 5 ++++ action.yml | 7 ++++++ build.xml | 67 +++++++++++++++++++++++++++++++++++++--------------- 4 files changed, 64 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fcac2f..7fe7c6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added +- **Local JAR Support**: Added `luceeJar` parameter to test locally built Lucee JARs without publishing + - Accepts full path to a local JAR file + - Overrides both `luceeVersion` and `luceeVersionQuery` + - Perfect for Lucee core developers testing builds - **Unique Working Directories**: Added `uniqueWorkingDir` parameter with three modes: - `false` (default): Uses standard temp/lucee directory - `true`: Auto-generates unique directory with timestamp and random ID diff --git a/README.md b/README.md index 39dab32..746de94 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ You can specify: - Lucee version `-DluceeVersion=` default `6.2.2.91`, (ie. 6.2.2.91, light-6.2.2.91, zero-6.2.2.91 ) - Lucee version by query `-DluceeVersionQuery="5.4/stable/light` ( optional overrides luceeVersion, (version)/(stable/rc/snapshot)/(jar,light/zero) ) +- Local Lucee JAR `-DluceeJar="/path/to/lucee.jar"` (optional, overrides both luceeVersion and luceeVersionQuery, perfect for testing locally built JARs) - Webroot `-Dwebroot=` (default `tests/`) on Windows, avoid a trailing \ as that is treated as an escape character causes script runner to fail - CFML Script to run, `-Dexecute=` (default `/index.cfm`) - run script via include or _internalRequest (which runs the Application.cfc if present, default ) `-DexecuteScriptByInclude="true"` @@ -74,6 +75,9 @@ ant -buildfile=D:\work\script-runner\build.xml -Dwebroot=. -Dexecute=/test/index # Testing with specific Lucee version ant -buildfile=D:\work\script-runner\build.xml -DluceeVersionQuery=6.2/stable/jar -Dwebroot=D:\work\lucee-spreadsheet -Dexecute=/test/index.cfm +# Testing with a locally built Lucee JAR (for Lucee developers) +ant -buildfile=D:\work\script-runner\build.xml -DluceeJar="D:\work\lucee\loader\target\lucee.jar" -Dwebroot=D:\work\lucee-spreadsheet -Dexecute=/test/index.cfm + # With unique working directory for concurrent runs ant -buildfile=D:\work\script-runner\build.xml -DuniqueWorkingDir=true -Dwebroot=D:\work\lucee-spreadsheet -Dexecute=/test/index.cfm ``` @@ -206,6 +210,7 @@ To use as a GitHub Action, to run the PDF tests after building the PDF Extension execute: /bootstrap-tests.cfm luceeVersion: ${{ env.luceeVersion }} luceeVersionQuery: 5.4/stable/light (optional, overrides luceeVersion ) + luceeJar: /path/to/local/lucee.jar (optional, overrides both luceeVersion and luceeVersionQuery) extensions: (optional list of extension guids to install) extensionDir: ${{ github.workspace }}/dist (for testing building an extension with CI) antFlags: -d or -v etc (optional, good for debugging any ant issues) diff --git a/action.yml b/action.yml index fec6dea..132f720 100644 --- a/action.yml +++ b/action.yml @@ -7,6 +7,9 @@ inputs: luceeVersionQuery: description: Lucee Version Query to run (overrides luceeVersion, i.e. "5.4/stable/light", "6.1/snapshot/jar", "6/stable/zero" ) default: "" + luceeJar: + description: Full path to a local Lucee JAR file (overrides both luceeVersion and luceeVersionQuery) + default: "" webroot: description: webroot directory required: true @@ -48,6 +51,7 @@ runs: pwd echo luceeVersion ${{ inputs.luceeVersion }} echo luceeVersionQuery ${{ inputs.luceeVersionQuery }} + echo luceeJar ${{ inputs.luceeJar }} echo webroot ${{ inputs.webroot }} echo execute ${{ inputs.execute }} echo extensions ${{ inputs.extensions }} @@ -55,6 +59,7 @@ runs: echo compile ${{ inputs.compile }} echo luceeCFConfig:${{inputs.luceeCFConfig}} ant -buildfile "${{ github.action_path }}/build.xml" ${{ inputs.antFlags }} -DluceeVersion="${{ inputs.luceeVersion }}" -DluceeVersionQuery="${{ inputs.luceeVersionQuery }}" \ + -DluceeJar="${{ inputs.luceeJar }}" \ -Dwebroot="${{ inputs.webroot }}" -Dexecute="${{ inputs.execute }}" \ -Dextensions="${{ inputs.extensions }}" -DextensionDir="${{ inputs.extensionDir }}" \ -Dcompile="${{ inputs.compile }}" -Ddebugger="${{ inputs.debugger }}" \ @@ -67,6 +72,7 @@ runs: pwd echo luceeVersion ${{ inputs.luceeVersion }} echo luceeVersionQuery ${{ inputs.luceeVersionQuery }} + echo luceeJar ${{ inputs.luceeJar }} echo webroot ${{ inputs.webroot }} echo execute ${{ inputs.execute }} echo extensions ${{ inputs.extensions }} @@ -75,6 +81,7 @@ runs: echo luceeCFConfig:${{inputs.luceeCFConfig}} ant -buildfile "${{ github.action_path }}/build.xml" ${{ inputs.antFlags }} ^ -DluceeVersion="${{ inputs.luceeVersion }}" -DluceeVersionQuery="${{ inputs.luceeVersionQuery }}" ^ + -DluceeJar="${{ inputs.luceeJar }}" ^ -Dwebroot="${{ inputs.webroot }}" -Dexecute="${{ inputs.execute }}" -Dextensions="${{ inputs.extensions }}" ^ -DextensionDir="${{ inputs.extensionDir }}" -Dcompile="${{ inputs.compile }}" ^ -Ddebugger="${{ inputs.debugger }}" -DluceeCFConfig="${{inputs.luceeCFConfig}}" ^ diff --git a/build.xml b/build.xml index d942532..358c19d 100644 --- a/build.xml +++ b/build.xml @@ -35,9 +35,10 @@ + - + @@ -49,6 +50,20 @@ + + + + + + + + + + + + + + @@ -93,35 +108,44 @@ - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + + + + + + - - + + + + @@ -211,9 +235,14 @@ --> + + + + + - + From 820a1b9d5a0c62e38028523c58268538572256b6 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Mon, 8 Sep 2025 14:21:24 +0200 Subject: [PATCH 03/59] add docs about using SystemOutput() --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 746de94..404fad2 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,28 @@ wait Each instance will use a unique working directory named `temp-unique/lucee-{VERSION}-{TIMESTAMP}-{RANDOM}` to prevent conflicts. +## Writing Output in Headless Mode + +When running CFML scripts in headless mode (without a web server), you should use `systemOutput()` instead of `writeOutput()` to see output in the console: + +```cfm +// ✅ Correct - outputs to console in headless mode +systemOutput("Processing started...", true); // true adds newline +systemOutput("Item #i# processed", true); + +// ❌ Wrong - writeOutput() won't display in console +writeOutput("This won't be visible"); + +// For debugging, you can also use: +systemOutput(serializeJSON(myData, "struct"), true); +``` + +**Key Points:** +- `systemOutput()` writes directly to the console (stdout) +- `writeOutput()` is for HTTP response output and won't show in headless mode +- The second parameter `true` adds a newline after the output +- Use `systemOutput()` for progress updates, debugging, and results + ## Troubleshooting ### Common Issues on Windows From 61a2c1bb007651fd369855291be44df4cf9cbffb Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Tue, 9 Sep 2025 14:51:41 +0200 Subject: [PATCH 04/59] improve execute documentation and examples --- README.md | 47 +++++++++++++++++++++++++---------------------- build.xml | 2 +- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 404fad2..a79fc35 100644 --- a/README.md +++ b/README.md @@ -21,13 +21,16 @@ The script-runner can be used from any directory by specifying the build file lo ```bash # From the script-runner directory (simple) -ant -Dwebroot="/path/to/your/project" -Dexecute="/yourscript.cfm" +ant -Dwebroot="/path/to/your/project" -Dexecute="yourscript.cfm" # From your project directory (recommended for external projects) -ant -buildfile="/path/to/script-runner/build.xml" -Dwebroot="." -Dexecute="/yourscript.cfm" +ant -buildfile="/path/to/script-runner/build.xml" -Dwebroot="." -Dexecute="yourscript.cfm" # From any directory with absolute paths -ant -buildfile="C:\tools\script-runner\build.xml" -Dwebroot="C:\work\myproject" -Dexecute="/test.cfm" +ant -buildfile="C:\tools\script-runner\build.xml" -Dwebroot="C:\work\myproject" -Dexecute="test.cfm" + +# execute a script below the webroot +ant -buildfile="C:\tools\script-runner\build.xml" -Dwebroot="C:\work\myproject" -Dexecute="extended/index.cfm" ``` **Key Points:** @@ -47,7 +50,7 @@ You can specify: - Lucee version by query `-DluceeVersionQuery="5.4/stable/light` ( optional overrides luceeVersion, (version)/(stable/rc/snapshot)/(jar,light/zero) ) - Local Lucee JAR `-DluceeJar="/path/to/lucee.jar"` (optional, overrides both luceeVersion and luceeVersionQuery, perfect for testing locally built JARs) - Webroot `-Dwebroot=` (default `tests/`) on Windows, avoid a trailing \ as that is treated as an escape character causes script runner to fail -- CFML Script to run, `-Dexecute=` (default `/index.cfm`) +- CFML Script to run, `-Dexecute=` (default `index.cfm`) a relative path the webroot, no leading `/` is needed, some bash shells like git bash on windows get's confused and tries to expand that to a full path - run script via include or _internalRequest (which runs the Application.cfc if present, default ) `-DexecuteScriptByInclude="true"` - any extra extensions `-Dextensions=` (default ``) - manual extension install (`*.lex`) from a directory `-DextensionDir=` (default ``) @@ -115,9 +118,9 @@ Multiple script-runner instances can be run simultaneously using unique working ```bash # Run multiple instances concurrently -ant -DuniqueWorkingDir="true" -Dexecute="/test1.cfm" & -ant -DuniqueWorkingDir="true" -Dexecute="/test2.cfm" & -ant -DuniqueWorkingDir="true" -Dexecute="/test3.cfm" & +ant -DuniqueWorkingDir="true" -Dexecute="test1.cfm" & +ant -DuniqueWorkingDir="true" -Dexecute="test2.cfm" & +ant -DuniqueWorkingDir="true" -Dexecute="test3.cfm" & wait ``` @@ -149,48 +152,48 @@ systemOutput(serializeJSON(myData, "struct"), true); ### Common Issues on Windows -**Problem**: Build fails with path-related errors +**Problem**: Build fails with path-related errors **Solution**: Avoid trailing backslashes in webroot paths: ```bash # ❌ Wrong - trailing backslash causes escape issues -ant -Dwebroot="C:\work\myproject\" +ant -Dwebroot="C:\work\myproject\" # ✅ Correct - no trailing backslash -ant -Dwebroot="C:\work\myproject" +ant -Dwebroot="C:\work\myproject" ant -Dwebroot="C:/work/myproject/" # Forward slashes work too ``` -**Problem**: "Could not locate build file" from other directories +**Problem**: "Could not locate build file" from other directories **Solution**: Use absolute path to build.xml: ```bash # ❌ Wrong - looking for build.xml in current directory ant -Dwebroot="." -Dexecute="/test.cfm" # ✅ Correct - specify script-runner location -ant -buildfile="C:\tools\script-runner\build.xml" -Dwebroot="." -Dexecute="/test.cfm" +ant -buildfile="C:\tools\script-runner\build.xml" -Dwebroot="." -Dexecute="test.cfm" ``` -**Problem**: "File not found" for CFML scripts +**Problem**: "File not found" for CFML scripts **Solution**: Check webroot and execute paths: ```bash # Verify your paths - execute is relative to webroot -ant -buildfile="/path/to/script-runner/build.xml" -Dwebroot="/your/project" -Dexecute="/debug.cfm" +ant -buildfile="/path/to/script-runner/build.xml" -Dwebroot="/your/project" -Dexecute="debug.cfm" ``` -**Problem**: "No shell found" or quote/escape errors on Windows +**Problem**: "No shell found" or quote/escape errors on Windows **Solution**: Use proper quote formatting for Windows command line: ```bash # ❌ Wrong - excessive escaping or nested quotes ant -buildfile=\"d:\work\script-runner\" -Dwebroot=\"D:\work\project\" # ✅ Correct - Windows Command Prompt (no quotes needed for paths without spaces) -ant -buildfile=d:\work\script-runner\build.xml -Dwebroot=D:\work\project -Dexecute=/test.cfm +ant -buildfile=d:\work\script-runner\build.xml -Dwebroot=D:\work\project -Dexecute=test.cfm # ✅ Correct - Windows with spaces in paths (use quotes around entire parameter) -ant "-buildfile=C:\Program Files\script-runner\build.xml" "-Dwebroot=C:\My Projects\test" -Dexecute=/test.cfm +ant "-buildfile=C:\Program Files\script-runner\build.xml" "-Dwebroot=C:\My Projects\test" -Dexecute=test.cfm # ✅ Correct - PowerShell (use single quotes to avoid variable expansion) -ant -buildfile='d:\work\script-runner\build.xml' -Dwebroot='D:\work\project' -Dexecute='/test.cfm' +ant -buildfile='d:\work\script-runner\build.xml' -Dwebroot='D:\work\project' -Dexecute='test.cfm' ``` **Important Windows Tips:** @@ -201,9 +204,9 @@ ant -buildfile='d:\work\script-runner\build.xml' -Dwebroot='D:\work\project' -De If no webroot is specfied, you can run the provided debug script, to see which extensions are available and all the env / sys properties -`ant -buildfile="C:\work\script-runner" -Dexecute="/debug.cfm"` +`ant -buildfile="C:\work\script-runner" -Dexecute="debug.cfm"` -`ant -buildfile="C:\work\script-runner" -Dexecute="/debug.cfm" -DluceeVersion="light-6.2.2.91"` (`light` has no bundled extensions, `zero` has no extension or admin) +`ant -buildfile="C:\work\script-runner" -Dexecute="debug.cfm" -DluceeVersion="light-6.2.2.91"` (`light` has no bundled extensions, `zero` has no extension or admin) ## As a GitHub Action @@ -229,7 +232,7 @@ To use as a GitHub Action, to run the PDF tests after building the PDF Extension uses: lucee/script-runner@main with: webroot: ${{ github.workspace }}/lucee/test - execute: /bootstrap-tests.cfm + execute: bootstrap-tests.cfm luceeVersion: ${{ env.luceeVersion }} luceeVersionQuery: 5.4/stable/light (optional, overrides luceeVersion ) luceeJar: /path/to/local/lucee.jar (optional, overrides both luceeVersion and luceeVersionQuery) @@ -278,5 +281,5 @@ pipelines: - git clone https://github.com/lucee/lucee - export testLabels="PDF" - echo $testLabels - - ant -buildfile script-runner/build.xml -DluceeVersion="light-6.2.2.91" -Dwebroot="$BITBUCKET_CLONE_DIR/lucee/test" -DextensionDir="$BITBUCKET_CLONE_DIR/dist" -Dexecute="/bootstrap-tests.cfm" -DtestAdditional="$BITBUCKET_CLONE_DIR/tests" + - ant -buildfile script-runner/build.xml -DluceeVersion="light-6.2.2.91" -Dwebroot="$BITBUCKET_CLONE_DIR/lucee/test" -DextensionDir="$BITBUCKET_CLONE_DIR/dist" -Dexecute="bootstrap-tests.cfm" -DtestAdditional="$BITBUCKET_CLONE_DIR/tests" ``` diff --git a/build.xml b/build.xml index 358c19d..919e743 100644 --- a/build.xml +++ b/build.xml @@ -175,7 +175,7 @@ - + From 8a3bd15b709b18939216ac0c25c25c1a203f179d Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Tue, 9 Sep 2025 17:29:55 +0200 Subject: [PATCH 05/59] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a79fc35..962dcfd 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ You can specify: - Lucee version `-DluceeVersion=` default `6.2.2.91`, (ie. 6.2.2.91, light-6.2.2.91, zero-6.2.2.91 ) - Lucee version by query `-DluceeVersionQuery="5.4/stable/light` ( optional overrides luceeVersion, (version)/(stable/rc/snapshot)/(jar,light/zero) ) -- Local Lucee JAR `-DluceeJar="/path/to/lucee.jar"` (optional, overrides both luceeVersion and luceeVersionQuery, perfect for testing locally built JARs) +- Local Lucee JAR `-DluceeJar="/full-path/to/lucee.jar"` (optional, overrides both luceeVersion and luceeVersionQuery, perfect for testing locally built JARs) - Webroot `-Dwebroot=` (default `tests/`) on Windows, avoid a trailing \ as that is treated as an escape character causes script runner to fail - CFML Script to run, `-Dexecute=` (default `index.cfm`) a relative path the webroot, no leading `/` is needed, some bash shells like git bash on windows get's confused and tries to expand that to a full path - run script via include or _internalRequest (which runs the Application.cfc if present, default ) `-DexecuteScriptByInclude="true"` From c903915f1b8a7cad70475f30ca8045d2bac321ad Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 14:21:20 +0200 Subject: [PATCH 06/59] improve webroot handling, add tests --- .github/workflows/webroot-matrix.yml | 245 +++++++++++++++++++++++++++ .gitignore | 2 + README.md | 111 ++++++++++-- build.xml | 103 +++++++---- webroot/README.md | 14 ++ webroot/index.cfm | 3 + webroot/sub/test.cfm | 3 + webroot/test.cfm | 3 + 8 files changed, 436 insertions(+), 48 deletions(-) create mode 100644 .github/workflows/webroot-matrix.yml create mode 100644 webroot/README.md create mode 100644 webroot/index.cfm create mode 100644 webroot/sub/test.cfm create mode 100644 webroot/test.cfm diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml new file mode 100644 index 0000000..ee7f42d --- /dev/null +++ b/.github/workflows/webroot-matrix.yml @@ -0,0 +1,245 @@ +name: Webroot Handling Matrix + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + ubuntu-bash: + name: Ubuntu Bash + runs-on: ubuntu-latest + strategy: + matrix: + webroot: + - '.' + - "./webroot" + - "webroot" + - ${{ github.workspace }}/webroot + - '"./webroot"' + - '"${{ github.workspace }}/webroot"' + execute: + - "index.cfm" + - "test.cfm" + - "sub/test.cfm" + steps: + - uses: actions/checkout@v4 + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Run Ant webroot test + shell: bash + run: | + ant -buildfile build.xml -Dwebroot=${{ matrix.webroot }} -Dexecute="${{ matrix.execute }}" -DuniqueWorkingDir=true + working-directory: ${{ github.workspace }} + - name: Check output + shell: bash + run: | + grep 'webroot test:' logs/* || (echo 'webroot test output not found' && exit 1) + working-directory: ${{ github.workspace }} + + ubuntu-pwsh: + name: Ubuntu PowerShell + runs-on: ubuntu-latest + strategy: + matrix: + webroot: + - '.' + - "./webroot" + - "webroot" + - ${{ github.workspace }}/webroot + - '"./webroot"' + - '"${{ github.workspace }}/webroot"' + execute: + - "index.cfm" + - "test.cfm" + - "sub/test.cfm" + steps: + - uses: actions/checkout@v4 + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Run Ant webroot test + shell: pwsh + run: | + ant -buildfile build.xml -Dwebroot=${{ matrix.webroot }} -Dexecute="${{ matrix.execute }}" -DuniqueWorkingDir=true + working-directory: ${{ github.workspace }} + - name: Check output + shell: pwsh + run: | + Select-String 'webroot test:' logs/* | Out-Null; if ($LASTEXITCODE -ne 0) { Write-Host 'webroot test output not found'; exit 1 } + working-directory: ${{ github.workspace }} + + macos-bash: + name: MacOS Bash + runs-on: macos-latest + strategy: + matrix: + webroot: + - '.' + - "./webroot" + - "webroot" + - ${{ github.workspace }}/webroot + - '"./webroot"' + - '"${{ github.workspace }}/webroot"' + execute: + - "index.cfm" + - "test.cfm" + - "sub/test.cfm" + steps: + - uses: actions/checkout@v4 + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Run Ant webroot test + shell: bash + run: | + ant -buildfile build.xml -Dwebroot=${{ matrix.webroot }} -Dexecute="${{ matrix.execute }}" -DuniqueWorkingDir=true + working-directory: ${{ github.workspace }} + - name: Check output + shell: bash + run: | + grep 'webroot test:' logs/* || (echo 'webroot test output not found' && exit 1) + working-directory: ${{ github.workspace }} + + macos-pwsh: + name: MacOS PowerShell + runs-on: macos-latest + strategy: + matrix: + webroot: + - '.' + - "./webroot" + - "webroot" + - ${{ github.workspace }}/webroot + - '"./webroot"' + - '"${{ github.workspace }}/webroot"' + execute: + - "index.cfm" + - "test.cfm" + - "sub/test.cfm" + steps: + - uses: actions/checkout@v4 + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Run Ant webroot test + shell: pwsh + run: | + ant -buildfile build.xml -Dwebroot=${{ matrix.webroot }} -Dexecute="${{ matrix.execute }}" -DuniqueWorkingDir=true + working-directory: ${{ github.workspace }} + - name: Check output + shell: pwsh + run: | + Select-String 'webroot test:' logs/* | Out-Null; if ($LASTEXITCODE -ne 0) { Write-Host 'webroot test output not found'; exit 1 } + working-directory: ${{ github.workspace }} + + windows-cmd: + name: Windows CMD + runs-on: windows-latest + strategy: + matrix: + webroot: + - '.' + - "./webroot" + - "webroot" + - ${{ github.workspace }}\webroot + - '"./webroot"' + - '"${{ github.workspace }}\\webroot"' + execute: + - "index.cfm" + - "test.cfm" + - "sub/test.cfm" + steps: + - uses: actions/checkout@v4 + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Run Ant webroot test + shell: cmd + run: | + ant -buildfile build.xml -Dwebroot=${{ matrix.webroot }} -Dexecute="${{ matrix.execute }}" -DuniqueWorkingDir=true + working-directory: ${{ github.workspace }} + - name: Check output + shell: cmd + run: | + findstr "webroot test:" logs\* || (echo webroot test output not found && exit 1) + working-directory: ${{ github.workspace }} + + windows-pwsh: + name: Windows PowerShell + runs-on: windows-latest + strategy: + matrix: + webroot: + - '.' + - "./webroot" + - "webroot" + - ${{ github.workspace }}\webroot + - '"./webroot"' + - '"${{ github.workspace }}\\webroot"' + execute: + - "index.cfm" + - "test.cfm" + - "sub/test.cfm" + steps: + - uses: actions/checkout@v4 + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Run Ant webroot test + shell: pwsh + run: | + ant -buildfile build.xml -Dwebroot=${{ matrix.webroot }} -Dexecute="${{ matrix.execute }}" -DuniqueWorkingDir=true + working-directory: ${{ github.workspace }} + - name: Check output + shell: pwsh + run: | + Select-String 'webroot test:' logs/* | Out-Null; if ($LASTEXITCODE -ne 0) { Write-Host 'webroot test output not found'; exit 1 } + working-directory: ${{ github.workspace }} + + windows-bash: + name: Windows Bash + runs-on: windows-latest + strategy: + matrix: + webroot: + - '.' + - "./webroot" + - "webroot" + - ${{ github.workspace }}/webroot + - '"./webroot"' + - '"${{ github.workspace }}/webroot"' + execute: + - "index.cfm" + - "test.cfm" + - "sub/test.cfm" + steps: + - uses: actions/checkout@v4 + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Run Ant webroot test + shell: bash + run: | + ant -buildfile build.xml -Dwebroot=${{ matrix.webroot }} -Dexecute="${{ matrix.execute }}" -DuniqueWorkingDir=true + working-directory: ${{ github.workspace }} + - name: Check output + shell: bash + run: | + grep 'webroot test:' logs/* || (echo 'webroot test output not found' && exit 1) + working-directory: ${{ github.workspace }} diff --git a/.gitignore b/.gitignore index bf525e7..8a23c46 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ lucee-download-cache temp bin logs +/temp-unique +/agent-tests diff --git a/README.md b/README.md index 962dcfd..9b0448f 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ ant -buildfile="C:\tools\script-runner\build.xml" -Dwebroot="C:\work\myproject" - `-buildfile` specifies where script-runner is installed - `-Dwebroot` is the directory containing your CFML code (can be relative to current directory) - `-Dexecute` is the CFML script to run (relative to webroot) +- **Note:** The script-runner always normalizes the webroot to an absolute path internally, regardless of whether you pass a relative or absolute path. All output and script execution will use this normalized absolute path. ### Basic Usage @@ -59,17 +60,92 @@ You can specify: - use a java debugger `-Ddebugger="true"` opens a java debugging port 5000, with suspend=y - preCleanup `-DpreCleanup="true"` purges the Lucee working dir before starting - postCleanup `-DpostCleanup="true"` purges the Lucee working dir after finishing -- uniqueWorkingDir `-DuniqueWorkingDir=` supports three modes: - - `"false"` (default): Uses standard `temp/lucee` directory - - `"true"`: Auto-generates unique directory `temp-unique/lucee-{VERSION}-{TIMESTAMP}-{RANDOM}` - - `"/custom/path"`: Uses specified custom directory path -`ant -DluceeVersion="6.2.2.91" -Dwebroot="C:\work\lucee-docs" -Dexecute="import.cfm" -Dlucee.extensions=""` +### TL;DR: Quoting & Paths (Stop Overthinking It) -`ant -DluceeVersion="6.2.2.91" -DextensionDir="C:\work\lucee-extensions\extension-hibernate\dist"` +**If your path has spaces, use quotes. If not, don’t.** + +**Quick Reference:** + +| Shell | Example Command | +|--------------- |------------------------------------------------------------------------------------------------------------------| +| PowerShell | `ant -buildfile "C:\tools\script-runner\build.xml" -Dwebroot="C:\work\my project" -Dexecute="test.cfm" -DuniqueWorkingDir=true` | +| Command Prompt | `ant -buildfile=C:\tools\script-runner\build.xml -Dwebroot=C:\work\myproject -Dexecute=test.cfm -DuniqueWorkingDir=true` | +| Bash/WSL | `ant -buildfile /mnt/d/work/script-runner/build.xml -Dwebroot=/mnt/d/work/myproject -Dexecute=test.cfm -DuniqueWorkingDir=true` | + +**PowerShell:** Use double quotes for paths with spaces. Single quotes also work (especially in scripts to avoid variable expansion). Don’t mix and match. + +**Command Prompt:** Quotes only if the path has spaces. You can quote just the value or the whole parameter (the latter is handy in batch files). + +**Bash/WSL:** Use forward slashes. Quotes only if the path has spaces. Don’t use Windows backslashes or drive letters. + +**Blunt Warnings:** +- Don’t use trailing backslashes on Windows. Ever. +- Don’t escape quotes unless you like pain. +- If Ant can’t find your file, your path or quotes are wrong. Period. + +--- + +### uniqueWorkingDir: What Actually Happens + +- `false` (default): Uses `temp/lucee`. One run at a time. Fast, but not for parallel jobs. +- `true`: Uses `temp-unique/{VERSION}-{TIMESTAMP}-{RANDOM}` (timestamp: `yyMMdd-HHmmss`). Lets you run as many jobs as you want, at the same time, without collisions. +- `/custom/path`: Uses your directory. You’re on your own for cleanup and collisions. + +**Pro tip:** If you don’t know what you want, use `true` for CI or parallel runs, `false` for local dev. + + + +**Command Prompt (Windows):** + +Quotes are only needed if the path contains spaces. You can either quote just the value, or the entire parameter (both are valid). See the examples below: + +- **No spaces in paths (no quotes needed):** + + ```cmd + ant -buildfile=C:\tools\script-runner\build.xml -Dwebroot=C:\work\myproject -Dexecute=test.cfm -DuniqueWorkingDir=true + ``` + +- **Spaces in paths (quotes required):** + + ```cmd + ant -buildfile="C:\tools\script-runner\build.xml" -Dwebroot="C:\work\my project" -Dexecute="test.cfm" -DuniqueWorkingDir=true + + REM Or quote the entire parameter (especially useful in batch files): + ant "-buildfile=C:\Program Files\script-runner\build.xml" "-Dwebroot=C:\My Projects\test" -Dexecute=test.cfm + ``` + +**Bash/WSL (Linux):** + +- Use forward slashes and Linux-style paths. + +Quotes are only needed if the path contains spaces. See the two examples below: + +- **No spaces in paths (no quotes needed):** + + ```bash + ant -buildfile /mnt/d/work/script-runner/build.xml -Dwebroot=/mnt/d/work/myproject -Dexecute=test.cfm -DuniqueWorkingDir=true + ``` + +- **Spaces in paths (quotes required):** + + ```bash + ant -buildfile "/mnt/d/work/script-runner/build.xml" -Dwebroot="/mnt/d/work/my project" -Dexecute="test.cfm" -DuniqueWorkingDir=true + ``` + +**Quick Reference Table:** + +| Shell | Example Command | +|--------------- |------------------------------------------------------------------------------------------------------------------| +| PowerShell | `ant -buildfile "C:\tools\script-runner\build.xml" -Dwebroot="C:\work\my project" -Dexecute="test.cfm" -DuniqueWorkingDir=true` | +| Command Prompt | `ant -buildfile=C:\tools\script-runner\build.xml -Dwebroot=C:\work\myproject -Dexecute=test.cfm -DuniqueWorkingDir=true` | +| Bash/WSL | `ant -buildfile /mnt/d/work/script-runner/build.xml -Dwebroot=/mnt/d/work/myproject -Dexecute=test.cfm -DuniqueWorkingDir=true` | + +--- ### Quick Reference Examples + ```bash # Testing Lucee Spreadsheet from its directory cd D:\work\lucee-spreadsheet @@ -88,18 +164,21 @@ ant -buildfile=D:\work\script-runner\build.xml -DuniqueWorkingDir=true -Dwebroot ### Working Directory Behavior **Default Mode** (`uniqueWorkingDir=false` or not specified): + - Uses a consistent local `temp/lucee` directory relative to script-runner location - Same directory is reused across runs (cleaned with `preCleanup`/`postCleanup`) - **Ideal for CI/CD**: Predictable location, faster subsequent runs due to caching - **Single instance only**: Cannot run multiple concurrent instances **Auto-Unique Mode** (`uniqueWorkingDir=true`): -- Creates unique directories: `temp-unique/lucee-{VERSION}-{TIMESTAMP}-{RANDOM}` + +- Creates unique directories: `temp-unique/{VERSION}-{TIMESTAMP}-{RANDOM}` (timestamp format: `yyMMdd-HHmmss`) - Each run gets its own isolated working directory - **Enables concurrent execution**: Multiple instances can run simultaneously - **Useful for**: Parallel testing, concurrent builds, isolation requirements **Custom Path Mode** (`uniqueWorkingDir=/custom/path`): + - Uses your specified directory as the working directory - Full control over location (e.g., RAM disk, specific drive, shared folder) - **Race protection**: Still checks for existing directory to prevent conflicts @@ -108,7 +187,7 @@ ant -buildfile=D:\work\script-runner\build.xml -DuniqueWorkingDir=true -Dwebroot ```bash # Examples of the three modes: ant -DuniqueWorkingDir=false # Uses: temp/lucee -ant -DuniqueWorkingDir=true # Uses: temp-unique/lucee-6.2.2.91-20250908-090047-669 +ant -DuniqueWorkingDir=true # Uses: temp-unique/6.2.2.91-250913-142530-123 ant -DuniqueWorkingDir=C:/fast/work # Uses: C:/fast/work ``` @@ -124,7 +203,7 @@ ant -DuniqueWorkingDir="true" -Dexecute="test3.cfm" & wait ``` -Each instance will use a unique working directory named `temp-unique/lucee-{VERSION}-{TIMESTAMP}-{RANDOM}` to prevent conflicts. +Each instance will use a unique working directory named `temp-unique/{VERSION}-{TIMESTAMP}-{RANDOM}` (timestamp format: `yyMMdd-HHmmss`) to prevent conflicts. ## Writing Output in Headless Mode @@ -142,7 +221,9 @@ writeOutput("This won't be visible"); systemOutput(serializeJSON(myData, "struct"), true); ``` + **Key Points:** + - `systemOutput()` writes directly to the console (stdout) - `writeOutput()` is for HTTP response output and won't show in headless mode - The second parameter `true` adds a newline after the output @@ -155,6 +236,7 @@ systemOutput(serializeJSON(myData, "struct"), true); **Problem**: Build fails with path-related errors **Solution**: Avoid trailing backslashes in webroot paths: ```bash + # ❌ Wrong - trailing backslash causes escape issues ant -Dwebroot="C:\work\myproject\" @@ -165,6 +247,7 @@ ant -Dwebroot="C:/work/myproject/" # Forward slashes work too **Problem**: "Could not locate build file" from other directories **Solution**: Use absolute path to build.xml: + ```bash # ❌ Wrong - looking for build.xml in current directory ant -Dwebroot="." -Dexecute="/test.cfm" @@ -175,6 +258,7 @@ ant -buildfile="C:\tools\script-runner\build.xml" -Dwebroot="." -Dexecute="test. **Problem**: "File not found" for CFML scripts **Solution**: Check webroot and execute paths: + ```bash # Verify your paths - execute is relative to webroot ant -buildfile="/path/to/script-runner/build.xml" -Dwebroot="/your/project" -Dexecute="debug.cfm" @@ -182,6 +266,7 @@ ant -buildfile="/path/to/script-runner/build.xml" -Dwebroot="/your/project" -Dex **Problem**: "No shell found" or quote/escape errors on Windows **Solution**: Use proper quote formatting for Windows command line: + ```bash # ❌ Wrong - excessive escaping or nested quotes ant -buildfile=\"d:\work\script-runner\" -Dwebroot=\"D:\work\project\" @@ -196,7 +281,9 @@ ant "-buildfile=C:\Program Files\script-runner\build.xml" "-Dwebroot=C:\My Proje ant -buildfile='d:\work\script-runner\build.xml' -Dwebroot='D:\work\project' -Dexecute='test.cfm' ``` + **Important Windows Tips:** + - When using `-buildfile` with a directory, add `\build.xml` explicitly - Avoid escaped quotes (`\"`) - they're usually not needed - Use forward slashes (`/`) or double backslashes (`\\`) in scripts to avoid escape issues @@ -212,7 +299,7 @@ If no webroot is specfied, you can run the provided debug script, to see which e To use as a GitHub Action, to run the PDF tests after building the PDF Extension, just add the following YAML -``` +```yaml - name: Checkout Lucee uses: actions/checkout@v2 with: @@ -250,7 +337,7 @@ To use as a GitHub Action, to run the PDF tests after building the PDF Extension testAdditional: ${{ github.workspace }}/tests ``` -https://github.com/lucee/extension-pdf/blob/master/.github/workflows/main.yml +[GitHub Action Workflow Example](https://github.com/lucee/extension-pdf/blob/master/.github/workflows/main.yml) This will do the following steps @@ -261,7 +348,7 @@ This will do the following steps ## As a BitBucket Pipeline -``` +```yaml image: atlassian/default-image:3 pipelines: diff --git a/build.xml b/build.xml index 919e743..006c71b 100644 --- a/build.xml +++ b/build.xml @@ -1,8 +1,11 @@ - + + + + + + + @@ -24,6 +27,13 @@ + + + + + + + @@ -37,9 +47,7 @@ - - - + @@ -50,11 +58,8 @@ - - - - + @@ -76,29 +81,41 @@ - + - + - + + + + + + + + + + + + + - + - + @@ -117,7 +134,10 @@ - + + + + @@ -129,6 +149,7 @@ + @@ -152,7 +173,7 @@ - + @@ -162,20 +183,29 @@ - + - - - - - + + + + + + + + + + + + - - + + - - - + + + + + @@ -187,10 +217,10 @@ - + - + @@ -200,16 +230,17 @@ - + - + - + + @@ -239,7 +270,7 @@ - + @@ -249,7 +280,7 @@ - + diff --git a/webroot/README.md b/webroot/README.md new file mode 100644 index 0000000..8dfac26 --- /dev/null +++ b/webroot/README.md @@ -0,0 +1,14 @@ +# Webroot Test Scripts + +This folder contains test CFML scripts for verifying webroot and execute argument handling in the script-runner. + +## Rules and What We Are Testing + +- All scripts in this folder are used by automated tests to ensure that: + - The `-Dwebroot` argument (relative or absolute, quoted or unquoted) is always normalized and used correctly. + - The `-Dexecute` argument (relative to webroot, with or without subfolders) is resolved and executed as expected. +- The `index.cfm` and `test.cfm` scripts are for basic webroot resolution. +- The `sub/test.cfm` script is for testing relative execute paths within a subfolder. +- Output from these scripts is checked in CI to confirm correct path resolution and script execution. + +**Do not remove or rename these files unless you update the corresponding tests and workflows.** diff --git a/webroot/index.cfm b/webroot/index.cfm new file mode 100644 index 0000000..82e3b7d --- /dev/null +++ b/webroot/index.cfm @@ -0,0 +1,3 @@ + +systemOutput("webroot test: #expandPath('./index.cfm')#", true); + diff --git a/webroot/sub/test.cfm b/webroot/sub/test.cfm new file mode 100644 index 0000000..b5f5e08 --- /dev/null +++ b/webroot/sub/test.cfm @@ -0,0 +1,3 @@ + +systemOutput("webroot test: #expandPath('./sub/test.cfm')#", true); + diff --git a/webroot/test.cfm b/webroot/test.cfm new file mode 100644 index 0000000..12f7744 --- /dev/null +++ b/webroot/test.cfm @@ -0,0 +1,3 @@ + +systemOutput("webroot test: #expandPath('./test.cfm')#", true); + From 25b546a6a69b56536d663500014d3ab76705fe01 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 14:26:35 +0200 Subject: [PATCH 07/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 42 +++++++++++----------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index ee7f42d..12c0d9d 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -5,41 +5,31 @@ on: pull_request: workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + + jobs: - ubuntu-bash: - name: Ubuntu Bash - runs-on: ubuntu-latest + test: + runs-on: ${{ matrix.os }} strategy: matrix: - webroot: - - '.' - - "./webroot" - - "webroot" - - ${{ github.workspace }}/webroot - - '"./webroot"' - - '"${{ github.workspace }}/webroot"' - execute: - - "index.cfm" - - "test.cfm" - - "sub/test.cfm" + os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v4 - name: Set up Java uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '21' - - name: Run Ant webroot test - shell: bash - run: | - ant -buildfile build.xml -Dwebroot=${{ matrix.webroot }} -Dexecute="${{ matrix.execute }}" -DuniqueWorkingDir=true - working-directory: ${{ github.workspace }} - - name: Check output - shell: bash - run: | - grep 'webroot test:' logs/* || (echo 'webroot test output not found' && exit 1) - working-directory: ${{ github.workspace }} - + java-version: '17' + - name: Run default test (index.cfm) + run: ant -Dwebroot=webroot -Dexecute=index.cfm + - name: Run subfolder test (sub/test.cfm) + run: ant -Dwebroot=webroot -Dexecute=sub/test.cfm + - name: Run test.cfm + run: ant -Dwebroot=webroot -Dexecute=test.cfm + # Add more steps for other argument combinations if needed ubuntu-pwsh: name: Ubuntu PowerShell runs-on: ubuntu-latest From 84089e0be19938b71fef2b2b33950687a38afee0 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 14:46:02 +0200 Subject: [PATCH 08/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 182 ++++++++++++++------------- 1 file changed, 92 insertions(+), 90 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 12c0d9d..a8dae8f 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -33,19 +33,6 @@ jobs: ubuntu-pwsh: name: Ubuntu PowerShell runs-on: ubuntu-latest - strategy: - matrix: - webroot: - - '.' - - "./webroot" - - "webroot" - - ${{ github.workspace }}/webroot - - '"./webroot"' - - '"${{ github.workspace }}/webroot"' - execute: - - "index.cfm" - - "test.cfm" - - "sub/test.cfm" steps: - uses: actions/checkout@v4 - name: Set up Java @@ -53,10 +40,23 @@ jobs: with: distribution: 'temurin' java-version: '21' - - name: Run Ant webroot test + - name: Run all webroot/execute combinations shell: pwsh run: | - ant -buildfile build.xml -Dwebroot=${{ matrix.webroot }} -Dexecute="${{ matrix.execute }}" -DuniqueWorkingDir=true + $webroots = @('.', './webroot', 'webroot', "${{ github.workspace }}/webroot", '"./webroot"', '"${{ github.workspace }}/webroot"') + $executes = @('index.cfm', 'test.cfm', 'sub/test.cfm') + foreach ($w in $webroots) { + foreach ($e in $executes) { + Write-Host "Testing webroot=$w execute=$e" + $result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1 + if ($LASTEXITCODE -ne 0) { + $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DuniqueWorkingDir=true" + $platform = "ubuntu-latest" + $shell = "pwsh" + "## Platform: $platform | Shell: $shell`n### $cmd`nFAILED: $w / $e`n$result`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY + } + } + } working-directory: ${{ github.workspace }} - name: Check output shell: pwsh @@ -67,19 +67,6 @@ jobs: macos-bash: name: MacOS Bash runs-on: macos-latest - strategy: - matrix: - webroot: - - '.' - - "./webroot" - - "webroot" - - ${{ github.workspace }}/webroot - - '"./webroot"' - - '"${{ github.workspace }}/webroot"' - execute: - - "index.cfm" - - "test.cfm" - - "sub/test.cfm" steps: - uses: actions/checkout@v4 - name: Set up Java @@ -87,10 +74,23 @@ jobs: with: distribution: 'temurin' java-version: '21' - - name: Run Ant webroot test + - name: Run all webroot/execute combinations shell: bash run: | - ant -buildfile build.xml -Dwebroot=${{ matrix.webroot }} -Dexecute="${{ matrix.execute }}" -DuniqueWorkingDir=true + webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" '"./webroot"' '"${{ github.workspace }}/webroot"' ) + executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) + for w in "${webroots[@]}"; do + for e in "${executes[@]}"; do + echo "Testing webroot=$w execute=$e" + result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1) + if [ $? -ne 0 ]; then + cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DuniqueWorkingDir=true" + platform="macos-latest" + shell="bash" + echo -e "## Platform: $platform | Shell: $shell\n### $cmd\nFAILED: $w / $e\n$result\n" >> "$GITHUB_STEP_SUMMARY" + fi + done + done working-directory: ${{ github.workspace }} - name: Check output shell: bash @@ -101,19 +101,6 @@ jobs: macos-pwsh: name: MacOS PowerShell runs-on: macos-latest - strategy: - matrix: - webroot: - - '.' - - "./webroot" - - "webroot" - - ${{ github.workspace }}/webroot - - '"./webroot"' - - '"${{ github.workspace }}/webroot"' - execute: - - "index.cfm" - - "test.cfm" - - "sub/test.cfm" steps: - uses: actions/checkout@v4 - name: Set up Java @@ -121,10 +108,23 @@ jobs: with: distribution: 'temurin' java-version: '21' - - name: Run Ant webroot test + - name: Run all webroot/execute combinations shell: pwsh run: | - ant -buildfile build.xml -Dwebroot=${{ matrix.webroot }} -Dexecute="${{ matrix.execute }}" -DuniqueWorkingDir=true + $webroots = @('.', './webroot', 'webroot', "${{ github.workspace }}/webroot", '"./webroot"', '"${{ github.workspace }}/webroot"') + $executes = @('index.cfm', 'test.cfm', 'sub/test.cfm') + foreach ($w in $webroots) { + foreach ($e in $executes) { + Write-Host "Testing webroot=$w execute=$e" + $result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1 + if ($LASTEXITCODE -ne 0) { + $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DuniqueWorkingDir=true" + $platform = "macos-latest" + $shell = "pwsh" + "## Platform: $platform | Shell: $shell`n### $cmd`nFAILED: $w / $e`n$result`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY + } + } + } working-directory: ${{ github.workspace }} - name: Check output shell: pwsh @@ -135,19 +135,6 @@ jobs: windows-cmd: name: Windows CMD runs-on: windows-latest - strategy: - matrix: - webroot: - - '.' - - "./webroot" - - "webroot" - - ${{ github.workspace }}\webroot - - '"./webroot"' - - '"${{ github.workspace }}\\webroot"' - execute: - - "index.cfm" - - "test.cfm" - - "sub/test.cfm" steps: - uses: actions/checkout@v4 - name: Set up Java @@ -155,10 +142,25 @@ jobs: with: distribution: 'temurin' java-version: '21' - - name: Run Ant webroot test + - name: Run all webroot/execute combinations shell: cmd run: | - ant -buildfile build.xml -Dwebroot=${{ matrix.webroot }} -Dexecute="${{ matrix.execute }}" -DuniqueWorkingDir=true + set webroots=.,./webroot,webroot,"${{ github.workspace }}\webroot","./webroot","${{ github.workspace }}\\webroot" + set executes=index.cfm,test.cfm,sub/test.cfm + for %w in (%webroots%) do ( + for %e in (%executes%) do ( + echo Testing webroot=%w execute=%e + ant -buildfile build.xml -Dwebroot=%w -Dexecute=%e -DuniqueWorkingDir=true > result.txt 2>&1 + if errorlevel 1 ( + set cmd=ant -buildfile build.xml -Dwebroot=%w -Dexecute="%e" -DuniqueWorkingDir=true + echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% + echo ### %cmd%>> %GITHUB_STEP_SUMMARY% + echo FAILED: %w / %e:>> %GITHUB_STEP_SUMMARY% + type result.txt >> %GITHUB_STEP_SUMMARY% + echo.>> %GITHUB_STEP_SUMMARY% + ) + ) + ) working-directory: ${{ github.workspace }} - name: Check output shell: cmd @@ -169,19 +171,6 @@ jobs: windows-pwsh: name: Windows PowerShell runs-on: windows-latest - strategy: - matrix: - webroot: - - '.' - - "./webroot" - - "webroot" - - ${{ github.workspace }}\webroot - - '"./webroot"' - - '"${{ github.workspace }}\\webroot"' - execute: - - "index.cfm" - - "test.cfm" - - "sub/test.cfm" steps: - uses: actions/checkout@v4 - name: Set up Java @@ -189,10 +178,23 @@ jobs: with: distribution: 'temurin' java-version: '21' - - name: Run Ant webroot test + - name: Run all webroot/execute combinations shell: pwsh run: | - ant -buildfile build.xml -Dwebroot=${{ matrix.webroot }} -Dexecute="${{ matrix.execute }}" -DuniqueWorkingDir=true + $webroots = @('.', './webroot', 'webroot', "${{ github.workspace }}\webroot", '"./webroot"', '"${{ github.workspace }}\\webroot"') + $executes = @('index.cfm', 'test.cfm', 'sub/test.cfm') + foreach ($w in $webroots) { + foreach ($e in $executes) { + Write-Host "Testing webroot=$w execute=$e" + $result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1 + if ($LASTEXITCODE -ne 0) { + $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DuniqueWorkingDir=true" + $platform = "windows-latest" + $shell = "pwsh" + "## Platform: $platform | Shell: $shell`n### $cmd`nFAILED: $w / $e`n$result`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY + } + } + } working-directory: ${{ github.workspace }} - name: Check output shell: pwsh @@ -203,19 +205,6 @@ jobs: windows-bash: name: Windows Bash runs-on: windows-latest - strategy: - matrix: - webroot: - - '.' - - "./webroot" - - "webroot" - - ${{ github.workspace }}/webroot - - '"./webroot"' - - '"${{ github.workspace }}/webroot"' - execute: - - "index.cfm" - - "test.cfm" - - "sub/test.cfm" steps: - uses: actions/checkout@v4 - name: Set up Java @@ -223,10 +212,23 @@ jobs: with: distribution: 'temurin' java-version: '21' - - name: Run Ant webroot test + - name: Run all webroot/execute combinations shell: bash run: | - ant -buildfile build.xml -Dwebroot=${{ matrix.webroot }} -Dexecute="${{ matrix.execute }}" -DuniqueWorkingDir=true + webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" '"./webroot"' '"${{ github.workspace }}/webroot"' ) + executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) + for w in "${webroots[@]}"; do + for e in "${executes[@]}"; do + echo "Testing webroot=$w execute=$e" + result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1) + if [ $? -ne 0 ]; then + cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DuniqueWorkingDir=true" + platform="windows-latest" + shell="bash" + echo -e "## Platform: $platform | Shell: $shell\n### $cmd\nFAILED: $w / $e\n$result\n" >> "$GITHUB_STEP_SUMMARY" + fi + done + done working-directory: ${{ github.workspace }} - name: Check output shell: bash From 3debfa9a7c4dbe639df5529b83da8010b7d1929f Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 14:54:13 +0200 Subject: [PATCH 09/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index a8dae8f..63b6c00 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -18,6 +18,11 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v4 + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2 + key: lucee-script-runner-maven-cache - name: Set up Java uses: actions/setup-java@v4 with: @@ -50,7 +55,7 @@ jobs: Write-Host "Testing webroot=$w execute=$e" $result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1 if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DuniqueWorkingDir=true" + $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DuniqueWorkingDir=true" $platform = "ubuntu-latest" $shell = "pwsh" "## Platform: $platform | Shell: $shell`n### $cmd`nFAILED: $w / $e`n$result`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY @@ -118,7 +123,7 @@ jobs: Write-Host "Testing webroot=$w execute=$e" $result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1 if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DuniqueWorkingDir=true" + $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DuniqueWorkingDir=true" $platform = "macos-latest" $shell = "pwsh" "## Platform: $platform | Shell: $shell`n### $cmd`nFAILED: $w / $e`n$result`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY @@ -188,7 +193,7 @@ jobs: Write-Host "Testing webroot=$w execute=$e" $result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1 if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DuniqueWorkingDir=true" + $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DuniqueWorkingDir=true" $platform = "windows-latest" $shell = "pwsh" "## Platform: $platform | Shell: $shell`n### $cmd`nFAILED: $w / $e`n$result`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY From d8939914c838b940c4f69e56a70607d8ccb59da9 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 15:08:16 +0200 Subject: [PATCH 10/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 77 ++++++++++++++++------------ 1 file changed, 45 insertions(+), 32 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 63b6c00..ee19d13 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -56,23 +56,30 @@ jobs: $result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1 if ($LASTEXITCODE -ne 0) { $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DuniqueWorkingDir=true" - $platform = "ubuntu-latest" - $shell = "pwsh" - "## Platform: $platform | Shell: $shell`n### $cmd`nFAILED: $w / $e`n$result`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY - } - } - } - working-directory: ${{ github.workspace }} - - name: Check output - shell: pwsh - run: | - Select-String 'webroot test:' logs/* | Out-Null; if ($LASTEXITCODE -ne 0) { Write-Host 'webroot test output not found'; exit 1 } - working-directory: ${{ github.workspace }} - - macos-bash: - name: MacOS Bash - runs-on: macos-latest - steps: + $platform = "macos-latest" + shell: pwsh + run: | + $webroots = @('.', './webroot', 'webroot', "${{ github.workspace }}\webroot", '"./webroot"', '"${{ github.workspace }}\\webroot"') + $executes = @('index.cfm', 'test.cfm', 'sub/test.cfm') + foreach ($w in $webroots) { + foreach ($e in $executes) { + Write-Host "Testing webroot=$w execute=$e" + $result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1 + if ($LASTEXITCODE -ne 0) { + $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DuniqueWorkingDir=true" + $platform = "windows-latest" + $shell = "pwsh" + $summary = @() + $summary += "## Platform: $platform | Shell: $shell" + $summary += "### $cmd" + $summary += '```' + $summary += "FAILED: $w / $e" + $summary += $result + $summary += '```' + $summary -join "`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY + } + } + } - uses: actions/checkout@v4 - name: Set up Java uses: actions/setup-java@v4 @@ -92,7 +99,7 @@ jobs: cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DuniqueWorkingDir=true" platform="macos-latest" shell="bash" - echo -e "## Platform: $platform | Shell: $shell\n### $cmd\nFAILED: $w / $e\n$result\n" >> "$GITHUB_STEP_SUMMARY" + echo -e "## Platform: $platform | Shell: $shell\n### $cmd\n\`\`\`\nFAILED: $w / $e\n$result\n\`\`\`\n" >> "$GITHUB_STEP_SUMMARY" fi done done @@ -123,13 +130,10 @@ jobs: Write-Host "Testing webroot=$w execute=$e" $result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1 if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DuniqueWorkingDir=true" - $platform = "macos-latest" + $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DuniqueWorkingDir=true" + $platform = "macos-latest" $shell = "pwsh" - "## Platform: $platform | Shell: $shell`n### $cmd`nFAILED: $w / $e`n$result`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY - } - } - } + "## Platform: $platform | Shell: $shell`n### $cmd`n``` working-directory: ${{ github.workspace }} - name: Check output shell: pwsh @@ -152,16 +156,18 @@ jobs: run: | set webroots=.,./webroot,webroot,"${{ github.workspace }}\webroot","./webroot","${{ github.workspace }}\\webroot" set executes=index.cfm,test.cfm,sub/test.cfm - for %w in (%webroots%) do ( - for %e in (%executes%) do ( - echo Testing webroot=%w execute=%e - ant -buildfile build.xml -Dwebroot=%w -Dexecute=%e -DuniqueWorkingDir=true > result.txt 2>&1 + for %%w in (%webroots%) do ( + for %%e in (%executes%) do ( + echo Testing webroot=%%w execute=%%e + ant -buildfile build.xml -Dwebroot=%%w -Dexecute=%%e -DuniqueWorkingDir=true > result.txt 2>&1 if errorlevel 1 ( - set cmd=ant -buildfile build.xml -Dwebroot=%w -Dexecute="%e" -DuniqueWorkingDir=true + set cmd=ant -buildfile build.xml -Dwebroot=%%w -Dexecute="%%e" -DuniqueWorkingDir=true echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% echo ### %cmd%>> %GITHUB_STEP_SUMMARY% - echo FAILED: %w / %e:>> %GITHUB_STEP_SUMMARY% + echo "```" >> %GITHUB_STEP_SUMMARY% + echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% type result.txt >> %GITHUB_STEP_SUMMARY% + echo "```" >> %GITHUB_STEP_SUMMARY% echo.>> %GITHUB_STEP_SUMMARY% ) ) @@ -196,7 +202,14 @@ jobs: $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DuniqueWorkingDir=true" $platform = "windows-latest" $shell = "pwsh" - "## Platform: $platform | Shell: $shell`n### $cmd`nFAILED: $w / $e`n$result`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY + $summary = @() + $summary += "## Platform: $platform | Shell: $shell" + $summary += "### $cmd" + $summary += '```' + $summary += "FAILED: $w / $e" + $summary += $result + $summary += '```' + $summary -join "`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY } } } @@ -230,7 +243,7 @@ jobs: cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DuniqueWorkingDir=true" platform="windows-latest" shell="bash" - echo -e "## Platform: $platform | Shell: $shell\n### $cmd\nFAILED: $w / $e\n$result\n" >> "$GITHUB_STEP_SUMMARY" + echo -e "## Platform: $platform | Shell: $shell\n### $cmd\n\`\`\`\nFAILED: $w / $e\n$result\n\`\`\`\n" >> "$GITHUB_STEP_SUMMARY" fi done done From a55a07a80c9b81b09423fb69c9009df9b77c6a70 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 15:17:30 +0200 Subject: [PATCH 11/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 45 +++++++--------------------- 1 file changed, 10 insertions(+), 35 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index ee19d13..5bd1f83 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -53,9 +53,9 @@ jobs: foreach ($w in $webroots) { foreach ($e in $executes) { Write-Host "Testing webroot=$w execute=$e" - $result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1 + $result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false 2>&1 if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DuniqueWorkingDir=true" + $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DpreCleanup=false -DpostCleanup=false" $platform = "macos-latest" shell: pwsh run: | @@ -94,9 +94,9 @@ jobs: for w in "${webroots[@]}"; do for e in "${executes[@]}"; do echo "Testing webroot=$w execute=$e" - result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1) + result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false 2>&1) if [ $? -ne 0 ]; then - cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DuniqueWorkingDir=true" + cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false" platform="macos-latest" shell="bash" echo -e "## Platform: $platform | Shell: $shell\n### $cmd\n\`\`\`\nFAILED: $w / $e\n$result\n\`\`\`\n" >> "$GITHUB_STEP_SUMMARY" @@ -104,11 +104,6 @@ jobs: done done working-directory: ${{ github.workspace }} - - name: Check output - shell: bash - run: | - grep 'webroot test:' logs/* || (echo 'webroot test output not found' && exit 1) - working-directory: ${{ github.workspace }} macos-pwsh: name: MacOS PowerShell @@ -135,11 +130,6 @@ jobs: $shell = "pwsh" "## Platform: $platform | Shell: $shell`n### $cmd`n``` working-directory: ${{ github.workspace }} - - name: Check output - shell: pwsh - run: | - Select-String 'webroot test:' logs/* | Out-Null; if ($LASTEXITCODE -ne 0) { Write-Host 'webroot test output not found'; exit 1 } - working-directory: ${{ github.workspace }} windows-cmd: name: Windows CMD @@ -159,9 +149,9 @@ jobs: for %%w in (%webroots%) do ( for %%e in (%executes%) do ( echo Testing webroot=%%w execute=%%e - ant -buildfile build.xml -Dwebroot=%%w -Dexecute=%%e -DuniqueWorkingDir=true > result.txt 2>&1 + ant -buildfile build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false > result.txt 2>&1 if errorlevel 1 ( - set cmd=ant -buildfile build.xml -Dwebroot=%%w -Dexecute="%%e" -DuniqueWorkingDir=true + set cmd=ant -buildfile build.xml -Dwebroot=%%w -Dexecute="%%e" -DpreCleanup=false -DpostCleanup=false echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% echo ### %cmd%>> %GITHUB_STEP_SUMMARY% echo "```" >> %GITHUB_STEP_SUMMARY% @@ -173,11 +163,6 @@ jobs: ) ) working-directory: ${{ github.workspace }} - - name: Check output - shell: cmd - run: | - findstr "webroot test:" logs\* || (echo webroot test output not found && exit 1) - working-directory: ${{ github.workspace }} windows-pwsh: name: Windows PowerShell @@ -197,9 +182,9 @@ jobs: foreach ($w in $webroots) { foreach ($e in $executes) { Write-Host "Testing webroot=$w execute=$e" - $result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1 + $result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false 2>&1 if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DuniqueWorkingDir=true" + $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DpreCleanup=false -DpostCleanup=false" $platform = "windows-latest" $shell = "pwsh" $summary = @() @@ -214,11 +199,6 @@ jobs: } } working-directory: ${{ github.workspace }} - - name: Check output - shell: pwsh - run: | - Select-String 'webroot test:' logs/* | Out-Null; if ($LASTEXITCODE -ne 0) { Write-Host 'webroot test output not found'; exit 1 } - working-directory: ${{ github.workspace }} windows-bash: name: Windows Bash @@ -238,9 +218,9 @@ jobs: for w in "${webroots[@]}"; do for e in "${executes[@]}"; do echo "Testing webroot=$w execute=$e" - result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1) + result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false 2>&1) if [ $? -ne 0 ]; then - cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DuniqueWorkingDir=true" + cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false" platform="windows-latest" shell="bash" echo -e "## Platform: $platform | Shell: $shell\n### $cmd\n\`\`\`\nFAILED: $w / $e\n$result\n\`\`\`\n" >> "$GITHUB_STEP_SUMMARY" @@ -248,8 +228,3 @@ jobs: done done working-directory: ${{ github.workspace }} - - name: Check output - shell: bash - run: | - grep 'webroot test:' logs/* || (echo 'webroot test output not found' && exit 1) - working-directory: ${{ github.workspace }} From 434fde24850fa6cfceb77645e93eb92ce35b4f00 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 15:28:58 +0200 Subject: [PATCH 12/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 46 +++++++++++++++++++--------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 5bd1f83..48ea33e 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -29,11 +29,17 @@ jobs: distribution: 'temurin' java-version: '17' - name: Run default test (index.cfm) - run: ant -Dwebroot=webroot -Dexecute=index.cfm + env: + LUCEE_VERSION_QUERY: 7/all/zero + run: ant -Dwebroot=webroot -Dexecute=index.cfm -DluceeVersionQuery=$LUCEE_VERSION_QUERY - name: Run subfolder test (sub/test.cfm) - run: ant -Dwebroot=webroot -Dexecute=sub/test.cfm + env: + LUCEE_VERSION_QUERY: 7/all/zero + run: ant -Dwebroot=webroot -Dexecute=sub/test.cfm -DluceeVersionQuery=$LUCEE_VERSION_QUERY - name: Run test.cfm - run: ant -Dwebroot=webroot -Dexecute=test.cfm + env: + LUCEE_VERSION_QUERY: 7/all/zero + run: ant -Dwebroot=webroot -Dexecute=test.cfm -DluceeVersionQuery=$LUCEE_VERSION_QUERY # Add more steps for other argument combinations if needed ubuntu-pwsh: name: Ubuntu PowerShell @@ -47,15 +53,17 @@ jobs: java-version: '21' - name: Run all webroot/execute combinations shell: pwsh + env: + LUCEE_VERSION_QUERY: 7/all/zero run: | $webroots = @('.', './webroot', 'webroot', "${{ github.workspace }}/webroot", '"./webroot"', '"${{ github.workspace }}/webroot"') $executes = @('index.cfm', 'test.cfm', 'sub/test.cfm') foreach ($w in $webroots) { foreach ($e in $executes) { Write-Host "Testing webroot=$w execute=$e" - $result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false 2>&1 + $result = ant -buildfile build.xml -Dwebroot="$w" -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY 2>&1 if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DpreCleanup=false -DpostCleanup=false" + $cmd = "ant -buildfile build.xml -Dwebroot=\"$w\" -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY" $platform = "macos-latest" shell: pwsh run: | @@ -64,9 +72,9 @@ jobs: foreach ($w in $webroots) { foreach ($e in $executes) { Write-Host "Testing webroot=$w execute=$e" - $result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1 + $result = ant -buildfile build.xml -Dwebroot="$w" -Dexecute="$e" -DuniqueWorkingDir=true -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY 2>&1 if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DuniqueWorkingDir=true" + $cmd = "ant -buildfile build.xml -Dwebroot=\"$w\" -Dexecute=\"$e\" -DuniqueWorkingDir=true -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY" $platform = "windows-latest" $shell = "pwsh" $summary = @() @@ -88,15 +96,17 @@ jobs: java-version: '21' - name: Run all webroot/execute combinations shell: bash + env: + LUCEE_VERSION_QUERY: 7/all/zero run: | webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" '"./webroot"' '"${{ github.workspace }}/webroot"' ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) for w in "${webroots[@]}"; do for e in "${executes[@]}"; do echo "Testing webroot=$w execute=$e" - result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false 2>&1) + result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$LUCEE_VERSION_QUERY 2>&1) if [ $? -ne 0 ]; then - cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false" + cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$LUCEE_VERSION_QUERY" platform="macos-latest" shell="bash" echo -e "## Platform: $platform | Shell: $shell\n### $cmd\n\`\`\`\nFAILED: $w / $e\n$result\n\`\`\`\n" >> "$GITHUB_STEP_SUMMARY" @@ -143,15 +153,17 @@ jobs: java-version: '21' - name: Run all webroot/execute combinations shell: cmd + env: + LUCEE_VERSION_QUERY: 7/all/zero run: | set webroots=.,./webroot,webroot,"${{ github.workspace }}\webroot","./webroot","${{ github.workspace }}\\webroot" set executes=index.cfm,test.cfm,sub/test.cfm for %%w in (%webroots%) do ( for %%e in (%executes%) do ( echo Testing webroot=%%w execute=%%e - ant -buildfile build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false > result.txt 2>&1 + ant -buildfile build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% > result.txt 2>&1 if errorlevel 1 ( - set cmd=ant -buildfile build.xml -Dwebroot=%%w -Dexecute="%%e" -DpreCleanup=false -DpostCleanup=false + set cmd=ant -buildfile build.xml -Dwebroot=%%w -Dexecute="%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% echo ### %cmd%>> %GITHUB_STEP_SUMMARY% echo "```" >> %GITHUB_STEP_SUMMARY% @@ -176,15 +188,17 @@ jobs: java-version: '21' - name: Run all webroot/execute combinations shell: pwsh + env: + LUCEE_VERSION_QUERY: 7/all/zero run: | $webroots = @('.', './webroot', 'webroot', "${{ github.workspace }}\webroot", '"./webroot"', '"${{ github.workspace }}\\webroot"') $executes = @('index.cfm', 'test.cfm', 'sub/test.cfm') foreach ($w in $webroots) { foreach ($e in $executes) { Write-Host "Testing webroot=$w execute=$e" - $result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false 2>&1 + $result = ant -buildfile build.xml -Dwebroot="$w" -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY 2>&1 if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DpreCleanup=false -DpostCleanup=false" + $cmd = "ant -buildfile build.xml -Dwebroot=\"$w\" -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY" $platform = "windows-latest" $shell = "pwsh" $summary = @() @@ -212,15 +226,17 @@ jobs: java-version: '21' - name: Run all webroot/execute combinations shell: bash + env: + LUCEE_VERSION_QUERY: 7/all/zero run: | webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" '"./webroot"' '"${{ github.workspace }}/webroot"' ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) for w in "${webroots[@]}"; do for e in "${executes[@]}"; do echo "Testing webroot=$w execute=$e" - result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false 2>&1) + result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$LUCEE_VERSION_QUERY 2>&1) if [ $? -ne 0 ]; then - cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false" + cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$LUCEE_VERSION_QUERY" platform="windows-latest" shell="bash" echo -e "## Platform: $platform | Shell: $shell\n### $cmd\n\`\`\`\nFAILED: $w / $e\n$result\n\`\`\`\n" >> "$GITHUB_STEP_SUMMARY" From db251db0a9f41aeab5fd545b8ea7a7589f3d90d8 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 15:35:00 +0200 Subject: [PATCH 13/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 48ea33e..70ec40b 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -31,15 +31,15 @@ jobs: - name: Run default test (index.cfm) env: LUCEE_VERSION_QUERY: 7/all/zero - run: ant -Dwebroot=webroot -Dexecute=index.cfm -DluceeVersionQuery=$LUCEE_VERSION_QUERY + run: ant -Dwebroot=webroot -Dexecute=index.cfm -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$LUCEE_VERSION_QUERY - name: Run subfolder test (sub/test.cfm) env: LUCEE_VERSION_QUERY: 7/all/zero - run: ant -Dwebroot=webroot -Dexecute=sub/test.cfm -DluceeVersionQuery=$LUCEE_VERSION_QUERY + run: ant -Dwebroot=webroot -Dexecute=sub/test.cfm -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$LUCEE_VERSION_QUERY - name: Run test.cfm env: LUCEE_VERSION_QUERY: 7/all/zero - run: ant -Dwebroot=webroot -Dexecute=test.cfm -DluceeVersionQuery=$LUCEE_VERSION_QUERY + run: ant -Dwebroot=webroot -Dexecute=test.cfm -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$LUCEE_VERSION_QUERY # Add more steps for other argument combinations if needed ubuntu-pwsh: name: Ubuntu PowerShell @@ -63,7 +63,7 @@ jobs: Write-Host "Testing webroot=$w execute=$e" $result = ant -buildfile build.xml -Dwebroot="$w" -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY 2>&1 if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile build.xml -Dwebroot=\"$w\" -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY" + $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY" $platform = "macos-latest" shell: pwsh run: | @@ -74,7 +74,7 @@ jobs: Write-Host "Testing webroot=$w execute=$e" $result = ant -buildfile build.xml -Dwebroot="$w" -Dexecute="$e" -DuniqueWorkingDir=true -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY 2>&1 if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile build.xml -Dwebroot=\"$w\" -Dexecute=\"$e\" -DuniqueWorkingDir=true -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY" + $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=$e -DuniqueWorkingDir=true -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY" $platform = "windows-latest" $shell = "pwsh" $summary = @() @@ -198,7 +198,7 @@ jobs: Write-Host "Testing webroot=$w execute=$e" $result = ant -buildfile build.xml -Dwebroot="$w" -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY 2>&1 if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile build.xml -Dwebroot=\"$w\" -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY" + $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY" $platform = "windows-latest" $shell = "pwsh" $summary = @() From 5c1adcdd75e0c9f00090b97b66367adfcdb55885 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 15:51:55 +0200 Subject: [PATCH 14/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 70ec40b..33181c2 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -61,7 +61,17 @@ jobs: foreach ($w in $webroots) { foreach ($e in $executes) { Write-Host "Testing webroot=$w execute=$e" - $result = ant -buildfile build.xml -Dwebroot="$w" -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY 2>&1 + $luceeVersionQuery = $env:LUCEE_VERSION_QUERY + $antArgs = @( + '-buildfile', 'build.xml', + "-Dwebroot=$w", + "-Dexecute=$e", + '-DpreCleanup=false', + '-DpostCleanup=false', + "-DluceeVersionQuery=$luceeVersionQuery" + ) + Write-Host "CMD: ant $($antArgs -join ' ')" + $result = & ant @antArgs 2>&1 if ($LASTEXITCODE -ne 0) { $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY" $platform = "macos-latest" From da655e999de29030ba97ce5388bc6912d73e5db9 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 15:57:35 +0200 Subject: [PATCH 15/59] Update build.xml --- build.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build.xml b/build.xml index 006c71b..f908ae2 100644 --- a/build.xml +++ b/build.xml @@ -132,6 +132,14 @@ + + + + + + + + From 400da8d0e73e2287138556b2147c594d0451e29e Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 15:59:42 +0200 Subject: [PATCH 16/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 33181c2..19c1f48 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -111,13 +111,14 @@ jobs: run: | webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" '"./webroot"' '"${{ github.workspace }}/webroot"' ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) + luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" for w in "${webroots[@]}"; do for e in "${executes[@]}"; do echo "Testing webroot=$w execute=$e" - result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$LUCEE_VERSION_QUERY 2>&1) + result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" 2>&1) if [ $? -ne 0 ]; then - cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$LUCEE_VERSION_QUERY" - platform="macos-latest" + cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" + platform="windows-latest" shell="bash" echo -e "## Platform: $platform | Shell: $shell\n### $cmd\n\`\`\`\nFAILED: $w / $e\n$result\n\`\`\`\n" >> "$GITHUB_STEP_SUMMARY" fi From 051d3bab8352c646d936fd4d160b24e3e333b58f Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 16:03:38 +0200 Subject: [PATCH 17/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 19c1f48..52c4361 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -207,9 +207,19 @@ jobs: foreach ($w in $webroots) { foreach ($e in $executes) { Write-Host "Testing webroot=$w execute=$e" - $result = ant -buildfile build.xml -Dwebroot="$w" -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY 2>&1 + $luceeVersionQuery = $env:LUCEE_VERSION_QUERY + $antArgs = @( + '-buildfile', 'build.xml', + "-Dwebroot=$w", + "-Dexecute=$e", + '-DpreCleanup=false', + '-DpostCleanup=false', + "-DluceeVersionQuery=$luceeVersionQuery" + ) + Write-Host "CMD: ant $($antArgs -join ' ')" + $result = & ant @antArgs 2>&1 if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY" + $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" $platform = "windows-latest" $shell = "pwsh" $summary = @() From 88a9509b866fc1f30306fcb050ccfd1cc1ec736b Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 16:05:24 +0200 Subject: [PATCH 18/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 52c4361..b1210f1 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -250,14 +250,15 @@ jobs: env: LUCEE_VERSION_QUERY: 7/all/zero run: | + luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" '"./webroot"' '"${{ github.workspace }}/webroot"' ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) for w in "${webroots[@]}"; do for e in "${executes[@]}"; do echo "Testing webroot=$w execute=$e" - result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$LUCEE_VERSION_QUERY 2>&1) + result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" 2>&1) if [ $? -ne 0 ]; then - cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$LUCEE_VERSION_QUERY" + cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" platform="windows-latest" shell="bash" echo -e "## Platform: $platform | Shell: $shell\n### $cmd\n\`\`\`\nFAILED: $w / $e\n$result\n\`\`\`\n" >> "$GITHUB_STEP_SUMMARY" From eef735f4939f5f499732affaa37a1bf297c98421 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 16:13:47 +0200 Subject: [PATCH 19/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 122 ++++++++------------------- 1 file changed, 36 insertions(+), 86 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index b1210f1..a886e09 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -1,16 +1,44 @@ name: Webroot Handling Matrix - on: push: pull_request: workflow_dispatch: - concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true - - jobs: + macos-bash: + name: MacOS Bash + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Run all webroot/execute combinations + shell: bash + env: + LUCEE_VERSION_QUERY: 7/all/zero + run: | + luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" + webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" '"./webroot"' '"${{ github.workspace }}/webroot"' ) + executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) + for w in "${webroots[@]}"; do + for e in "${executes[@]}"; do + echo "Testing webroot=$w execute=$e" + result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" 2>&1) + if [ $? -ne 0 ]; then + cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" + platform="macos-latest" + shell="bash" + echo -e "## Platform: $platform | Shell: $shell\n### $cmd\n\`\`\`\nFAILED: $w / $e\n$result\n\`\`\`\n" >> "$GITHUB_STEP_SUMMARY" + fi + done + done + working-directory: ${{ github.workspace }} + test: runs-on: ${{ matrix.os }} strategy: @@ -41,64 +69,11 @@ jobs: LUCEE_VERSION_QUERY: 7/all/zero run: ant -Dwebroot=webroot -Dexecute=test.cfm -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$LUCEE_VERSION_QUERY # Add more steps for other argument combinations if needed - ubuntu-pwsh: - name: Ubuntu PowerShell + ubuntu-bash: + name: Ubuntu Bash runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '21' - - name: Run all webroot/execute combinations - shell: pwsh - env: - LUCEE_VERSION_QUERY: 7/all/zero - run: | - $webroots = @('.', './webroot', 'webroot', "${{ github.workspace }}/webroot", '"./webroot"', '"${{ github.workspace }}/webroot"') - $executes = @('index.cfm', 'test.cfm', 'sub/test.cfm') - foreach ($w in $webroots) { - foreach ($e in $executes) { - Write-Host "Testing webroot=$w execute=$e" - $luceeVersionQuery = $env:LUCEE_VERSION_QUERY - $antArgs = @( - '-buildfile', 'build.xml', - "-Dwebroot=$w", - "-Dexecute=$e", - '-DpreCleanup=false', - '-DpostCleanup=false', - "-DluceeVersionQuery=$luceeVersionQuery" - ) - Write-Host "CMD: ant $($antArgs -join ' ')" - $result = & ant @antArgs 2>&1 - if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY" - $platform = "macos-latest" - shell: pwsh - run: | - $webroots = @('.', './webroot', 'webroot', "${{ github.workspace }}\webroot", '"./webroot"', '"${{ github.workspace }}\\webroot"') - $executes = @('index.cfm', 'test.cfm', 'sub/test.cfm') - foreach ($w in $webroots) { - foreach ($e in $executes) { - Write-Host "Testing webroot=$w execute=$e" - $result = ant -buildfile build.xml -Dwebroot="$w" -Dexecute="$e" -DuniqueWorkingDir=true -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY 2>&1 - if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=$e -DuniqueWorkingDir=true -DluceeVersionQuery=$env:LUCEE_VERSION_QUERY" - $platform = "windows-latest" - $shell = "pwsh" - $summary = @() - $summary += "## Platform: $platform | Shell: $shell" - $summary += "### $cmd" - $summary += '```' - $summary += "FAILED: $w / $e" - $summary += $result - $summary += '```' - $summary -join "`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY - } - } - } - - uses: actions/checkout@v4 - name: Set up Java uses: actions/setup-java@v4 with: @@ -109,16 +84,16 @@ jobs: env: LUCEE_VERSION_QUERY: 7/all/zero run: | + luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" '"./webroot"' '"${{ github.workspace }}/webroot"' ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) - luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" for w in "${webroots[@]}"; do for e in "${executes[@]}"; do echo "Testing webroot=$w execute=$e" result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" 2>&1) if [ $? -ne 0 ]; then cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" - platform="windows-latest" + platform="ubuntu-latest" shell="bash" echo -e "## Platform: $platform | Shell: $shell\n### $cmd\n\`\`\`\nFAILED: $w / $e\n$result\n\`\`\`\n" >> "$GITHUB_STEP_SUMMARY" fi @@ -126,31 +101,6 @@ jobs: done working-directory: ${{ github.workspace }} - macos-pwsh: - name: MacOS PowerShell - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '21' - - name: Run all webroot/execute combinations - shell: pwsh - run: | - $webroots = @('.', './webroot', 'webroot', "${{ github.workspace }}/webroot", '"./webroot"', '"${{ github.workspace }}/webroot"') - $executes = @('index.cfm', 'test.cfm', 'sub/test.cfm') - foreach ($w in $webroots) { - foreach ($e in $executes) { - Write-Host "Testing webroot=$w execute=$e" - $result = ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DuniqueWorkingDir=true 2>&1 - if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute='$e' -DuniqueWorkingDir=true" - $platform = "macos-latest" - $shell = "pwsh" - "## Platform: $platform | Shell: $shell`n### $cmd`n``` - working-directory: ${{ github.workspace }} windows-cmd: name: Windows CMD From 42601f68c2966bfe3fb6a360d3c62dfc4dab4d53 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 16:17:48 +0200 Subject: [PATCH 20/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index a886e09..419400d 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -23,9 +23,9 @@ jobs: LUCEE_VERSION_QUERY: 7/all/zero run: | luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" - webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" '"./webroot"' '"${{ github.workspace }}/webroot"' ) + webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) - for w in "${webroots[@]}"; do + for w in "${webroots[@]}"; do for e in "${executes[@]}"; do echo "Testing webroot=$w execute=$e" result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" 2>&1) @@ -85,9 +85,9 @@ jobs: LUCEE_VERSION_QUERY: 7/all/zero run: | luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" - webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" '"./webroot"' '"${{ github.workspace }}/webroot"' ) + webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) - for w in "${webroots[@]}"; do + for w in "${webroots[@]}"; do for e in "${executes[@]}"; do echo "Testing webroot=$w execute=$e" result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" 2>&1) @@ -117,7 +117,7 @@ jobs: env: LUCEE_VERSION_QUERY: 7/all/zero run: | - set webroots=.,./webroot,webroot,"${{ github.workspace }}\webroot","./webroot","${{ github.workspace }}\\webroot" + set webroots=.,./webroot,webroot,${{ github.workspace }}\webroot set executes=index.cfm,test.cfm,sub/test.cfm for %%w in (%webroots%) do ( for %%e in (%executes%) do ( @@ -201,9 +201,9 @@ jobs: LUCEE_VERSION_QUERY: 7/all/zero run: | luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" - webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" '"./webroot"' '"${{ github.workspace }}/webroot"' ) + webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) - for w in "${webroots[@]}"; do + for w in "${webroots[@]}"; do for e in "${executes[@]}"; do echo "Testing webroot=$w execute=$e" result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" 2>&1) From 7a8e076502f83f74952ac9a233e33d45121c588c Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 16:30:14 +0200 Subject: [PATCH 21/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 97 +--------------------------- 1 file changed, 1 insertion(+), 96 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 419400d..aa6eb21 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -25,7 +25,7 @@ jobs: luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) - for w in "${webroots[@]}"; do + for w in "${webroots[@]}"; do for e in "${executes[@]}"; do echo "Testing webroot=$w execute=$e" result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" 2>&1) @@ -39,36 +39,6 @@ jobs: done working-directory: ${{ github.workspace }} - test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - steps: - - uses: actions/checkout@v4 - - name: Cache Maven packages - uses: actions/cache@v4 - with: - path: ~/.m2 - key: lucee-script-runner-maven-cache - - name: Set up Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - name: Run default test (index.cfm) - env: - LUCEE_VERSION_QUERY: 7/all/zero - run: ant -Dwebroot=webroot -Dexecute=index.cfm -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$LUCEE_VERSION_QUERY - - name: Run subfolder test (sub/test.cfm) - env: - LUCEE_VERSION_QUERY: 7/all/zero - run: ant -Dwebroot=webroot -Dexecute=sub/test.cfm -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$LUCEE_VERSION_QUERY - - name: Run test.cfm - env: - LUCEE_VERSION_QUERY: 7/all/zero - run: ant -Dwebroot=webroot -Dexecute=test.cfm -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$LUCEE_VERSION_QUERY - # Add more steps for other argument combinations if needed ubuntu-bash: name: Ubuntu Bash runs-on: ubuntu-latest @@ -102,40 +72,6 @@ jobs: working-directory: ${{ github.workspace }} - windows-cmd: - name: Windows CMD - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '21' - - name: Run all webroot/execute combinations - shell: cmd - env: - LUCEE_VERSION_QUERY: 7/all/zero - run: | - set webroots=.,./webroot,webroot,${{ github.workspace }}\webroot - set executes=index.cfm,test.cfm,sub/test.cfm - for %%w in (%webroots%) do ( - for %%e in (%executes%) do ( - echo Testing webroot=%%w execute=%%e - ant -buildfile build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% > result.txt 2>&1 - if errorlevel 1 ( - set cmd=ant -buildfile build.xml -Dwebroot=%%w -Dexecute="%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% - echo ### %cmd%>> %GITHUB_STEP_SUMMARY% - echo "```" >> %GITHUB_STEP_SUMMARY% - echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% - type result.txt >> %GITHUB_STEP_SUMMARY% - echo "```" >> %GITHUB_STEP_SUMMARY% - echo.>> %GITHUB_STEP_SUMMARY% - ) - ) - ) - working-directory: ${{ github.workspace }} windows-pwsh: name: Windows PowerShell @@ -185,34 +121,3 @@ jobs: } working-directory: ${{ github.workspace }} - windows-bash: - name: Windows Bash - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '21' - - name: Run all webroot/execute combinations - shell: bash - env: - LUCEE_VERSION_QUERY: 7/all/zero - run: | - luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" - webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" ) - executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) - for w in "${webroots[@]}"; do - for e in "${executes[@]}"; do - echo "Testing webroot=$w execute=$e" - result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" 2>&1) - if [ $? -ne 0 ]; then - cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" - platform="windows-latest" - shell="bash" - echo -e "## Platform: $platform | Shell: $shell\n### $cmd\n\`\`\`\nFAILED: $w / $e\n$result\n\`\`\`\n" >> "$GITHUB_STEP_SUMMARY" - fi - done - done - working-directory: ${{ github.workspace }} From c668ddd255fcd6df701c2b62feba0d6bbe27795e Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 16:32:17 +0200 Subject: [PATCH 22/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 67 +++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index aa6eb21..e367af4 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -25,7 +25,7 @@ jobs: luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) - for w in "${webroots[@]}"; do + for w in "${webroots[@]}"; do for e in "${executes[@]}"; do echo "Testing webroot=$w execute=$e" result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" 2>&1) @@ -72,6 +72,40 @@ jobs: working-directory: ${{ github.workspace }} + windows-cmd: + name: Windows CMD + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Run all webroot/execute combinations + shell: cmd + env: + LUCEE_VERSION_QUERY: 7/all/zero + run: | + set webroots=.,./webroot,webroot,${{ github.workspace }}\webroot + set executes=index.cfm,test.cfm,sub/test.cfm + for %%w in (%webroots%) do ( + for %%e in (%executes%) do ( + echo Testing webroot=%%w execute=%%e + ant -buildfile build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% > result.txt 2>&1 + if errorlevel 1 ( + set cmd=ant -buildfile build.xml -Dwebroot=%%w -Dexecute="%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% + echo ### %cmd%>> %GITHUB_STEP_SUMMARY% + echo "```" >> %GITHUB_STEP_SUMMARY% + echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% + type result.txt >> %GITHUB_STEP_SUMMARY% + echo "```" >> %GITHUB_STEP_SUMMARY% + echo.>> %GITHUB_STEP_SUMMARY% + ) + ) + ) + working-directory: ${{ github.workspace }} windows-pwsh: name: Windows PowerShell @@ -121,3 +155,34 @@ jobs: } working-directory: ${{ github.workspace }} + windows-bash: + name: Windows Bash + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Run all webroot/execute combinations + shell: bash + env: + LUCEE_VERSION_QUERY: 7/all/zero + run: | + luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" + webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" ) + executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) + for w in "${webroots[@]}"; do + for e in "${executes[@]}"; do + echo "Testing webroot=$w execute=$e" + result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" 2>&1) + if [ $? -ne 0 ]; then + cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" + platform="windows-latest" + shell="bash" + echo -e "## Platform: $platform | Shell: $shell\n### $cmd\n\`\`\`\nFAILED: $w / $e\n$result\n\`\`\`\n" >> "$GITHUB_STEP_SUMMARY" + fi + done + done + working-directory: ${{ github.workspace }} From 55036e7b68fe00dfd74c38066337e71748762de5 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 16:38:30 +0200 Subject: [PATCH 23/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index e367af4..0a95603 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -122,7 +122,7 @@ jobs: env: LUCEE_VERSION_QUERY: 7/all/zero run: | - $webroots = @('.', './webroot', 'webroot', "${{ github.workspace }}\webroot", '"./webroot"', '"${{ github.workspace }}\\webroot"') + $webroots = @('.', './webroot', 'webroot', "${{ github.workspace }}\webroot") $executes = @('index.cfm', 'test.cfm', 'sub/test.cfm') foreach ($w in $webroots) { foreach ($e in $executes) { From 5ab324b939ecb4012e0227ca6c4292b4ad469c16 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 16:42:43 +0200 Subject: [PATCH 24/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 46 +++++++++------------------- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 0a95603..bd132e5 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -27,13 +27,12 @@ jobs: executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) for w in "${webroots[@]}"; do for e in "${executes[@]}"; do - echo "Testing webroot=$w execute=$e" - result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" 2>&1) + echo "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" + ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" if [ $? -ne 0 ]; then - cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" platform="macos-latest" shell="bash" - echo -e "## Platform: $platform | Shell: $shell\n### $cmd\n\`\`\`\nFAILED: $w / $e\n$result\n\`\`\`\n" >> "$GITHUB_STEP_SUMMARY" + echo -e "## Platform: $platform | Shell: $shell\n### ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery\nFAILED: $w / $e\n" >> "$GITHUB_STEP_SUMMARY" fi done done @@ -59,13 +58,12 @@ jobs: executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) for w in "${webroots[@]}"; do for e in "${executes[@]}"; do - echo "Testing webroot=$w execute=$e" - result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" 2>&1) + echo "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" + ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" if [ $? -ne 0 ]; then - cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" platform="ubuntu-latest" shell="bash" - echo -e "## Platform: $platform | Shell: $shell\n### $cmd\n\`\`\`\nFAILED: $w / $e\n$result\n\`\`\`\n" >> "$GITHUB_STEP_SUMMARY" + echo -e "## Platform: $platform | Shell: $shell\n### ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery\nFAILED: $w / $e\n" >> "$GITHUB_STEP_SUMMARY" fi done done @@ -91,16 +89,13 @@ jobs: set executes=index.cfm,test.cfm,sub/test.cfm for %%w in (%webroots%) do ( for %%e in (%executes%) do ( - echo Testing webroot=%%w execute=%%e - ant -buildfile build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% > result.txt 2>&1 + echo ant -buildfile build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + ant -buildfile build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( set cmd=ant -buildfile build.xml -Dwebroot=%%w -Dexecute="%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% echo ### %cmd%>> %GITHUB_STEP_SUMMARY% - echo "```" >> %GITHUB_STEP_SUMMARY% echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% - type result.txt >> %GITHUB_STEP_SUMMARY% - echo "```" >> %GITHUB_STEP_SUMMARY% echo.>> %GITHUB_STEP_SUMMARY% ) ) @@ -126,18 +121,11 @@ jobs: $executes = @('index.cfm', 'test.cfm', 'sub/test.cfm') foreach ($w in $webroots) { foreach ($e in $executes) { - Write-Host "Testing webroot=$w execute=$e" $luceeVersionQuery = $env:LUCEE_VERSION_QUERY - $antArgs = @( - '-buildfile', 'build.xml', - "-Dwebroot=$w", - "-Dexecute=$e", - '-DpreCleanup=false', - '-DpostCleanup=false', - "-DluceeVersionQuery=$luceeVersionQuery" - ) - Write-Host "CMD: ant $($antArgs -join ' ')" - $result = & ant @antArgs 2>&1 + $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" + Write-Host $cmd + $LASTEXITCODE = 0 + iex $cmd if ($LASTEXITCODE -ne 0) { $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" $platform = "windows-latest" @@ -145,10 +133,7 @@ jobs: $summary = @() $summary += "## Platform: $platform | Shell: $shell" $summary += "### $cmd" - $summary += '```' $summary += "FAILED: $w / $e" - $summary += $result - $summary += '```' $summary -join "`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY } } @@ -175,13 +160,12 @@ jobs: executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) for w in "${webroots[@]}"; do for e in "${executes[@]}"; do - echo "Testing webroot=$w execute=$e" - result=$(ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" 2>&1) + echo "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" + ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" if [ $? -ne 0 ]; then - cmd="ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" platform="windows-latest" shell="bash" - echo -e "## Platform: $platform | Shell: $shell\n### $cmd\n\`\`\`\nFAILED: $w / $e\n$result\n\`\`\`\n" >> "$GITHUB_STEP_SUMMARY" + echo -e "## Platform: $platform | Shell: $shell\n### ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery\nFAILED: $w / $e\n" >> "$GITHUB_STEP_SUMMARY" fi done done From c1531bda4f5dfba7f4462a7b2900af242860a058 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 16:51:17 +0200 Subject: [PATCH 25/59] Update build.xml --- build.xml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/build.xml b/build.xml index f908ae2..2e290b0 100644 --- a/build.xml +++ b/build.xml @@ -202,18 +202,16 @@ - - - + + + - - + + - - - + @@ -247,8 +245,8 @@ - - + + From cdeb83c7d5b549a46c65e57513819a98af0a96ef Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 17:01:20 +0200 Subject: [PATCH 26/59] cleanup webroot tests --- .github/workflows/webroot-matrix.yml | 38 ++++++++++++++----------- {webroot => tests/webroot}/README.md | 4 +-- {webroot => tests/webroot}/index.cfm | 0 {webroot => tests/webroot}/sub/test.cfm | 0 {webroot => tests/webroot}/test.cfm | 0 5 files changed, 24 insertions(+), 18 deletions(-) rename {webroot => tests/webroot}/README.md (72%) rename {webroot => tests/webroot}/index.cfm (100%) rename {webroot => tests/webroot}/sub/test.cfm (100%) rename {webroot => tests/webroot}/test.cfm (100%) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index bd132e5..2729035 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -21,23 +21,25 @@ jobs: shell: bash env: LUCEE_VERSION_QUERY: 7/all/zero + working-directory: ${{ github.workspace }}/tests/webroot run: | luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" - webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" ) + webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/tests/webroot" ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) - for w in "${webroots[@]}"; do + failed=0 + for w in "${webroots[@]}"; do for e in "${executes[@]}"; do echo "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" if [ $? -ne 0 ]; then + failed=1 platform="macos-latest" shell="bash" echo -e "## Platform: $platform | Shell: $shell\n### ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery\nFAILED: $w / $e\n" >> "$GITHUB_STEP_SUMMARY" fi done done - working-directory: ${{ github.workspace }} - + exit $failed ubuntu-bash: name: Ubuntu Bash runs-on: ubuntu-latest @@ -52,23 +54,25 @@ jobs: shell: bash env: LUCEE_VERSION_QUERY: 7/all/zero + working-directory: ${{ github.workspace }}/tests/webroot run: | luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" - webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" ) + webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/tests/webroot" ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) - for w in "${webroots[@]}"; do + failed=0 + for w in "${webroots[@]}"; do for e in "${executes[@]}"; do echo "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" if [ $? -ne 0 ]; then + failed=1 platform="ubuntu-latest" shell="bash" echo -e "## Platform: $platform | Shell: $shell\n### ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery\nFAILED: $w / $e\n" >> "$GITHUB_STEP_SUMMARY" fi done done - working-directory: ${{ github.workspace }} - + exit $failed windows-cmd: name: Windows CMD @@ -84,8 +88,9 @@ jobs: shell: cmd env: LUCEE_VERSION_QUERY: 7/all/zero + working-directory: ${{ github.workspace }}/tests/webroot run: | - set webroots=.,./webroot,webroot,${{ github.workspace }}\webroot + set webroots=.,./webroot,webroot,${{ github.workspace }}\tests\webroot set executes=index.cfm,test.cfm,sub/test.cfm for %%w in (%webroots%) do ( for %%e in (%executes%) do ( @@ -100,7 +105,6 @@ jobs: ) ) ) - working-directory: ${{ github.workspace }} windows-pwsh: name: Windows PowerShell @@ -116,8 +120,9 @@ jobs: shell: pwsh env: LUCEE_VERSION_QUERY: 7/all/zero + working-directory: ${{ github.workspace }}/tests/webroot run: | - $webroots = @('.', './webroot', 'webroot', "${{ github.workspace }}\webroot") + $webroots = @('.', './webroot', 'webroot', "${{ github.workspace }}\tests\webroot") $executes = @('index.cfm', 'test.cfm', 'sub/test.cfm') foreach ($w in $webroots) { foreach ($e in $executes) { @@ -138,8 +143,6 @@ jobs: } } } - working-directory: ${{ github.workspace }} - windows-bash: name: Windows Bash runs-on: windows-latest @@ -154,19 +157,22 @@ jobs: shell: bash env: LUCEE_VERSION_QUERY: 7/all/zero + working-directory: ${{ github.workspace }}/tests/webroot run: | luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" - webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/webroot" ) + webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/tests/webroot" ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) - for w in "${webroots[@]}"; do + failed=0 + for w in "${webroots[@]}"; do for e in "${executes[@]}"; do echo "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" if [ $? -ne 0 ]; then + failed=1 platform="windows-latest" shell="bash" echo -e "## Platform: $platform | Shell: $shell\n### ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery\nFAILED: $w / $e\n" >> "$GITHUB_STEP_SUMMARY" fi done done - working-directory: ${{ github.workspace }} + exit $failed diff --git a/webroot/README.md b/tests/webroot/README.md similarity index 72% rename from webroot/README.md rename to tests/webroot/README.md index 8dfac26..ade0f15 100644 --- a/webroot/README.md +++ b/tests/webroot/README.md @@ -5,8 +5,8 @@ This folder contains test CFML scripts for verifying webroot and execute argumen ## Rules and What We Are Testing - All scripts in this folder are used by automated tests to ensure that: - - The `-Dwebroot` argument (relative or absolute, quoted or unquoted) is always normalized and used correctly. - - The `-Dexecute` argument (relative to webroot, with or without subfolders) is resolved and executed as expected. + - The `-Dwebroot` argument (relative or absolute, quoted or unquoted) is always normalized and used correctly. + - The `-Dexecute` argument (relative to webroot, with or without subfolders) is resolved and executed as expected. - The `index.cfm` and `test.cfm` scripts are for basic webroot resolution. - The `sub/test.cfm` script is for testing relative execute paths within a subfolder. - Output from these scripts is checked in CI to confirm correct path resolution and script execution. diff --git a/webroot/index.cfm b/tests/webroot/index.cfm similarity index 100% rename from webroot/index.cfm rename to tests/webroot/index.cfm diff --git a/webroot/sub/test.cfm b/tests/webroot/sub/test.cfm similarity index 100% rename from webroot/sub/test.cfm rename to tests/webroot/sub/test.cfm diff --git a/webroot/test.cfm b/tests/webroot/test.cfm similarity index 100% rename from webroot/test.cfm rename to tests/webroot/test.cfm From 977617145e88060ed57bfd13f82a4e122125b68e Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 17:04:09 +0200 Subject: [PATCH 27/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 2729035..6bdfa12 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -24,13 +24,13 @@ jobs: working-directory: ${{ github.workspace }}/tests/webroot run: | luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" - webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/tests/webroot" ) + webroots=( '.' "${{ github.workspace }}/tests/webroot" ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) failed=0 for w in "${webroots[@]}"; do for e in "${executes[@]}"; do - echo "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" - ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" + echo "ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" + ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" if [ $? -ne 0 ]; then failed=1 platform="macos-latest" @@ -57,13 +57,13 @@ jobs: working-directory: ${{ github.workspace }}/tests/webroot run: | luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" - webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/tests/webroot" ) + webroots=( '.' "${{ github.workspace }}/tests/webroot" ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) failed=0 for w in "${webroots[@]}"; do for e in "${executes[@]}"; do - echo "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" - ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" + echo "ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" + ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" if [ $? -ne 0 ]; then failed=1 platform="ubuntu-latest" @@ -90,12 +90,12 @@ jobs: LUCEE_VERSION_QUERY: 7/all/zero working-directory: ${{ github.workspace }}/tests/webroot run: | - set webroots=.,./webroot,webroot,${{ github.workspace }}\tests\webroot + set webroots=.,${{ github.workspace }}\tests\webroot set executes=index.cfm,test.cfm,sub/test.cfm for %%w in (%webroots%) do ( for %%e in (%executes%) do ( - echo ant -buildfile build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - ant -buildfile build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + echo ant -buildfile ..\..\build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + ant -buildfile ..\..\build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( set cmd=ant -buildfile build.xml -Dwebroot=%%w -Dexecute="%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% @@ -122,17 +122,17 @@ jobs: LUCEE_VERSION_QUERY: 7/all/zero working-directory: ${{ github.workspace }}/tests/webroot run: | - $webroots = @('.', './webroot', 'webroot', "${{ github.workspace }}\tests\webroot") + $webroots = @('.', "${{ github.workspace }}\tests\webroot") $executes = @('index.cfm', 'test.cfm', 'sub/test.cfm') foreach ($w in $webroots) { foreach ($e in $executes) { $luceeVersionQuery = $env:LUCEE_VERSION_QUERY - $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" + $cmd = "ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" Write-Host $cmd $LASTEXITCODE = 0 iex $cmd if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile build.xml -Dwebroot=$w -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" + $cmd = "ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" $platform = "windows-latest" $shell = "pwsh" $summary = @() @@ -160,13 +160,13 @@ jobs: working-directory: ${{ github.workspace }}/tests/webroot run: | luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" - webroots=( '.' './webroot' 'webroot' "${{ github.workspace }}/tests/webroot" ) + webroots=( '.' "${{ github.workspace }}/tests/webroot" ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) failed=0 for w in "${webroots[@]}"; do for e in "${executes[@]}"; do - echo "ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" - ant -buildfile build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" + echo "ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" + ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute="$e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery="$luceeVersionQuery" if [ $? -ne 0 ]; then failed=1 platform="windows-latest" From e28feb7112123b0538207286006e8b7419406e2e Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 17:10:56 +0200 Subject: [PATCH 28/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 6bdfa12..d51ba0f 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -24,6 +24,7 @@ jobs: working-directory: ${{ github.workspace }}/tests/webroot run: | luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" + pwd webroots=( '.' "${{ github.workspace }}/tests/webroot" ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) failed=0 @@ -35,7 +36,7 @@ jobs: failed=1 platform="macos-latest" shell="bash" - echo -e "## Platform: $platform | Shell: $shell\n### ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery\nFAILED: $w / $e\n" >> "$GITHUB_STEP_SUMMARY" + echo -e "## Platform: $platform | Shell: $shell\n(pwd): $(pwd)\n### ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery\nFAILED: $w / $e\n" >> "$GITHUB_STEP_SUMMARY" fi done done @@ -57,6 +58,7 @@ jobs: working-directory: ${{ github.workspace }}/tests/webroot run: | luceeVersionQuery="${LUCEE_VERSION_QUERY:-7/all/zero}" + pwd webroots=( '.' "${{ github.workspace }}/tests/webroot" ) executes=( 'index.cfm' 'test.cfm' 'sub/test.cfm' ) failed=0 @@ -68,7 +70,7 @@ jobs: failed=1 platform="ubuntu-latest" shell="bash" - echo -e "## Platform: $platform | Shell: $shell\n### ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery\nFAILED: $w / $e\n" >> "$GITHUB_STEP_SUMMARY" + echo -e "## Platform: $platform | Shell: $shell\n(pwd): $(pwd)\n### ant -buildfile build.xml -Dwebroot=$w -Dexecute=\"$e\" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery\nFAILED: $w / $e\n" >> "$GITHUB_STEP_SUMMARY" fi done done @@ -91,14 +93,17 @@ jobs: working-directory: ${{ github.workspace }}/tests/webroot run: | set webroots=.,${{ github.workspace }}\tests\webroot + cd set executes=index.cfm,test.cfm,sub/test.cfm for %%w in (%webroots%) do ( for %%e in (%executes%) do ( + echo ant -buildfile ..\..\build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% ant -buildfile ..\..\build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( set cmd=ant -buildfile build.xml -Dwebroot=%%w -Dexecute="%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% + echo (cd): %cd%>> %GITHUB_STEP_SUMMARY% echo ### %cmd%>> %GITHUB_STEP_SUMMARY% echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% echo.>> %GITHUB_STEP_SUMMARY% @@ -123,6 +128,7 @@ jobs: working-directory: ${{ github.workspace }}/tests/webroot run: | $webroots = @('.', "${{ github.workspace }}\tests\webroot") + pwd $executes = @('index.cfm', 'test.cfm', 'sub/test.cfm') foreach ($w in $webroots) { foreach ($e in $executes) { @@ -137,6 +143,7 @@ jobs: $shell = "pwsh" $summary = @() $summary += "## Platform: $platform | Shell: $shell" + $summary += "(pwd): $(pwd)" $summary += "### $cmd" $summary += "FAILED: $w / $e" $summary -join "`n" | Out-File -Append -FilePath $env:GITHUB_STEP_SUMMARY From 53f8628391eb116c61a0f80ac404f2e983e8f57c Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 17:14:57 +0200 Subject: [PATCH 29/59] Update build.xml --- build.xml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/build.xml b/build.xml index 2e290b0..2b913f3 100644 --- a/build.xml +++ b/build.xml @@ -30,9 +30,16 @@ - - - + + + + From e4eb50a7475a9e56b988fecfb5889599b2c8b8fd Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 17:30:04 +0200 Subject: [PATCH 30/59] Update build.xml --- build.xml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/build.xml b/build.xml index 2b913f3..a193767 100644 --- a/build.xml +++ b/build.xml @@ -30,16 +30,11 @@ - - - - + + + + + From cba70b62372a112e9833e4319b6b9795010598bc Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 17:32:53 +0200 Subject: [PATCH 31/59] Update build.xml --- build.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.xml b/build.xml index a193767..5665196 100644 --- a/build.xml +++ b/build.xml @@ -32,6 +32,9 @@ + + + From b2b24331ff31a2c94a0bf8b5929edfc6f3216112 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 17:37:11 +0200 Subject: [PATCH 32/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index d51ba0f..94603db 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -99,7 +99,7 @@ jobs: for %%e in (%executes%) do ( echo ant -buildfile ..\..\build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - ant -buildfile ..\..\build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + ant -v -buildfile ..\..\build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( set cmd=ant -buildfile build.xml -Dwebroot=%%w -Dexecute="%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% From 39dbd79959f562853fdd60ec36adef201c8f1c1f Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 18:08:09 +0200 Subject: [PATCH 33/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 94603db..9480d0c 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -98,7 +98,7 @@ jobs: for %%w in (%webroots%) do ( for %%e in (%executes%) do ( - echo ant -buildfile ..\..\build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + echo ant -buildfile ..\..\build.xml -Dwebroot="%%w" -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% ant -v -buildfile ..\..\build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( set cmd=ant -buildfile build.xml -Dwebroot=%%w -Dexecute="%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% @@ -133,7 +133,7 @@ jobs: foreach ($w in $webroots) { foreach ($e in $executes) { $luceeVersionQuery = $env:LUCEE_VERSION_QUERY - $cmd = "ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" + $cmd = "ant -buildfile ../../build.xml -Dwebroot=`"$w`" -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" Write-Host $cmd $LASTEXITCODE = 0 iex $cmd From 28a80f93812d5afbcbb796b9a5c1bb572efb04c3 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 18:10:47 +0200 Subject: [PATCH 34/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 9480d0c..b8a2bcb 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -98,7 +98,7 @@ jobs: for %%w in (%webroots%) do ( for %%e in (%executes%) do ( - echo ant -buildfile ..\..\build.xml -Dwebroot="%%w" -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + echo ant -buildfile=..\..\build.xml -Dwebroot="%%w" -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% ant -v -buildfile ..\..\build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( set cmd=ant -buildfile build.xml -Dwebroot=%%w -Dexecute="%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% @@ -133,7 +133,7 @@ jobs: foreach ($w in $webroots) { foreach ($e in $executes) { $luceeVersionQuery = $env:LUCEE_VERSION_QUERY - $cmd = "ant -buildfile ../../build.xml -Dwebroot=`"$w`" -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" + $cmd = "ant -buildfile=../../build.xml -Dwebroot=`"$w`" -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" Write-Host $cmd $LASTEXITCODE = 0 iex $cmd From 24205954e247178e20ba29c63c0fcd84b682f4d7 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 13 Sep 2025 18:12:48 +0200 Subject: [PATCH 35/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index b8a2bcb..e2720c6 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -99,9 +99,9 @@ jobs: for %%e in (%executes%) do ( echo ant -buildfile=..\..\build.xml -Dwebroot="%%w" -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - ant -v -buildfile ..\..\build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + ant -v -buildfile=..\..\build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( - set cmd=ant -buildfile build.xml -Dwebroot=%%w -Dexecute="%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + set cmd=ant -buildfile=build.xml -Dwebroot=%%w -Dexecute="%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% echo (cd): %cd%>> %GITHUB_STEP_SUMMARY% echo ### %cmd%>> %GITHUB_STEP_SUMMARY% @@ -138,7 +138,7 @@ jobs: $LASTEXITCODE = 0 iex $cmd if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile ../../build.xml -Dwebroot=$w -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" + $cmd = "ant -buildfile=../../build.xml -Dwebroot=$w -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" $platform = "windows-latest" $shell = "pwsh" $summary = @() From 2d1ab789e1abed1c685ab5c798d632b791541572 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 00:34:01 +0200 Subject: [PATCH 36/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index e2720c6..eeaab75 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -97,11 +97,10 @@ jobs: set executes=index.cfm,test.cfm,sub/test.cfm for %%w in (%webroots%) do ( for %%e in (%executes%) do ( - - echo ant -buildfile=..\..\build.xml -Dwebroot="%%w" -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - ant -v -buildfile=..\..\build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + echo ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( - set cmd=ant -buildfile=build.xml -Dwebroot=%%w -Dexecute="%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% echo (cd): %cd%>> %GITHUB_STEP_SUMMARY% echo ### %cmd%>> %GITHUB_STEP_SUMMARY% @@ -133,12 +132,12 @@ jobs: foreach ($w in $webroots) { foreach ($e in $executes) { $luceeVersionQuery = $env:LUCEE_VERSION_QUERY - $cmd = "ant -buildfile=../../build.xml -Dwebroot=`"$w`" -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" + $cmd = "ant -buildfile=../../build.xml `"-Dwebroot=$w`" `"-Dexecute=$e`" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" Write-Host $cmd $LASTEXITCODE = 0 iex $cmd if ($LASTEXITCODE -ne 0) { - $cmd = "ant -buildfile=../../build.xml -Dwebroot=$w -Dexecute=$e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" + $cmd = "ant -buildfile=../../build.xml `"-Dwebroot=$w`" `"-Dexecute=$e`" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=$luceeVersionQuery" $platform = "windows-latest" $shell = "pwsh" $summary = @() From 83dd095e6dcc66404718af78d966ad3b78001311 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 00:38:09 +0200 Subject: [PATCH 37/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index eeaab75..4693742 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -92,7 +92,7 @@ jobs: LUCEE_VERSION_QUERY: 7/all/zero working-directory: ${{ github.workspace }}/tests/webroot run: | - set webroots=.,${{ github.workspace }}\tests\webroot + set webroots=. "D:\a\script-runner\script-runner\tests\webroot" cd set executes=index.cfm,test.cfm,sub/test.cfm for %%w in (%webroots%) do ( From afaee4dacd89470c4b47ed53202c7f8c33e27338 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 00:42:38 +0200 Subject: [PATCH 38/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 4693742..2122373 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -92,8 +92,7 @@ jobs: LUCEE_VERSION_QUERY: 7/all/zero working-directory: ${{ github.workspace }}/tests/webroot run: | - set webroots=. "D:\a\script-runner\script-runner\tests\webroot" - cd + set webroots=.;D:\a\script-runner\script-runner\tests\webroot set executes=index.cfm,test.cfm,sub/test.cfm for %%w in (%webroots%) do ( for %%e in (%executes%) do ( From daa48b9559f0aec0c2e0934a6cbef58c2998bd3e Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 00:48:53 +0200 Subject: [PATCH 39/59] escape windows cmd webroots --- .github/workflows/webroot-matrix.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 2122373..a6ccd59 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -92,8 +92,10 @@ jobs: LUCEE_VERSION_QUERY: 7/all/zero working-directory: ${{ github.workspace }}/tests/webroot run: | - set webroots=.;D:\a\script-runner\script-runner\tests\webroot - set executes=index.cfm,test.cfm,sub/test.cfm + set webroots=.\ D:\\a\\script-runner\\script-runner\\tests\\webroot + set executes=index.cfm test.cfm sub/test.cfm + echo webroots=%webroots% + echo executes=%executes% for %%w in (%webroots%) do ( for %%e in (%executes%) do ( echo ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% From 5ec8e01bc1bb6e684f86010ab7cbef778da6dce3 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 00:52:35 +0200 Subject: [PATCH 40/59] fall back on repeating --- .github/workflows/webroot-matrix.yml | 39 +++++++++++++++++++--------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index a6ccd59..8c8ea79 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -96,20 +96,35 @@ jobs: set executes=index.cfm test.cfm sub/test.cfm echo webroots=%webroots% echo executes=%executes% - for %%w in (%webroots%) do ( - for %%e in (%executes%) do ( - echo ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - if errorlevel 1 ( - set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% - echo (cd): %cd%>> %GITHUB_STEP_SUMMARY% - echo ### %cmd%>> %GITHUB_STEP_SUMMARY% - echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% - echo.>> %GITHUB_STEP_SUMMARY% + cd + for %%w in (.) do ( + for %%e in (index.cfm test.cfm sub/test.cfm) do ( + echo ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + if errorlevel 1 ( + set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% + echo (cd): %cd%>> %GITHUB_STEP_SUMMARY% + echo ### %cmd%>> %GITHUB_STEP_SUMMARY% + echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% + echo.>> %GITHUB_STEP_SUMMARY% + ) + ) + ) + for %%w in ("D:\a\script-runner\script-runner\tests\webroot") do ( + for %%e in (index.cfm test.cfm sub/test.cfm) do ( + echo ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + if errorlevel 1 ( + set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% + echo (cd): %cd%>> %GITHUB_STEP_SUMMARY% + echo ### %cmd%>> %GITHUB_STEP_SUMMARY% + echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% + echo.>> %GITHUB_STEP_SUMMARY% + ) ) ) - ) windows-pwsh: name: Windows PowerShell From 1dcabdfa77b717a04659dbb30a1ac48271da94b8 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 00:54:46 +0200 Subject: [PATCH 41/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 41 +++++++++------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 8c8ea79..5022c56 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -92,39 +92,24 @@ jobs: LUCEE_VERSION_QUERY: 7/all/zero working-directory: ${{ github.workspace }}/tests/webroot run: | - set webroots=.\ D:\\a\\script-runner\\script-runner\\tests\\webroot + set webroots=""." "D:\a\script-runner\script-runner\tests\webroot" set executes=index.cfm test.cfm sub/test.cfm echo webroots=%webroots% echo executes=%executes% - cd - for %%w in (.) do ( - for %%e in (index.cfm test.cfm sub/test.cfm) do ( - echo ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - if errorlevel 1 ( - set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% - echo (cd): %cd%>> %GITHUB_STEP_SUMMARY% - echo ### %cmd%>> %GITHUB_STEP_SUMMARY% - echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% - echo.>> %GITHUB_STEP_SUMMARY% - ) - ) - ) - for %%w in ("D:\a\script-runner\script-runner\tests\webroot") do ( - for %%e in (index.cfm test.cfm sub/test.cfm) do ( - echo ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - if errorlevel 1 ( - set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% - echo (cd): %cd%>> %GITHUB_STEP_SUMMARY% - echo ### %cmd%>> %GITHUB_STEP_SUMMARY% - echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% - echo.>> %GITHUB_STEP_SUMMARY% - ) + for %%w in (%webroots%) do ( + for %%e in (%executes%) do ( + echo ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + if errorlevel 1 ( + set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% + echo (cd): %cd%>> %GITHUB_STEP_SUMMARY% + echo ### %cmd%>> %GITHUB_STEP_SUMMARY% + echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% + echo.>> %GITHUB_STEP_SUMMARY% ) ) + ) windows-pwsh: name: Windows PowerShell From c6a67f8c6f4607d3c6f7d2fa110ac91b356d821e Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 00:55:14 +0200 Subject: [PATCH 42/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 5022c56..96d98c2 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -92,7 +92,7 @@ jobs: LUCEE_VERSION_QUERY: 7/all/zero working-directory: ${{ github.workspace }}/tests/webroot run: | - set webroots=""." "D:\a\script-runner\script-runner\tests\webroot" + set webroots="." "D:\a\script-runner\script-runner\tests\webroot" set executes=index.cfm test.cfm sub/test.cfm echo webroots=%webroots% echo executes=%executes% From 0b2f3fd14e9cf6a9d96a9cf6685b05ffb42b4ac8 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 00:55:33 +0200 Subject: [PATCH 43/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 96d98c2..e1ce0bf 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -92,7 +92,7 @@ jobs: LUCEE_VERSION_QUERY: 7/all/zero working-directory: ${{ github.workspace }}/tests/webroot run: | - set webroots="." "D:\a\script-runner\script-runner\tests\webroot" + set webroots="." set executes=index.cfm test.cfm sub/test.cfm echo webroots=%webroots% echo executes=%executes% From 3fd0d83798fdb9c73c69ab053cc993b2a5a28709 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 00:55:50 +0200 Subject: [PATCH 44/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index e1ce0bf..657955c 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -92,7 +92,7 @@ jobs: LUCEE_VERSION_QUERY: 7/all/zero working-directory: ${{ github.workspace }}/tests/webroot run: | - set webroots="." + set webroots="D:\a\script-runner\script-runner\tests\webroot" set executes=index.cfm test.cfm sub/test.cfm echo webroots=%webroots% echo executes=%executes% From c0032489fe073c80a6b0cac2e4e747e577b77ba6 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 01:01:05 +0200 Subject: [PATCH 45/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 657955c..8d4f2d3 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -92,7 +92,8 @@ jobs: LUCEE_VERSION_QUERY: 7/all/zero working-directory: ${{ github.workspace }}/tests/webroot run: | - set webroots="D:\a\script-runner\script-runner\tests\webroot" + setlocal enabledelayedexpansion + set webroots="." "D:\a\script-runner\script-runner\tests\webroot" set executes=index.cfm test.cfm sub/test.cfm echo webroots=%webroots% echo executes=%executes% From f7af627792d43f8df388f79dccafa6bb92d4d0d6 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 01:02:59 +0200 Subject: [PATCH 46/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 8d4f2d3..9a71f1b 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -93,12 +93,8 @@ jobs: working-directory: ${{ github.workspace }}/tests/webroot run: | setlocal enabledelayedexpansion - set webroots="." "D:\a\script-runner\script-runner\tests\webroot" - set executes=index.cfm test.cfm sub/test.cfm - echo webroots=%webroots% - echo executes=%executes% - for %%w in (%webroots%) do ( - for %%e in (%executes%) do ( + for %%w in (. D:\a\script-runner\script-runner\tests\webroot) do ( + for %%e in (index.cfm test.cfm sub/test.cfm) do ( echo ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( From 9410f4caaf1575411d2a53da819aa2bc426270a3 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 01:21:32 +0200 Subject: [PATCH 47/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 36 ++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 9a71f1b..59cf546 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -92,22 +92,44 @@ jobs: LUCEE_VERSION_QUERY: 7/all/zero working-directory: ${{ github.workspace }}/tests/webroot run: | + @echo off + echo starting full matrix test setlocal enabledelayedexpansion - for %%w in (. D:\a\script-runner\script-runner\tests\webroot) do ( + echo before first for loop (relative) + for %%w in (.) do ( + echo inside first for loop: %%w for %%e in (index.cfm test.cfm sub/test.cfm) do ( - echo ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + echo inside inner for loop: %%e ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( + echo inside if errorlevel block set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% - echo (cd): %cd%>> %GITHUB_STEP_SUMMARY% - echo ### %cmd%>> %GITHUB_STEP_SUMMARY% - echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% - echo.>> %GITHUB_STEP_SUMMARY% + echo FAILED: %%w / %%e: !cmd!>> test-failures.txt ) + echo after if errorlevel block ) + echo after inner for loop ) + echo after first for loop + echo before second for loop (absolute) + for %%w in ("D:\work\script-runner\tests\webroot") do ( + echo inside second for loop: %%w + for %%e in (index.cfm test.cfm sub/test.cfm) do ( + echo inside inner for loop: %%e + ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + if errorlevel 1 ( + echo inside if errorlevel block + set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + echo FAILED: %%w / %%e: !cmd!>> test-failures.txt + ) + echo after if errorlevel block + ) + echo after inner for loop + ) + echo after second for loop + endlocal + echo finished full matrix test windows-pwsh: name: Windows PowerShell runs-on: windows-latest From 0f8020aaee10915f1cdf052d2f4456d9294c546f Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 01:25:59 +0200 Subject: [PATCH 48/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 29 +++++++--------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 59cf546..24d7510 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -92,44 +92,29 @@ jobs: LUCEE_VERSION_QUERY: 7/all/zero working-directory: ${{ github.workspace }}/tests/webroot run: | - @echo off - echo starting full matrix test setlocal enabledelayedexpansion - echo before first for loop (relative) for %%w in (.) do ( - echo inside first for loop: %%w for %%e in (index.cfm test.cfm sub/test.cfm) do ( - echo inside inner for loop: %%e - ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + ant -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( - echo inside if errorlevel block set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - echo FAILED: %%w / %%e: !cmd!>> test-failures.txt + echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% + echo (cd): %cd%>> %GITHUB_STEP_SUMMARY% + echo ### %cmd%>> %GITHUB_STEP_SUMMARY% + echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% + echo.>> %GITHUB_STEP_SUMMARY% ) - echo after if errorlevel block ) - echo after inner for loop ) - echo after first for loop - - echo before second for loop (absolute) for %%w in ("D:\work\script-runner\tests\webroot") do ( - echo inside second for loop: %%w for %%e in (index.cfm test.cfm sub/test.cfm) do ( - echo inside inner for loop: %%e - ant -v -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + ant -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( - echo inside if errorlevel block set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - echo FAILED: %%w / %%e: !cmd!>> test-failures.txt ) - echo after if errorlevel block ) - echo after inner for loop ) - echo after second for loop endlocal - echo finished full matrix test windows-pwsh: name: Windows PowerShell runs-on: windows-latest From 4d536e581f7d82da67e2817604c339113a8d6883 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 01:28:02 +0200 Subject: [PATCH 49/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 24d7510..e841dc2 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -92,29 +92,44 @@ jobs: LUCEE_VERSION_QUERY: 7/all/zero working-directory: ${{ github.workspace }}/tests/webroot run: | + @echo off + echo starting full matrix test setlocal enabledelayedexpansion + echo before first for loop (relative) for %%w in (.) do ( + echo inside first for loop: %%w for %%e in (index.cfm test.cfm sub/test.cfm) do ( + echo inside inner for loop: %%e ant -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( + echo inside if errorlevel block set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% - echo (cd): %cd%>> %GITHUB_STEP_SUMMARY% - echo ### %cmd%>> %GITHUB_STEP_SUMMARY% - echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% - echo.>> %GITHUB_STEP_SUMMARY% + echo FAILED: %%w / %%e: !cmd!>> test-failures.txt ) + echo after if errorlevel block ) + echo after inner for loop ) + echo after first for loop + + echo before second for loop (absolute) for %%w in ("D:\work\script-runner\tests\webroot") do ( + echo inside second for loop: %%w for %%e in (index.cfm test.cfm sub/test.cfm) do ( + echo inside inner for loop: %%e ant -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( + echo inside if errorlevel block set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + echo FAILED: %%w / %%e: !cmd!>> test-failures.txt ) + echo after if errorlevel block ) + echo after inner for loop ) + echo after second for loop endlocal + echo finished full matrix test windows-pwsh: name: Windows PowerShell runs-on: windows-latest From c6a1c0607133008db88117aa47739e4e696c49ce Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 01:29:08 +0200 Subject: [PATCH 50/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index e841dc2..2612c86 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -104,7 +104,11 @@ jobs: if errorlevel 1 ( echo inside if errorlevel block set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - echo FAILED: %%w / %%e: !cmd!>> test-failures.txt + echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% + echo (cd): %cd%>> %GITHUB_STEP_SUMMARY% + echo ### %cmd%>> %GITHUB_STEP_SUMMARY% + echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% + echo.>> %GITHUB_STEP_SUMMARY% ) echo after if errorlevel block ) From b178c8bcf904c000ecf4463a80d69329eb45cb7d Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 01:30:22 +0200 Subject: [PATCH 51/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 2612c86..0b4d7f2 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -105,10 +105,6 @@ jobs: echo inside if errorlevel block set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% - echo (cd): %cd%>> %GITHUB_STEP_SUMMARY% - echo ### %cmd%>> %GITHUB_STEP_SUMMARY% - echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% - echo.>> %GITHUB_STEP_SUMMARY% ) echo after if errorlevel block ) From 8d2af47d64eb97701b034db1ceb5fa28780e61a2 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 01:31:25 +0200 Subject: [PATCH 52/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 0b4d7f2..99f19c4 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -105,6 +105,9 @@ jobs: echo inside if errorlevel block set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% + echo (cd): %cd%>> %GITHUB_STEP_SUMMARY% + echo ### %cmd%>> %GITHUB_STEP_SUMMARY% + echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% ) echo after if errorlevel block ) From d4527a4fee07ed4e80a4b42903c4ee66fa27f000 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 01:32:39 +0200 Subject: [PATCH 53/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 99f19c4..54f641c 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -107,7 +107,6 @@ jobs: echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% echo (cd): %cd%>> %GITHUB_STEP_SUMMARY% echo ### %cmd%>> %GITHUB_STEP_SUMMARY% - echo FAILED: %%w / %%e:>> %GITHUB_STEP_SUMMARY% ) echo after if errorlevel block ) From 0c0a9329bf427d111c17221013e3af8f7b514201 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 01:34:09 +0200 Subject: [PATCH 54/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 54f641c..301bf64 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -104,9 +104,7 @@ jobs: if errorlevel 1 ( echo inside if errorlevel block set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - echo ## Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% - echo (cd): %cd%>> %GITHUB_STEP_SUMMARY% - echo ### %cmd%>> %GITHUB_STEP_SUMMARY% + echo ## FAILED Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% ) echo after if errorlevel block ) @@ -123,7 +121,7 @@ jobs: if errorlevel 1 ( echo inside if errorlevel block set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - echo FAILED: %%w / %%e: !cmd!>> test-failures.txt + echo ## FAILED: %%w / %%e: !cmd!>> %GITHUB_STEP_SUMMARY% ) echo after if errorlevel block ) From a4e68ac1524143c3d49128304ae99ac28b68f6b7 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 01:37:09 +0200 Subject: [PATCH 55/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index 301bf64..b534b25 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -93,43 +93,28 @@ jobs: working-directory: ${{ github.workspace }}/tests/webroot run: | @echo off - echo starting full matrix test setlocal enabledelayedexpansion - echo before first for loop (relative) for %%w in (.) do ( - echo inside first for loop: %%w for %%e in (index.cfm test.cfm sub/test.cfm) do ( - echo inside inner for loop: %%e ant -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( - echo inside if errorlevel block set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% echo ## FAILED Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% ) - echo after if errorlevel block ) - echo after inner for loop ) - echo after first for loop - echo before second for loop (absolute) for %%w in ("D:\work\script-runner\tests\webroot") do ( - echo inside second for loop: %%w for %%e in (index.cfm test.cfm sub/test.cfm) do ( - echo inside inner for loop: %%e ant -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( - echo inside if errorlevel block set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% echo ## FAILED: %%w / %%e: !cmd!>> %GITHUB_STEP_SUMMARY% ) - echo after if errorlevel block ) - echo after inner for loop ) - echo after second for loop + endlocal - echo finished full matrix test windows-pwsh: name: Windows PowerShell runs-on: windows-latest From 58c0000486bb3da4ad2c9a85056e996fdf23d1e4 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 01:44:20 +0200 Subject: [PATCH 56/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index b534b25..ce4bbd7 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -96,20 +96,26 @@ jobs: setlocal enabledelayedexpansion for %%w in (.) do ( for %%e in (index.cfm test.cfm sub/test.cfm) do ( + echo %%w / %%e ant -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( - set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - echo ## FAILED Platform: windows-latest ^| Shell: cmd>> %GITHUB_STEP_SUMMARY% + set cmd=ant -buildfile=build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + echo FAILED: %%w / %%e: !cmd!>> %GITHUB_STEP_SUMMARY% + echo(>> %GITHUB_STEP_SUMMARY% + exit /b 1 ) ) ) for %%w in ("D:\work\script-runner\tests\webroot") do ( for %%e in (index.cfm test.cfm sub/test.cfm) do ( + echo %%w / %%e ant -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( - set cmd=ant -buildfile=build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% - echo ## FAILED: %%w / %%e: !cmd!>> %GITHUB_STEP_SUMMARY% + set cmd=ant -buildfile=build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + echo FAILED: %%w / %%e: !cmd!>> %GITHUB_STEP_SUMMARY% + echo(>> %GITHUB_STEP_SUMMARY% + exit /b 1 ) ) ) From d115bc9a0f78f099391503f9d0795decc9c667bb Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 01:46:59 +0200 Subject: [PATCH 57/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 37 +++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index ce4bbd7..dffbd7d 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -12,6 +12,13 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- - name: Set up Java uses: actions/setup-java@v4 with: @@ -46,6 +53,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- - name: Set up Java uses: actions/setup-java@v4 with: @@ -81,6 +95,13 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- - name: Set up Java uses: actions/setup-java@v4 with: @@ -95,7 +116,7 @@ jobs: @echo off setlocal enabledelayedexpansion for %%w in (.) do ( - for %%e in (index.cfm test.cfm sub/test.cfm) do ( + for %%e in (index.cfm test.cfm sub\test.cfm) do ( echo %%w / %%e ant -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( @@ -126,6 +147,13 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- - name: Set up Java uses: actions/setup-java@v4 with: @@ -165,6 +193,13 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- - name: Set up Java uses: actions/setup-java@v4 with: From 369f90064f271a4360112787382b4e91dc529422 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sun, 14 Sep 2025 01:50:23 +0200 Subject: [PATCH 58/59] Update webroot-matrix.yml --- .github/workflows/webroot-matrix.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/webroot-matrix.yml b/.github/workflows/webroot-matrix.yml index dffbd7d..e8cd5de 100644 --- a/.github/workflows/webroot-matrix.yml +++ b/.github/workflows/webroot-matrix.yml @@ -127,11 +127,9 @@ jobs: ) ) ) - - for %%w in ("D:\work\script-runner\tests\webroot") do ( + for %%w in ("%GITHUB_WORKSPACE%\tests\webroot") do ( for %%e in (index.cfm test.cfm sub/test.cfm) do ( - echo %%w / %%e - ant -buildfile=..\..\build.xml "-Dwebroot=%%w" "-Dexecute=%%e" -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% + ant -buildfile=..\..\build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% if errorlevel 1 ( set cmd=ant -buildfile=build.xml -Dwebroot=%%w -Dexecute=%%e -DpreCleanup=false -DpostCleanup=false -DluceeVersionQuery=%LUCEE_VERSION_QUERY% echo FAILED: %%w / %%e: !cmd!>> %GITHUB_STEP_SUMMARY% From 65f6595e90d98ffa6e8532b552e1c7961c7d4c08 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Thu, 2 Oct 2025 15:28:32 +0200 Subject: [PATCH 59/59] add jfr support, cleanup readme, add examples --- EXAMPLES.md | 304 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 135 ++++++++++++++++------- build.xml | 54 +++++++--- 3 files changed, 440 insertions(+), 53 deletions(-) create mode 100644 EXAMPLES.md diff --git a/EXAMPLES.md b/EXAMPLES.md new file mode 100644 index 0000000..d0ab206 --- /dev/null +++ b/EXAMPLES.md @@ -0,0 +1,304 @@ +# Script Runner Examples + +Practical examples and use cases for the Lucee Script Runner. + +## Table of Contents + +- [Quick Start Examples](#quick-start-examples) +- [Shell-Specific Usage](#shell-specific-usage) +- [Java Flight Recorder (JFR) Profiling](#java-flight-recorder-jfr-profiling) +- [Concurrent Execution](#concurrent-execution) +- [Working Directory Examples](#working-directory-examples) +- [Testing Extensions](#testing-extensions) +- [CI/CD Integration](#cicd-integration) + +## Quick Start Examples + +### Running from Different Locations + +```bash +# From the script-runner directory (simple) +ant -Dwebroot="/path/to/your/project" -Dexecute="yourscript.cfm" + +# From your project directory (recommended for external projects) +ant -buildfile="/path/to/script-runner/build.xml" -Dwebroot="." -Dexecute="yourscript.cfm" + +# From any directory with absolute paths +ant -buildfile="C:\tools\script-runner\build.xml" -Dwebroot="C:\work\myproject" -Dexecute="test.cfm" + +# Execute a script below the webroot +ant -buildfile="C:\tools\script-runner\build.xml" -Dwebroot="C:\work\myproject" -Dexecute="extended/index.cfm" +``` + +### Testing Lucee Extensions + +```bash +# Testing Lucee Spreadsheet from its directory +cd D:\work\lucee-spreadsheet +ant -buildfile=D:\work\script-runner\build.xml -Dwebroot=. -Dexecute=/test/index.cfm + +# Testing with specific Lucee version +ant -buildfile=D:\work\script-runner\build.xml -DluceeVersionQuery=6.2/stable/jar -Dwebroot=D:\work\lucee-spreadsheet -Dexecute=/test/index.cfm + +# Testing with a locally built Lucee JAR (for Lucee developers) +ant -buildfile=D:\work\script-runner\build.xml -DluceeJar="D:\work\lucee\loader\target\lucee.jar" -Dwebroot=D:\work\lucee-spreadsheet -Dexecute=/test/index.cfm + +# With unique working directory for concurrent runs +ant -buildfile=D:\work\script-runner\build.xml -DuniqueWorkingDir=true -Dwebroot=D:\work\lucee-spreadsheet -Dexecute=/test/index.cfm +``` + +## Shell-Specific Usage + +### PowerShell + +Use double quotes for paths with spaces. Single quotes also work (especially in scripts to avoid variable expansion). + +```powershell +# No spaces in paths +ant -buildfile "C:\tools\script-runner\build.xml" -Dwebroot="C:\work\myproject" -Dexecute="test.cfm" + +# Paths with spaces +ant -buildfile "C:\tools\script-runner\build.xml" -Dwebroot="C:\work\my project" -Dexecute="test.cfm" -DuniqueWorkingDir=true + +# Using single quotes to avoid variable expansion in scripts +ant -buildfile='C:\tools\script-runner\build.xml' -Dwebroot='C:\work\project' -Dexecute='test.cfm' +``` + +### Command Prompt (Windows) + +Quotes are only needed if the path contains spaces. You can quote just the value or the entire parameter. + +```cmd +REM No spaces in paths (no quotes needed) +ant -buildfile=C:\tools\script-runner\build.xml -Dwebroot=C:\work\myproject -Dexecute=test.cfm -DuniqueWorkingDir=true + +REM Spaces in paths (quotes required) +ant -buildfile="C:\tools\script-runner\build.xml" -Dwebroot="C:\work\my project" -Dexecute="test.cfm" -DuniqueWorkingDir=true + +REM Or quote the entire parameter (especially useful in batch files) +ant "-buildfile=C:\Program Files\script-runner\build.xml" "-Dwebroot=C:\My Projects\test" -Dexecute=test.cfm +``` + +### Bash/WSL (Linux) + +Use forward slashes and Linux-style paths. Quotes only if the path has spaces. + +```bash +# No spaces in paths (no quotes needed) +ant -buildfile /mnt/d/work/script-runner/build.xml -Dwebroot=/mnt/d/work/myproject -Dexecute=test.cfm -DuniqueWorkingDir=true + +# Spaces in paths (quotes required) +ant -buildfile "/mnt/d/work/script-runner/build.xml" -Dwebroot="/mnt/d/work/my project" -Dexecute="test.cfm" -DuniqueWorkingDir=true +``` + +### Quick Reference Table + +| Shell | Example Command | +|--------------- |------------------------------------------------------------------------------------------------------------------| +| PowerShell | `ant -buildfile "C:\tools\script-runner\build.xml" -Dwebroot="C:\work\my project" -Dexecute="test.cfm" -DuniqueWorkingDir=true` | +| Command Prompt | `ant -buildfile=C:\tools\script-runner\build.xml -Dwebroot=C:\work\myproject -Dexecute=test.cfm -DuniqueWorkingDir=true` | +| Bash/WSL | `ant -buildfile /mnt/d/work/script-runner/build.xml -Dwebroot=/mnt/d/work/myproject -Dexecute=test.cfm -DuniqueWorkingDir=true` | + +**Key Points:** + +- **PowerShell:** Use double quotes for paths with spaces. Single quotes work too (good for avoiding variable expansion) +- **Command Prompt:** Quotes only if path has spaces. Can quote just the value or the whole parameter +- **Bash/WSL:** Use forward slashes. Quotes only if path has spaces. Don't use Windows backslashes or drive letters +- **Windows:** Never use trailing backslashes. Ever. +- **All shells:** Don't escape quotes unless you like pain +- **Debugging:** If Ant can't find your file, your path or quotes are wrong. Period. + +## Java Flight Recorder (JFR) Profiling + +Enable JFR to capture detailed performance data during script execution. + +### Basic JFR Usage + +```bash +ant -DFlightRecording=true -Dwebroot="." -Dexecute="yourscript.cfm" +``` + +### What JFR Captures + +- Creates JFR recording files in `logs/{timestamp}-j{java.version}.jfr` +- Captures CPU usage, memory allocation, garbage collection, thread activity +- Settings: disk=true, dumponexit=true, maxsize=1024m, maxage=1d, settings=profile, path-to-gc-roots=true, stackdepth=128 + +### Custom JFR Output Path + +```bash +ant -DFlightRecording=true -DFlightRecordingFilename="D:/my-logs/custom.jfr" -Dwebroot="." -Dexecute="yourscript.cfm" +``` + +### JFR API Access for Lucee + +If you need Lucee to access JFR APIs directly (not just record), add the JFR module exports: + +```bash +ant -DjfrExports=true -Dwebroot="." -Dexecute="yourscript.cfm" +``` + +This adds `--add-exports=jdk.jfr/jdk.jfr=ALL-UNNAMED` and `--add-opens=jdk.jfr/jdk.jfr=ALL-UNNAMED` to allow Lucee code to use the JFR API. + +### Analyzing JFR Files + +```bash +# Print summary +jfr print logs/250101-120530-j21.jfr + +# Print specific events +jfr print --events CPULoad,GarbageCollection logs/250101-120530-j21.jfr + +# Convert to JSON +jfr print --json logs/250101-120530-j21.jfr > output.json +``` + +The `jfr` command-line tool is included in the JDK bin directory. For visual analysis, use JDK Mission Control (JMC) or import into profiling tools. + +## Concurrent Execution + +Multiple script-runner instances can be run simultaneously using unique working directories. + +### Running Tests in Parallel + +```bash +# Run multiple instances concurrently +ant -DuniqueWorkingDir="true" -Dexecute="test1.cfm" & +ant -DuniqueWorkingDir="true" -Dexecute="test2.cfm" & +ant -DuniqueWorkingDir="true" -Dexecute="test3.cfm" & +wait +``` + +Each instance will use a unique working directory named `temp-unique/{VERSION}-{TIMESTAMP}-{RANDOM}` (timestamp format: `yyMMdd-HHmmss`) to prevent conflicts. + +## Working Directory Examples + +### Default Mode (Single Instance) + +```bash +# Uses temp/lucee - fast, but single instance only +ant -DuniqueWorkingDir=false -Dwebroot=. -Dexecute=test.cfm +``` + +### Auto-Unique Mode (Concurrent Execution) + +```bash +# Uses temp-unique/{VERSION}-{TIMESTAMP}-{RANDOM} +ant -DuniqueWorkingDir=true -Dwebroot=. -Dexecute=test.cfm +``` + +### Custom Path Mode + +```bash +# Uses your specified directory +ant -DuniqueWorkingDir=C:/fast/work -Dwebroot=. -Dexecute=test.cfm +``` + +### Preserving Working Directory for Inspection + +```bash +# Don't cleanup before or after - useful for debugging +ant -DpreCleanup=false -DpostCleanup=false -Dwebroot=. -Dexecute=test.cfm +``` + +## Testing Extensions + +### Testing a Built Extension + +```bash +# Install extension from dist/ directory and run tests +ant -buildfile=script-runner/build.xml \ + -DluceeVersion="6.2.2.91" \ + -Dwebroot="$BITBUCKET_CLONE_DIR/lucee/test" \ + -DextensionDir="$BITBUCKET_CLONE_DIR/dist" \ + -Dexecute="bootstrap-tests.cfm" \ + -DtestAdditional="$BITBUCKET_CLONE_DIR/tests" +``` + +### Testing with Debug Mode + +```bash +# Enable Java debugger on port 5000 +ant -Ddebugger=true -Dwebroot=. -Dexecute=test.cfm +``` + +Then connect your IDE debugger to `localhost:5000`. + +## CI/CD Integration + +### GitHub Actions + +```yaml +- name: Checkout Lucee + uses: actions/checkout@v2 + with: + repository: lucee/lucee + path: lucee + +- name: Cache Maven packages + uses: actions/cache@v3 + with: + path: ~/.m2 + key: lucee-script-runner-maven-cache + +- name: Cache Lucee files + uses: actions/cache@v3 + with: + path: _actions/lucee/script-runner/main/lucee-download-cache + key: lucee-downloads + +- name: Run Lucee Test Suite + uses: lucee/script-runner@main + with: + webroot: ${{ github.workspace }}/lucee/test + execute: bootstrap-tests.cfm + luceeVersion: ${{ env.luceeVersion }} + luceeVersionQuery: 5.4/stable/light # (optional, overrides luceeVersion) + luceeJar: /path/to/local/lucee.jar # (optional, overrides both luceeVersion and luceeVersionQuery) + extensions: # (optional list of extension guids to install) + extensionDir: ${{ github.workspace }}/dist # (for testing building an extension with CI) + antFlags: -d or -v etc # (optional, good for debugging any ant issues) + compile: true # (optional, compiles all the cfml under the webroot) + luceeCFConfig: /path/to/.CFConfig.json # pass in additional configuration + debugger: true # (optional) runs with java debugging enabled on port 5000 + preCleanup: true # (purges Lucee working directory before starting) + postCleanup: true # (purges Lucee working directory after finishing) + uniqueWorkingDir: true # (optional) uses unique working directory for concurrent execution + env: + testLabels: pdf + testAdditional: ${{ github.workspace }}/tests +``` + +[GitHub Action Workflow Example](https://github.com/lucee/extension-pdf/blob/master/.github/workflows/main.yml) + +This will: + +- Checkout a copy of the Lucee codebase +- Install any extension(s) (`*.lex`) found in `${{ github.workspace }}/dist` +- Run all tests with the label of "pdf" +- Run any additional tests found in the `/tests` directory of the current repository + +### BitBucket Pipeline + +```yaml +image: atlassian/default-image:3 + +pipelines: + default: + - step: + name: Build and Test + caches: + - maven + script: + - ant -noinput -verbose -buildfile build.xml + artifacts: + - dist/** + - step: + name: Checkout Lucee Script-runner, Lucee and run tests + script: + - git clone https://github.com/lucee/script-runner + - git clone https://github.com/lucee/lucee + - export testLabels="PDF" + - echo $testLabels + - ant -buildfile script-runner/build.xml -DluceeVersion="light-6.2.2.91" -Dwebroot="$BITBUCKET_CLONE_DIR/lucee/test" -DextensionDir="$BITBUCKET_CLONE_DIR/dist" -Dexecute="bootstrap-tests.cfm" -DtestAdditional="$BITBUCKET_CLONE_DIR/tests" +``` diff --git a/README.md b/README.md index 9b0448f..b44b654 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ ant -buildfile="C:\tools\script-runner\build.xml" -Dwebroot="C:\work\myproject" ``` **Key Points:** + - `-buildfile` specifies where script-runner is installed - `-Dwebroot` is the directory containing your CFML code (can be relative to current directory) - `-Dexecute` is the CFML script to run (relative to webroot) @@ -45,21 +46,95 @@ Default `ant` will run the `sample/index.cfm` file ![image](https://user-images.githubusercontent.com/426404/122402355-b0dbf980-cf7d-11eb-8837-37dec47d0713.png) -You can specify: - -- Lucee version `-DluceeVersion=` default `6.2.2.91`, (ie. 6.2.2.91, light-6.2.2.91, zero-6.2.2.91 ) -- Lucee version by query `-DluceeVersionQuery="5.4/stable/light` ( optional overrides luceeVersion, (version)/(stable/rc/snapshot)/(jar,light/zero) ) -- Local Lucee JAR `-DluceeJar="/full-path/to/lucee.jar"` (optional, overrides both luceeVersion and luceeVersionQuery, perfect for testing locally built JARs) -- Webroot `-Dwebroot=` (default `tests/`) on Windows, avoid a trailing \ as that is treated as an escape character causes script runner to fail -- CFML Script to run, `-Dexecute=` (default `index.cfm`) a relative path the webroot, no leading `/` is needed, some bash shells like git bash on windows get's confused and tries to expand that to a full path -- run script via include or _internalRequest (which runs the Application.cfc if present, default ) `-DexecuteScriptByInclude="true"` -- any extra extensions `-Dextensions=` (default ``) -- manual extension install (`*.lex`) from a directory `-DextensionDir=` (default ``) -- compile all cfml under webroot `-Dcompile="true"` -- pass in a full .CFConfig.json file `-DluceeCFConfig="/path/to/.CFConfig.json` -- use a java debugger `-Ddebugger="true"` opens a java debugging port 5000, with suspend=y -- preCleanup `-DpreCleanup="true"` purges the Lucee working dir before starting -- postCleanup `-DpostCleanup="true"` purges the Lucee working dir after finishing +### Parameters + +#### Lucee Version + +- `-DluceeVersion=` - Lucee version (default: `6.2.2.91`). Examples: `6.2.2.91`, `light-6.2.2.91`, `zero-6.2.2.91` +- `-DluceeVersionQuery=` - Query-based version (optional, overrides luceeVersion). Format: `(version)/(stable/rc/snapshot)/(jar/light/zero)`. Example: `5.4/stable/light` +- `-DluceeJar=` - Path to custom Lucee JAR (optional, overrides both luceeVersion and luceeVersionQuery). Example: `/full-path/to/lucee.jar` + +#### Paths and Execution + +- `-Dwebroot=` - Directory containing CFML code (default: `tests/`). On Windows, trailing backslashes (`\`) will be rejected with an error +- `-Dexecute=` - CFML script to run (default: `index.cfm`). Relative to webroot, no leading `/` needed +- `-DexecuteScriptByInclude=` - Use include instead of _internalRequest (default: false). Set to `true` to skip Application.cfc + +#### Extensions and Configuration + +- `-Dextensions=` - List of extension GUIDs to install (default: empty) +- `-DextensionDir=` - Directory containing manual extension files (`*.lex`) to install (default: empty) +- `-Dcompile=` - Compile all CFML under webroot (default: false). Set to `true` to enable +- `-DluceeCFConfig=` - Path to full .CFConfig.json file for additional Lucee configuration + +#### Working Directory + +Lucee deploys to a working directory, default is `temp/`. By default it clears the directory when it starts and finishes (unless it crashes and exits!). + +- `-DpreCleanup=` - Clear Lucee working directory before starting (default: true). Set to `false` to preserve +- `-DpostCleanup=` - Clear Lucee working directory after finishing (default: true). Set to `false` to preserve +- `-DuniqueWorkingDir=` - Working directory mode: + - `false` (default): Uses `temp/lucee`. One run at a time. Fast, but not for parallel jobs + - `true`: Uses `temp-unique/{VERSION}-{TIMESTAMP}-{RANDOM}` (timestamp: `yyMMdd-HHmmss`). Enables concurrent execution + - `/custom/path`: Uses your specified directory. You're on your own for cleanup and collisions + +These options are good for inspecting after a run, or setting up the `/lucee-server/context` dir with `password.txt` or `.CFConfig.json`. + +#### Debugging and Profiling + +- `-Ddebugger=` - Enable Java debugger on port 5000 with suspend=y (default: false) +- `-DFlightRecording=` - Enable Java Flight Recorder profiling (default: false). Saves `.jfr` files to `logs/` directory +- `-DFlightRecordingFilename=` - Custom output path for JFR recording file +- `-DjfrExports=` - Add JFR module exports for Lucee JFR API access (default: false) + +### Java Flight Recorder (JFR) Profiling + +Enable JFR to capture detailed performance data during script execution: + +- Java Flight Recorder `-DFlightRecording="true"` enables JFR profiling, saves .jfr files to `logs/` directory +- JFR module access `-DjfrExports="true"` adds `--add-exports` and `--add-opens` for `jdk.jfr` module (for Lucee JFR API access) +- Custom JFR filename `-DFlightRecordingFilename="/path/to/output.jfr"` specify custom output path for JFR recording + +```bash +ant -DFlightRecording=true -Dwebroot="." -Dexecute="yourscript.cfm" +``` + +**What it does:** + +- Creates JFR recording files in `logs/{timestamp}-j{java.version}.jfr` +- Captures CPU usage, memory allocation, garbage collection, thread activity +- Settings: disk=true, dumponexit=true, maxsize=1024m, maxage=1d, settings=profile, path-to-gc-roots=true, stackdepth=128 + +**Custom JFR output path:** + +```bash +ant -DFlightRecording=true -DFlightRecordingFilename="D:/my-logs/custom.jfr" -Dwebroot="." -Dexecute="yourscript.cfm" +``` + +**JFR API access for Lucee:** + +If you need Lucee to access JFR APIs directly (not just record), add the JFR module exports: + +```bash +ant -DjfrExports=true -Dwebroot="." -Dexecute="yourscript.cfm" +``` + +This adds `--add-exports=jdk.jfr/jdk.jfr=ALL-UNNAMED` and `--add-opens=jdk.jfr/jdk.jfr=ALL-UNNAMED` to allow Lucee code to use the JFR API. + +**Analyzing JFR files:** + +```bash +# Print summary +jfr print logs/250101-120530-j21.jfr + +# Print specific events +jfr print --events CPULoad,GarbageCollection logs/250101-120530-j21.jfr + +# Convert to JSON +jfr print --json logs/250101-120530-j21.jfr > output.json +``` + +The `jfr` command-line tool is included in the JDK bin directory. For visual analysis, use JDK Mission Control (JMC) or import into profiling tools. ### TL;DR: Quoting & Paths (Stop Overthinking It) @@ -86,12 +161,6 @@ You can specify: --- -### uniqueWorkingDir: What Actually Happens - -- `false` (default): Uses `temp/lucee`. One run at a time. Fast, but not for parallel jobs. -- `true`: Uses `temp-unique/{VERSION}-{TIMESTAMP}-{RANDOM}` (timestamp: `yyMMdd-HHmmss`). Lets you run as many jobs as you want, at the same time, without collisions. -- `/custom/path`: Uses your directory. You’re on your own for cleanup and collisions. - **Pro tip:** If you don’t know what you want, use `true` for CI or parallel runs, `false` for local dev. @@ -233,27 +302,16 @@ systemOutput(serializeJSON(myData, "struct"), true); ### Common Issues on Windows -**Problem**: Build fails with path-related errors -**Solution**: Avoid trailing backslashes in webroot paths: -```bash - -# ❌ Wrong - trailing backslash causes escape issues -ant -Dwebroot="C:\work\myproject\" - -# ✅ Correct - no trailing backslash -ant -Dwebroot="C:\work\myproject" -ant -Dwebroot="C:/work/myproject/" # Forward slashes work too -``` - **Problem**: "Could not locate build file" from other directories **Solution**: Use absolute path to build.xml: ```bash +# ✅ Correct - specify script-runner location +ant -buildfile="C:\tools\script-runner\build.xml" -Dwebroot="." -Dexecute="test.cfm" + # ❌ Wrong - looking for build.xml in current directory ant -Dwebroot="." -Dexecute="/test.cfm" -# ✅ Correct - specify script-runner location -ant -buildfile="C:\tools\script-runner\build.xml" -Dwebroot="." -Dexecute="test.cfm" ``` **Problem**: "File not found" for CFML scripts @@ -268,9 +326,6 @@ ant -buildfile="/path/to/script-runner/build.xml" -Dwebroot="/your/project" -Dex **Solution**: Use proper quote formatting for Windows command line: ```bash -# ❌ Wrong - excessive escaping or nested quotes -ant -buildfile=\"d:\work\script-runner\" -Dwebroot=\"D:\work\project\" - # ✅ Correct - Windows Command Prompt (no quotes needed for paths without spaces) ant -buildfile=d:\work\script-runner\build.xml -Dwebroot=D:\work\project -Dexecute=test.cfm @@ -279,6 +334,10 @@ ant "-buildfile=C:\Program Files\script-runner\build.xml" "-Dwebroot=C:\My Proje # ✅ Correct - PowerShell (use single quotes to avoid variable expansion) ant -buildfile='d:\work\script-runner\build.xml' -Dwebroot='D:\work\project' -Dexecute='test.cfm' + +# ❌ Wrong - excessive escaping or nested quotes +ant -buildfile=\"d:\work\script-runner\" -Dwebroot=\"D:\work\project\" + ``` diff --git a/build.xml b/build.xml index 5665196..91e6a0a 100644 --- a/build.xml +++ b/build.xml @@ -24,20 +24,26 @@ + + + + + + - - - - - - - - + + + + + + + + @@ -63,6 +69,14 @@ + + + + + + + + @@ -101,12 +115,7 @@ - - - - - - + @@ -247,8 +256,19 @@ + + + + + + + + + + + @@ -259,6 +279,7 @@ + @@ -306,8 +327,10 @@ - + + + @@ -326,6 +349,7 @@ ${errorOut} +