
* npm_binary (download tarball packaged npm apps) * bower_archive (download a zip file, to be put in WORKSPACE) * bower_component (defining a bower library, with dependency ) * bower_component_bundle (zipping up libraries together) * js_component (insert plain js file into bower component bundle) * bower2bazel.py: run bower to find dependencies, generate a .bzl to define archives and define components Tested: python tools/js/bower2bazel.py -w lib/js/bower_archives.bzl -b \ lib/js/bower_components.bzl bazel build polygerrit-ui:components unzip -v bazel-bin/polygerrit-ui/components.zip > /tmp/baz buck build polygerrit-ui:polygerrit_components unzip -v buck-out/gen/polygerrit-ui/polygerrit_components/polygerrit_components.bower_components.zip > /tmp/buck diff /tmp/buck /tmp/baz The diff corresponds to newer file versions pinned through bower2bazel. Change-Id: I4f33914d4853bcf8afe78b4719d0e0e83b139031
30 lines
817 B
Python
30 lines
817 B
Python
package(default_visibility = [ "//visibility:public" ])
|
|
load('//tools/bzl:genrule2.bzl', 'genrule2')
|
|
load("//tools/bzl:js.bzl", "bower_component", "js_component")
|
|
|
|
# For updating the bower versions, run
|
|
#
|
|
# python tools/js/bower2bazel.py -w lib/js/bower_archives.bzl -b lib/js/bower_components.bzl
|
|
#
|
|
|
|
# For adding a new component as dependency to a bower_component_bundle
|
|
#
|
|
# 1) add a new bower_archive in WORKSPACE
|
|
#
|
|
# 2) add bower_component(name="my_new_dependency", seed=True) here
|
|
#
|
|
# 3) run bower2bazel (see above.)
|
|
#
|
|
# 4) remove bower_component(name="my_new_dependency", .. ) here
|
|
#
|
|
|
|
|
|
load("//lib/js:bower_components.bzl", "define_bower_components")
|
|
define_bower_components()
|
|
|
|
js_component(
|
|
name = 'highlightjs',
|
|
srcs = [ "//lib/highlightjs:highlight.min.js" ],
|
|
license = '//lib:LICENSE-highlightjs',
|
|
)
|