Skip to content

Commit 02260ac

Browse files
committed
adobe + boxlang support
1 parent 7189bf5 commit 02260ac

File tree

6 files changed

+81
-40
lines changed

6 files changed

+81
-40
lines changed

.github/copilot-instructions.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Copilot Instructions for AI Coding Agents — cbjavaloader
2+
3+
## What this project is
4+
5+
- A ColdBox module that embeds and exposes the JavaLoader library so CFML apps can dynamically load/compile Java classes and JARs.
6+
- Key pieces: `ModuleConfig.cfc` (module settings & DSL registration), `models/Loader.cfc` (public module API), `models/javaloader/` (JavaLoader, JavaProxy, JavaCompiler implementations), and `test-harness/` (integration test app).
7+
8+
## Quick dev workflows (explicit)
9+
10+
- Install deps: run the CommandBox installer at repo root and for the test harness:
11+
```bash
12+
box install
13+
cd test-harness && box install
14+
```
15+
- Build module (packaging, docs):
16+
```bash
17+
box task run taskFile=build/Build.cfc :projectName=`package show slug` :version=`package show version`
18+
```
19+
- Run tests (TestBox via provided VS Code tasks or CLI):
20+
```bash
21+
box testbox run bundles=test-harness/tests --!recurse
22+
# or use the workspace VS Code task "Run TestBox Bundle"
23+
```
24+
25+
## Project-specific conventions & patterns
26+
27+
- WireBox DSL: `ModuleConfig.cfc` registers a custom DSL `javaloader` via `wireBox.registerDSL(...)`. Use inject="javaloader:ClassName" for DSL injections.
28+
- Main WireBox mappings: `binder.map("jl@cbjavaloader")` (internal JavaLoader) and `loader@cbjavaloader` (public module proxy, see `models/Loader.cfc`). Use `getWireBox().getInstance("loader@cbjavaloader")` in tests or handlers.
29+
- Persistent loader instance: `models/Loader.cfc` stores the JavaLoader instance in `server` scope under a hashed static key and uses `lock` for safe init/re-init — avoid re-instantiating directly; call `Loader.setup(moduleSettings)` or `Loader.getJavaLoader()`.
30+
- Java compilation: `models/javaloader/JavaCompiler.cfc` expects a JVM `tools.jar` compiler on the classpath; compiled jars are placed by default in `models/javaloader/tmp` (see module `settings.compileDirectory`).
31+
32+
## Important files to consult (fast path)
33+
34+
- `ModuleConfig.cfc` — module settings defaults and DSL registration.
35+
- `models/Loader.cfc` — public API that other apps use (`create`, `appendPath`, `getLoadedURLs`).
36+
- `models/javaloader/JavaLoader.cfc` — upstream JavaLoader implementation (large file, primary behavior).
37+
- `models/javaloader/JavaCompiler.cfc` — dynamic compilation logic and compiler discovery.
38+
- `build/Build.cfc` and `box.json` — packaging, test runner URL and build scripts used by CI.
39+
- `test-harness/` — runnable ColdBox app for integration tests; `test-harness/tests/specs/LoaderTest.cfc` shows expected behavior usage.
40+
41+
## Integration points & external dependencies
42+
43+
- JARs bundled under `models/javaloader/lib/` and `models/javaloader/support/*/lib/`; additional jars for testing live in `test-harness/jars/`.
44+
- The module relies on CommandBox and TestBox for build/test automation. CI uses `.github/workflows/*` (see repo root).
45+
46+
## Safety, edge cases, and constraints agents must respect
47+
48+
- Do not remove or replace the `server`-scoped loader without using the `Loader` API — other code/tests expect the single instance.
49+
- Java compilation may fail when the JVM compiler is not available; surface clear errors and point to `JavaCompiler.cfc` and `tools.jar` classpath as remediation.
50+
51+
## Examples (from repo)
52+
53+
- Injecting via DSL (see README & examples):
54+
```cfml
55+
property name="hello" inject="javaloader:HelloWorld";
56+
// or via WireBox mapping
57+
property name="javaloader" inject="loader@cbjavaloader";
58+
```
59+
- Module settings (place in your app `ColdBox.cfc` under `moduleSettings.cbJavaLoader`): see `ModuleConfig.cfc` for keys like `loadPaths`, `sourceDirectories`, `compileDirectory`, `trustedSource`.
60+
61+
## What to do next when editing code
62+
63+
- When changing public behavior in `Loader.cfc` or DSL registration in `ModuleConfig.cfc`, update `test-harness/tests/specs/LoaderTest.cfc` or add a spec demonstrating the change.
64+
- Run `box testbox ...` after edits and ensure `test-harness` runner URL in `box.json` matches `build/Build.cfc` test runner if you rely on build tasks.
65+
66+
Please review and tell me if you'd like added examples (e.g., a minimal handler that uses the loader), or if I should fold in more lines from the module-template instructions.

