Comments (10)
I think this is caused by the cljx.plugin/middleware unconditionally adding cljx to the dependencies. As a workaround, you can specify the cljx plugin inside the :dev
profile.
from cljx.
Yeah, @hugoduncan is right. I always put cljx in :dev
, which explains the README inaccuracy.
It's been a long while since I've had my hand in lein pom stuff. What needs to be changed to prevent the dep from being included, regardless of the profile in which the plugin is situated? (Making the dep optional would be an easy fix, but I'd like the pom to be clean in all cases.)
from cljx.
I think that the cljx
task should add the dependency, rather than doing it in middleware, assuming that the task is the only thing that requires the dependency being on the project's classpath.
from cljx.
Currently, Leiningen just unmerges the :default
profile from the project map before generating the pom. The :default
profile is defined as [:base :system :user :provided :dev]
, but can be overridden.
I can see several options here:
- Create a new
:cljx
profile for the dependencies, and add it to the:default
profile. - Add the dependencies to the
:dev
profile automatically - Clearly document in the README that the plugin should be used in a profile, not at the top level.
I'm personally inclined toward option 1. It would give people the ability to turn cljx on and off just by toggling the profile, while at the same time providing unsurprising default behaviour when deploying or generating jars.
from cljx.
The dependency is also required at runtime for the REPL support, etc.
from cljx.
I've updated the README to demonstrate and advise :dev
profile use.
Happy to take a PR that implements option 1 as described by @weavejester.
from cljx.
Some profiles for common configuration scenarios would be nice to add too. eg. cljx only source project with cljx sources under src
, or a clj and cljx project (with src/clj
and src/cljx
). These profiles could be explicitly used by a consuming project to avoid repetitive and error prone manual configuration of the project.
from cljx.
Another thought: why shouldn't the dependency just be added in a repl
task hook? Should eliminate all the profile business entirely.
from cljx.
I forgot to mention that I posted to the Leiningen mailing list about how best to solve this. @technomancy's response was that there isn't currently a good way of doing this in Leiningen as yet... though it appears as though @hugoduncan has submitted a PR along these lines.
from cljx.
A fix for this is now on develop/0.5.0
, and available for testing as [org.clojars.cemerick "0.5.0-SNAPSHOT"]
. The plugin's middleware now only adds the dependency if the :repl
profile is activated, indicating that the REPL is about to start. In my testing, this prevents cljx from ever getting near the pom.
More capable profile/configuration management is an interesting notion, but I'd like to consider that separately, as long as the current proposed fix works.
from cljx.
Related Issues (20)
- polling rate HOT 2
- Drop hooks
- Current file generation approach is broken with recent leiningen HOT 3
- Wrong test selector used with lein do clean, test HOT 2
- 0.5.0 release HOT 4
- 0.5.0: Seeing StackOverflowError HOT 2
- 0.5.0 fails to run cljx in sequence of prep tasks HOT 10
- cljx auto generates double output HOT 6
- Endless loop when used from :prep-tasks HOT 1
- Clojure REPL not working if CLJX 0.5.0 & CLJS 2665 on classpath HOT 2
- Catch up with latest ClojureScript HOT 2
- Leiningen 2.5.1 incompatibility of :plugins HOT 5
- Source directories from parent directories don't work HOT 2
- Error handling in cljx-compile
- Characters in a cljx file after #+clj HOT 2
- Environment variables HOT 2
- Break when upgrading from Cljx 0.4.0 to 0.6.0 HOT 4
- REPL integration fails with 0.5.0/0.6.0 but works with 0.4.0 HOT 4
- Requiring unused dependency? HOT 5
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 cljx.