ek9_clean
Wipes the on-disk .ek9/ artefacts the scope names and resets the server JVM's in-memory coverage/profiling runtimes; answers status:ok with cleanedSources[] listing what was wiped or reset, in order.
When to use it
'Start this measurement from a pristine project' is one call: {scope:'coverage'} (or profiling / release / full) on the workspace root - projectDir only for another root.
When not to use it
- Running tests -
ek9_run_testsalready cleans with scope coverage first, so a precedingek9_cleanis redundant. - Just wanting a fresh recompile without deleting lib/, the target executable, or resetting runtimes - use
ek9_compile(mode=full), which re-emits all bytecode.
Details
Scope maps to state sources: coverage = wipe generated/ + reset CoverageRuntime; profiling = also reset ProfilingRuntime (profiling registers probes via CoverageRuntime, so both reset); release/full = also wipe lib/ + target executable + props (identical on disk today, kept distinct so future caches can join full). Disk wipe + runtime reset are one coordinated step so they never drift (historically a registry-only reset let orphaned .class files re-register stale probes and pollute coverage). The response's cleanedSources lists what was wiped/reset in execution order.
Arguments
| Argument | Type | Required | What it is |
|---|---|---|---|
file | string | The entry-point .ek9 source file (absolute, or relative to projectDir). Omit to auto-detect the shallowest non-dev .ek9 file - enough to locate the .ek9/ directory. | |
projectDir | string | Project root holding the .ek9 sources - absolute, or relative to the workspace root. Omit to use the workspace root itself (the first root ek9_compile was given). | |
scope | string: coverage | profiling | release | full | What to make pristine: coverage (generated/ + coverage runtime), profiling (coverage + profiling runtime), release and full (also lib/, the target executable and props). |
Recorded calls
Real calls, recorded against small projects and checked on every build - a changed answer fails it.
Clean coverage scope
Request
{
"projectDir" : "<workspace-root>",
"scope" : "coverage"
}
Response
{
"cleanedSources" : [ "generated", "coverageRuntime" ],
"mainSource" : "main.ek9",
"meta" : {
"serverMs" : "<timing>"
},
"projectDir" : "<workspace-root>",
"scope" : "coverage",
"status" : "ok"
}