# The .dev directory

> Find project outputs, dependencies, reports and build state in .dev, understand workspace layouts, and clean generated files without losing source inputs.

Elide writes a project's build files under `.dev/`, beside `elide.pkl`. Directories appear when a command needs them;
a project that only runs JavaScript will not have the same files as one that compiles Java and packages a JAR.
Keep source files and persistent configuration outside this directory.

## Find generated files

| Path under `.dev/` | Contents |
| --- | --- |
| `artifacts/` | Packaged outputs, such as JARs in `jar/`, native executables in `native-image/`, and application distributions. |
| `jvm/classes/<source-set>/java/` | Compiled Java classes. |
| `jvm/classes/<source-set>/kotlin/` | Compiled Kotlin classes. |
| `staging/` | Intermediate packaging files and copied JVM resources. |
| `dependencies/m2/` | Resolved Maven artifacts and classpath files. Artifacts normally link to the Maven cache; `elide install --direct` copies them. |
| `dependencies/npm/` | npm installation files. The project's `node_modules` links into this directory. |
| `reports/tests/` | Test reports, grouped by language and source set when reporting is enabled. |
| `reports/coverage/` | Coverage reports when coverage is enabled. |
| `telemetry/` | Local build traces when `ELIDE_BUILD_TELEMETRY` is enabled. |
| `elide.lock.v2.bin` | Portable task fingerprints and resolution state. This is not an ecosystem dependency lockfile. |
| `elide.build.bin` | Machine-local build state. |
| `elide.filehash.bin` | Cached file digests. |

Use [JAR packaging](https://elide.help/docs/toolchain/jvm/jar), [Native Image](https://elide.help/docs/toolchain/jvm/native-image) and
[Testing](https://elide.help/docs/toolchain/testing) for exact output paths. The binary state files are managed by Elide; do not edit them.
The npm lockfile, `aube-lock.yaml`, lives at the project root, outside `.dev/`.

## Workspaces

A workspace shares dependency artifacts and build state in the root project's `.dev/`. Each member keeps compiled
classes, packaged outputs and reports in its own `.dev/`. Maven classpath files also stay per project under
`.dev/dependencies/m2/`, even though the dependency artifacts are shared.

Use `elide classpath` instead of assembling a classpath from directory contents. See
[Source sets](https://elide.help/docs/toolchain/source-sets#dependencies-and-classpaths) and [Dependencies](https://elide.help/docs/toolchain/dependencies#installed-files).

## Clean and rebuild

```bash
elide build clean
elide install
elide build
```

`clean` removes the selected project's whole `.dev/`, including reports and local state. At a workspace root it
also cleans every member; when a member is selected, it cleans that member. Save reports or packaged outputs you
need before cleaning. Dependencies and outputs are recreated by later commands, which may require network access.

Project cleanup does not clear the user-wide build cache in `~/.elide/cache/entries-v2`; the next build can restore
outputs from that cache. Use `elide build --no-cache` to rebuild without cached task results. See
[Build cache](https://elide.help/docs/toolchain/build-tasks#build-cache) for local and shared cache behavior.

Exclude generated project files from version control:

```gitignore
.dev/
node_modules/
```

Commit the project's manifest, source inputs and applicable dependency lockfiles. Put durable build-extension inputs
outside `.dev/` too, so cleaning cannot remove the files required to reproduce a build.

## Elide source checkouts

The Elide repository's contributor build adds directories such as `.dev/toolchains/`, `.dev/codegen/`,
`.dev/artifacts/dist/` and `.dev/scratch/`. These belong to the repository's `./builder` and `make` workflow; ordinary
application projects do not need them. Adopted contributor worktrees can share toolchains and dependencies through
symlinks, so follow the checkout's build instructions when managing those directories.
