8 Commits

Author SHA1 Message Date
Logan Hanks
b824e5ee2e Fix glob in bower2bazel.py
This fixes I850271bb1c657a5ffe77946a6beaf54a3680af75.

Change-Id: I128ae1b88adc267b0f1f9b1db7b0a96a87a861b3
(cherry picked from commit 9ffd58a82b497dbdfcf73945dea240469fee3b14)
2017-07-31 10:44:57 +00:00
Paladox none
104a6a184e Fix bazel 0.5.* support
Change-Id: I751b4fca32964a400bf6875950b2114bf542b981
2017-06-16 09:09:35 +00:00
Shawn Pearce
41c2e73da2 Support Bazel 0.5.1
Bazel 0.5.1 is using "bazel-out/darwin_x86_64-fastbuild/", which
failed these extraction patterns.  Allow anything before the
-fastbuild part of the path.

Change-Id: I850271bb1c657a5ffe77946a6beaf54a3680af75
2017-06-12 08:53:05 +09:00
Han-Wen Nienhuys
3dede1653a bower2bazel: don't specify versions for non-seed packages.
The 'seed' packages are the ones whose versions are set by us in
WORKSPACE. We should not set the versions for the rest of the packages
in the bower input JSON, so bower can suggest the right versions to
use.

Change-Id: I9b75f16655d049e2064726862980a339c91dd534
2017-02-01 13:33:55 +01:00
Han-Wen Nienhuys
42ea853037 bazel: remove code to sniff license field in bower.json.
Instead, use a hard-coded map of licenses.

Hardcode a false dependency on diff-match-patch to avoid a diff for
the Apache2.0 license.

Tested:
  bazel build Documentation:js_licenses.txt
  buck build Documentation:js_licenses.txt
  diff -u  buck-out/gen/Documentation/js_licenses.txt/js_licenses.txt \
    bazel-genfiles/Documentation/js_licenses.txt
 diff shows only diffs for added [[header]] anchors.

Change-Id: I7886e1fadec900cf854a1b3b7c538b83d66af7a4
2016-12-20 15:44:52 +01:00
Han-Wen Nienhuys
246f928887 bazel: update bower packages.
Change-Id: I1672018089db8df90f52416f532436b387c242cb
2016-11-03 13:01:39 +01:00
David Pursehouse
ccc45ad75d Remove unused imports in Python scripts
Change-Id: I4397b76d8dbfe5e73b7cede4c15bd77ad322c04e
2016-10-19 12:19:54 +09:00
Han-Wen Nienhuys
28e7a6d3fe bazel: bower support
* 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
2016-09-29 13:18:19 +02:00