Skip to content

Commit 4cfd77e

Browse files
authored
Merge pull request #2724 from behrica/documentMixedProjects
Document mixed projects * Fixes #2723
2 parents 1b8d4af + 491a5e9 commit 4cfd77e

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

docs/site/virgil.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: REPL hot-reload Java code with Virgil
3+
description: REPL driven development of mixed Clojure / Java projects using Virgil
4+
---
5+
6+
# Mixed Clojure / Java projects
7+
8+
## Mixed builds
9+
Combined Java and Clojure projects where possible from the first day of Clojure.
10+
The official Clojure documentation describes
11+
[here](https://clojure.org/guides/tools_build#_mixed_java_clojure_build) such a
12+
setup incl. a `build.clj`
13+
14+
For Leiningen we have a similar setup documented [here](https://github.com/technomancy/leiningen/blob/github/doc/MIXED_PROJECTS.md) .
15+
16+
## Java development in VSCode
17+
VSCode has good [first class support](https://code.visualstudio.com/docs/languages/java) for Java.
18+
19+
So we have
20+
21+
* a "mixed build"
22+
* comfortable editing of Clojure code with VSCode/Calva
23+
* comfortable editing of Java source code with VSCode/Java extensions
24+
25+
but these do not address a REPL driven workflow spanning changing Clojure and Java files.
26+
27+
## Virgil
28+
29+
For quite a while, there was no real answer, as any change to a Java class required
30+
the restart of the REPL, which is not a smooth workflow.
31+
32+
[Virgil](https://github.com/clj-commons/virgil) has changed this !
33+
34+
Virgil is a small Clojure library which continuously watches your java source files and recompiles them on each change and loads the changed classes into the running Clojure JVM.
35+
36+
This allows side-by-side development of Java and Clojure code and Virgil makes sure that the Clojure JVM gets the changed Java files injected.

mkdocs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ nav:
105105
- quirks.md
106106
- async-out.md
107107
- clj-java-decompiler.md
108+
- virgil.md
108109
- API:
109110
- api.md
110111
- commands.md

0 commit comments

Comments
 (0)