Comments (7)
Thank you for the work on build-clj project, it's high on my to-do list
The plan is to move to tools.build as soon as I have had time to look at this approach in detail (should be working on this over the next few weeks)
If I understand correctly, a build.edn file is required. If so, I would need to understand at least the basics of this before switching and include a suitable config
I also plan to prioritize deps-new over clj-new (and create several templates) which simplifies the build process by providing a build.edn configuration.
Thank you.
from clojure-cli-config.
What is build.edn
? Never heard of that. Do you mean build.clj
? To invoke just the uber
function from the build-clj
wrapper for tools.build
, you can just use -T
and an alias. Maybe I'll add some examples to build-clj
's README...
from clojure-cli-config.
@practicalli-john I've added some examples to the build-clj
README of how you can use it via just an alias from the CLI without a build.clj
file.
from clojure-cli-config.
Using the stand-alone commands seems to require specific aliases defined, eg. to run tests then :test
alias that defines the path and cognitect-labs/test-runner deps should be defined (assume this can be either project deps.edn or user level deps.edn file.
If the :test
alias is renamed then the test runner namespace is not found. This is the same when using the clojure -T:build test
As build-clj looks for cognitect/test_runner.clj by default. If changing :test
to use the Koacha test runner then the alias must contain a :main-opts
with a value defining the main namespace. If an :exec-fn
is included, then the test task will try to use cognitect/test_runner and fail as its not on the classpath. Curious as to why :exec-fn
cannot be used, if that is a choice of build-clj or limitation of tools.build.
Some investigation required into tools.build and build-clj is still required.
from clojure-cli-config.
I wasn't sure whether your last comment was "musing out loud" or some questions intended for me, which is why I didn't respond at the time. However, this feels like a question I should answer:
Curious as to why :exec-fn cannot be used, if that is a choice of build-clj or limitation of tools.build.
This comes about because the tests are run in a separate process, so that none of the tools.build
/tools.deps.alpha
stuff is on the classpath when running your code under test.
tools.build
has tasks that support building a java
command and executing it, so you're going to be running a -main
function -- either in your own code or clojure.main
. The -X
stuff is all built into a small exec.jar
that is bundled into the Clojure CLI but is not available as a library anywhere. See https://clojure.atlassian.net/browse/TBUILD-6 for some discussion around this (and code close to what we do at work to allow for "exec" task execution in our build.clj
file -- it's pretty nasty and relies on internals of the Clojure CLI to work, since it has to generate a -X
-style command-line from a data structure so that it can start the process off via the java
command!).
If you execute tests in-process -- as happens if you just use an alias to run Cognitect's test-runner directly -- you can just require, resolve, and directly call the "exec" function from your build.clj
script. But when you run test-runner
or Koacha etc, you are only adding the test runner's dependencies into the mix, not all of the tools.*
stuff (which drags in a lot of libraries!).
from clojure-cli-config.
After much though and slack discussions I'll deprecate / delete all aliases that can be done with tools.build instead.
Add a section to Practicalli Clojure to cover tools.build and any useful projects that support it.
from clojure-cli-config.
Resolved by #61
from clojure-cli-config.
Related Issues (20)
- Accidentally removed "clone" from git installation command in README HOT 1
- Windows and Clojure CLI - escape character issues HOT 7
- Project License? HOT 1
- Would you consider adding scope-capture to the inspect section? HOT 2
- :mvn/local-repo appears to be broken as it is relative HOT 1
- [clojure-deps-edn] Create Pull Request template to guide contributions
- Error when using :search/outdated HOT 3
- `:project/outdated` is mentioned in comments but it looks like it was renamed to `:search/outdated`
- User level deps.edn - november update dependencies to latest versions
- refactor: deprecate unused aliases for simpler config HOT 1
- sayid alias requires middleware
- Reveal has disappeared? HOT 4
- Update repo name and branch
- clj-kondo improvements HOT 6
- Add clj-depend tool HOT 1
- Monthly version update
- support Clerk as inspector ? HOT 4
- deps-new Invalid Tag HOT 1
- Command line arguments to repl/rebel-remote don't work HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clojure-cli-config.