You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-5Lines changed: 22 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ Note that `clojure_library` AOT is _non-transitive_. By default `(clojure.core/c
63
63
64
64
If you don't need to AOT, `clojure_library` isn't necessary, just use `java_library` with `resource_strip_prefix`.
65
65
66
-
Note that AOT will determine whether a library should appear in `deps` or `runtime_deps`. If a library is being AOT'd, everything that it requires will need to appear in `deps`. If it is not being AOT'd, dependencies should be listed in `runtime_deps`.
66
+
Note that AOT will determine whether a library should appear in `deps` or `runtime_deps`. If a library is being AOT'd, everything that it loads at compile time will need to appear in `deps`. If it is not being AOT'd, dependencies should be listed in `runtime_deps`.
67
67
68
68
### clojure_repl
69
69
@@ -177,19 +177,21 @@ Prefer namespace metadata for specifying extra dependencies in your code. Howeve
177
177
178
178
put `:bazel {:deps {}}` at the top level of your deps.edn file. `:deps` will be merged in when running `gen_srcs`. Deps are a map of bazel labels to a map of extra fields to merge into the `clojure_library`.
179
179
180
+
`examples/stress/deps.edn` contains known examples of libraries that require extra annotations to compile under rules clojure.
181
+
180
182
### no AOT
181
183
182
184
```clojure
183
185
:bazel {:no-aot #{foo.bar}}
184
186
```
185
187
186
-
Instructs gen-build to not AOT that namespace.
188
+
Instructs gen-build to not AOT that namespace. Note that this doesn't affect 3rd party dependencies yet.
187
189
188
190
### Coarse dependencies
189
191
190
192
Fine grained dependencies are ideal from an efficiency perspective, but it isn't always possible to make them work.
191
193
192
-
`gen_srcs` also creates a few extra targets in every directory on the deps.edn search path. It will produce `clojure_library` targets named `__clj_lib` containing all source files in the directory (non-AOT'd), and all subpackages. `//src:__clj_files` includes all src files under `src`. These targets are useful for static analysis tools.
194
+
`gen_srcs` also creates a few extra targets in every directory on the deps.edn search path. It will produce `clojure_library` targets named `__clj_lib` containing all source files in the directory (non-AOT'd), and all subpackages. `//src:__clj_files` includes all src files under `src`. These targets are useful for e.g. static analysis tools like clj-kondo.
193
195
194
196
`__clj_lib` does not include dependencies. Use `@deps//:__all` to pull in all dependencies.
195
197
@@ -294,13 +296,28 @@ This makes things much nicer and more standard for users of the rules.
294
296
- builds are non-reproducible for one reason:
295
297
- there isn't a public API to reset the ID clojure uses for naming anonymous functions, which means anonymous AOT function names are non-deterministic
296
298
- When using gen-deps, I haven't found a way to identify :provided dependencies. Those have to be added by hand for now
297
-
- Do not use `user.clj`. If there is a user.clj at the root of your classpath, it will be loaded every time a new Clojure runtime is created, which can be many times during an AOT job. Additionally, dependencies in the user.clj are invisible to `gen-build`
298
299
299
300
# Compatibility
300
301
301
-
rules_clojure requires JDK 17 or higher. It is currently tested with Bazel 7.4.1 and JDK21
302
+
rules_clojure requires JDK 21 or higher. It is currently tested with Bazel 7.4.1 and JDK21
302
303
303
304
# Thanks
304
305
305
306
- Forked from https://github.com/simuons/rules_clojure
306
307
- Additional inspiration from https://github.com/markdingram/bazel-clojure
308
+
- Contains vendored code from tools.namespace https://github.com/clojure/tools.namespace
309
+
- Contains vendored code from tools.reader https://github.com/clojure/tools.reader
310
+
- Contains vendored code from java.classpath https://github.com/clojure/java.classpath
0 commit comments