Giter VIP home page Giter VIP logo

Comments (5)

artemyarulin avatar artemyarulin commented on June 19, 2024

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.

artemyarulin avatar artemyarulin commented on June 19, 2024

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 include node and browser runners as a default, but I guess rnative 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.

artemyarulin avatar artemyarulin commented on June 19, 2024

Answer:

runners = {'node': {'modules': ['xmldom']}
           'browser':{},
           'rnative':{},
           'my-own':{'a' True}}

from clojure-clojurescript-buck.

artemyarulin avatar artemyarulin commented on June 19, 2024

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.

artemyarulin avatar artemyarulin commented on June 19, 2024

Closed via 063daab

from clojure-clojurescript-buck.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.