This fixes I850271bb1c657a5ffe77946a6beaf54a3680af75.
Change-Id: I128ae1b88adc267b0f1f9b1db7b0a96a87a861b3
(cherry picked from commit 9ffd58a82b497dbdfcf73945dea240469fee3b14)
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
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
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
Additionally fix a bug in bower2buck.py where it would
bail when a license is not specified in a Bower package
info response.
[1] http://caniuse.com/#feat=fetch
[2] http://github.github.io/fetch/
Change-Id: Ibf754aab98bab6e34b7a9fb5d6c9801bb612f5d5
web-animations is weird because it can be referred to either as
'web-animations' or 'web-animations/web-animations-js'. Manually
entering it as the former confuses bower2buck when it's referred to
elsewhere as the latter.
Run bower2buck to normalize the current contents.
Band-aid the situation for now, and jot down some of my ideas for
fixing when I find the time.
Change-Id: I64ae3c376df7b83008462c663de4a3998749c365
Instead of requiring a target, default to //polygerrit-ui/...; this
package and subpackages have several bower_components rules, and
using all of them is most likely to produce all the existing rules in
lib/js/BUCK.
Rewrite instructions in lib/js/BUCK so they are more copy-and-
pasteable. Add instructions to the generated new BUCK file on how to
merge with an existing BUCK file.
Normalize the existing package names so there's less delta on each
diff.
Change-Id: I5f46d4d06d6aaacf40c9a7771eec6e85710093e1
This script merges dependencies of a bower_components rule into a
synthetic bower.json, then runs bower install to evaluate the version
rules and install packages locally. It walks through the downloaded
.bower.json files to produce new bower_component rules to put back in
lib/js/BUCK.
Change-Id: Iaea0b0a54ca4305ce40accf5924cd12fbf07b0d8
We were passing the wrong directory name, resulting in hashing a
nonexistent directory and all components having the same SHA-1.
Unfortunately os.walk succeeds silently in this case.
Move hash_dir and hash_file to util so they can be used by other
scripts. (Migration of existing hashfile implementations will come
later.)
Restructure the main function to look a little more like the logic in
download_file.py, where we download to the cached location first and
then copy it after.
Fix all the broken SHA-1s in lib/js/BUCK.
Change-Id: I58bc62f84b62169bf18695a6a6704c989036c4f6
Contrary to our experience with bower, not all packages on
registry.npmjs.org come with dependencies bundled. This script
produces a tarball with bundled dependencies which can be hosted on
the Gerrit GCS bucket and used as an npm_binary.
Change-Id: I2403c7f0acf759be2508b845d1f359cdf6a65e4e
Add support for downloading npm binaries including dependencies and
running them in buck genrules. In npm land, transitive dependencies
are generally included in the package distribution, and there are a
*lot* of them. Since we aren't redistributing these binaries and
they're only part of the build process, we don't have to worry too
much about licensing, only that they don't have anything totally
crazy.
We assume packages have a certain format and we can detect the binary
to run from the genrule output filename. Actually running the binary
is tricky as well, since we have to extract it first. But it might be
large, so we don't want to extract it on every invocation; and naive
extraction to a common location (in buck-out) is racy. So we need a
custom extractor scheme using atomic rename to make this work.
Download bower as an npm package and use it to download bower
packages. Bower packages can come from a variety of sources, usually
git repositories, so we can't simply use download_file. There is
additional logic in bower to read bower.json and strip out unneeded
files, so I didn't want to get into reimplementing that. The tricky
thing about bower is convincing it to avoid transitive dependencies so
we can let Buck handle parallelism and caching. To do this, we need to
read the package information from the upstream bower repository, and
explicitly ignore all listed dependencies when downloading.
We combine the flattened list of bower packages in a single
bower_components rule. It would be nice to have deps of each
bower_component so we didn't need to flatten these, but Buck genrules
don't have deps so this is a nonstarter. Considering we only expect to
have a single bower_components for the whole project, hopefully this
is not too onerous.
This change just gets us the bower_components directory. We still have
some work to do to use this from Gerrit. Plus even more work to
replace the gulpfile and actually package this stuff together into a
compiled JS app for the war distribution.
Change-Id: Id277d2d812ffcc3bce87ff00b5894bacdffc038e