Comments (5)
Here some rough ideas of how it may looks at the end
clj_module('a') # a.clj (ns example.a)
cljc_module('c') # c.cljc (ns example.c)
cljc_module(name = 'b',
src = ['b.clj','bb.cljc'],
tests = 'b_test.cljc',
deps = [':a',':c','//ext/promesa-0.4.6'],
depsTests = '//ext/koh.test-0.1.0',
runners = ['node','browser','rnative','my-own'],
main = 'lib.b')
# Some additional executables that we may provide
clojars_release(modules = ':b',
name = 'koh.b',
version = '0.1.2-SNAPSHOT')
extract_public(title='B is all about B',
docModules = [':b'],
licence = 'MIT')
# Following target would be created:
""""
# source only targets, for working with dependencies
//lib/a:a
//lib/c:c
//lib/b:b
# repl executables, starts repl with Clojure project if clj_module, ClojureScript otherwise
//lib/a:repl
//lib/c:repl
//lib/b:repl
# meta target, depends on actual tests for each platform
//lib/b:test
# actual test targets, so we can run it separately if we want
//lib/b:test-node
//lib/b:test-browser
//lib/b:test-jvm
//lib/b:test-rnative
//lib/b:test-my-own
"""
from clojure-clojurescript-buck.
Couple of things to notice:
- No separate build targets - build in this case just a sanity check and for checks we have tests which will build a module in any case. It doesn't make sense to have build on their own - if we want to be sure that module is in a correct state, well then add a test. LIKE IT VERY MUCH
Runners
- for sure we should includenode
andbrowser
runners as a default, but I guessrnative
could be to much custom and it will be used as our own
Question: How can we customise node with additional libs that module may need? Making own runner is too much for such usual thing. And in general - how can we customise runners? I want rnative
for iOS only for example and so on
from clojure-clojurescript-buck.
Answer:
runners = {'node': {'modules': ['xmldom']}
'browser':{},
'rnative':{},
'my-own':{'a' True}}
from clojure-clojurescript-buck.
Answering one of the questions from the top: If module has a custom main
attribute then probably it's mean to be used as a end product so we would add release
task which would run tests twice: with whitespace
and advanced
optimisations to be sure we've covered everything.
So actual targets would be:
//lib/a:a
//lib/c:c
//lib/b:b
//lib/b:b-release
//lib/a:repl
//lib/c:repl
//lib/b:repl
//lib/b:test
//lib/b:test-release
//lib/b:test-browser
//lib/b:test-browser-release
//lib/b:test-jvm
//lib/b:test-jvm-release
//lib/b:test-my-own
//lib/b:test-my-own-release
//lib/b:test-node
//lib/b:test-node-release
//lib/b:test-rnative
//lib/b:test-rnative-release
from clojure-clojurescript-buck.
Closed via 063daab
from clojure-clojurescript-buck.
Related Issues (20)
- Make sure that non of snapshot versions are used in a templates
- Make project template configurable
- Put example and example output to the repo
- Sort our targets
- Add clj(s,c)_test examples/tests and documentation HOT 1
- Explain customisation HOT 1
- Add motivation speech HOT 1
- Linux/Windows support
- Figwheel support
- Test deps
- Rethink key principles again HOT 10
- Multiple test runners
- Project file is a test dependency, not a build
- repl fails with NSPOSIXErrorDomain error 24 HOT 2
- Test modules dependencies should be merged into project file
- Build target has to be splitted in two: `src` and `build`, otherwise it takes too long to rebuild the project
- In certain cases cache is not invalidated - we change the code, rebuild some of the deps, but module still using an old one HOT 2
- Handle ns automatically - it's not a developer business to specify it manually all the time
- Add meta module `clojure` - as we are using `genrule` for everything we cannot query using `type`, instead we will use meta module and find all deps from it in order to acheive the same functionality HOT 1
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-clojurescript-buck.