.github/workflows/pr.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ on:
66
- "main"
77
- "master"
88
- "development"
9+
- "releases/v*"
910
pull_request:
1011
branches:
12+
- "releases/v*"
1113
- development
1214

1315
jobs:
@@ -18,11 +20,11 @@ jobs:
1820
# Format PR
1921
format_check:
2022
name: Checks Source Code Formatting
21-
runs-on: ubuntu-24.04
23+
runs-on: ubuntu-latest
2224
steps:
2325
- name: Checkout Repository
2426
uses: actions/checkout@v4
2527

26-
- uses: Ortus-Solutions/[email protected].2
28+
- uses: Ortus-Solutions/[email protected].3
2729
with:
2830
cmd: run-script format:check

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
##########################################################################################
3131
build:
3232
name: Build & Publish
33-
runs-on: ubuntu-24.04
33+
runs-on: ubuntu-latest
3434
permissions:
3535
checks: write
3636
pull-requests: write
@@ -133,7 +133,7 @@ jobs:
133133
box forgebox publish --force
134134
135135
- name: Create Github Release
136-
uses: taiki-e/create-gh-release-action@v1.8.2
136+
uses: taiki-e/create-gh-release-action@v1.9.1
137137
continue-on-error: true
138138
if: env.SNAPSHOT == 'false'
139139
with:
@@ -160,7 +160,7 @@ jobs:
160160
prep_next_release:
161161
name: Prep Next Release
162162
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
163-
runs-on: ubuntu-24.04
163+
runs-on: ubuntu-latest
164164
needs: [ build ]
165165
permissions:
166166
checks: write

.github/workflows/snapshot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ jobs:
2525
##########################################################################################
2626
format:
2727
name: Code Auto-Formatting
28-
runs-on: ubuntu-24.04
28+
runs-on: ubuntu-latest
2929
permissions:
3030
contents: write
3131
checks: write
3232
steps:
3333
- uses: actions/checkout@v4
3434

3535
- name: Auto-format
36-
uses: Ortus-Solutions/[email protected].2
36+
uses: Ortus-Solutions/[email protected].3
3737
with:
3838
cmd: run-script format
3939

4040
- name: Commit Format Changes
41-
uses: stefanzweifel/git-auto-commit-action@v5
41+
uses: stefanzweifel/git-auto-commit-action@v6
4242
with:
4343
commit_message: Apply cfformat changes
4444

.github/workflows/tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ on:
1010
jobs:
1111
tests:
1212
name: Tests
13-
runs-on: ubuntu-24.04
13+
runs-on: ubuntu-latest
1414
env:
1515
DB_USER: root
1616
DB_PASSWORD: root
1717
continue-on-error: ${{ matrix.experimental }}
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
cfengine: [ "boxlang-cfml@1", "lucee@5", "lucee@6", "adobe@2021", "adobe@2023" ]
21+
cfengine: [ "boxlang@1", "boxlang-cfml@1", "lucee@5", "lucee@6", "adobe@2023", "adobe@2025" ]
2222
coldboxVersion: [ "^7.0.0" ]
2323
experimental: [ false ]
2424
# Experimental: ColdBox BE vs All Engines
@@ -30,13 +30,13 @@ jobs:
3030
cfengine: "lucee@6"
3131
experimental: true
3232
- coldboxVersion: "be"
33-
cfengine: "adobe@2021"
33+
cfengine: "adobe@2025"
3434
experimental: true
3535
- coldboxVersion: "be"
36-
cfengine: "adobe@2023"
36+
cfengine: "boxlang-cfml@1"
3737
experimental: true
3838
- coldboxVersion: "be"
39-
cfengine: "boxlang-cfml@1"
39+
cfengine: "boxlang@1"
4040
experimental: true
4141
steps:
4242
- name: Checkout Repository

[email protected]

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)