gerrit/lib
Dave Borowitz ffe301570c Build bower_components with buck
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
2015-11-12 19:01:53 -05:00
..
antlr Bump antlr to version 3.5.2 2015-01-07 00:46:18 +00:00
asciidoctor Consistently use character encoding constants 2015-10-16 08:39:12 +00:00
auto Update AutoValue to 1.1 2015-08-28 09:54:52 +09:00
bouncycastle Correct issue with Bouncy Castle code signing 2015-11-10 13:00:26 -08:00
codemirror Upgrade Codemirror to version 5.8 2015-11-05 10:23:22 +09:00
commons Remove unnecessary dependency on commons-io 2015-07-30 21:54:17 +09:00
dropwizard DropWizard metric support 2015-11-11 10:13:25 -08:00
easymock Bump to powermock 1.6.2 and to compatible easymock 3.3.1 2015-06-09 02:12:45 +00:00
guice Update Guice to version 4.0 2015-07-27 14:06:19 +09:00
gwt Buck: Move gwt-dev transitive deps to first order dependency 2015-10-18 19:01:42 +02:00
httpcomponents Use httpcomponents fluent API in acceptance tests 2015-05-28 17:15:36 +09:00
jetty Upgrade Jetty to 9.2.13.v20150730 2015-11-12 18:09:40 +00:00
jgit Upgrade JGit to 4.1.0.201509280440-r 2015-11-12 10:08:00 -08:00
joda Upgrade joda-time to 2.8 2015-06-24 14:59:50 +09:00
js Build bower_components with buck 2015-11-12 19:01:53 -05:00
log Changing the SSH key converter to BUCK 2015-11-09 10:59:32 -08:00
lucene Update Lucene to version 5.3.1 2015-11-06 12:14:50 +09:00
mina Revert "Downgrade SSHD to 0.9.0-4-g5967cfd" 2015-04-06 12:26:07 +09:00
openid Move httpcomponents libraries out of lib/commons to lib/httpcomponents 2014-09-17 17:55:17 +09:00
ow2 Remove org.json:json and fix gwt-dev deps 2015-06-26 06:29:43 +00:00
powermock Bump to powermock 1.6.2 and to compatible easymock 3.3.1 2015-06-09 02:12:45 +00:00
prolog Remove unnecessary dependencies 2015-09-18 06:02:35 +00:00
BUCK Build bower_components with buck 2015-11-12 19:01:53 -05:00
js.defs Build bower_components with buck 2015-11-12 19:01:53 -05:00
LICENSE-antlr Build with Buck 2013-05-09 13:40:36 +00:00
LICENSE-Apache1.1 Build with Buck 2013-05-09 13:40:36 +00:00
LICENSE-Apache2.0 Build with Buck 2013-05-09 13:40:36 +00:00
LICENSE-args4j Build with Buck 2013-05-09 13:40:36 +00:00
LICENSE-automaton Build with Buck 2013-05-09 13:40:36 +00:00
LICENSE-bouncycastle Build with Buck 2013-05-09 13:40:36 +00:00
LICENSE-CC-BY3.0 Document diffy logo is CC-BY 3.0 2013-08-21 08:57:42 -07:00
LICENSE-clippy Build with Buck 2013-05-09 13:40:36 +00:00
LICENSE-codemirror Async load popular modes into CodeMirror 2013-05-21 11:01:26 -07:00
LICENSE-diffy Document diffy logo is CC-BY 3.0 2013-08-21 08:57:42 -07:00
LICENSE-DO_NOT_DISTRIBUTE Build with Buck 2013-05-09 13:40:36 +00:00
LICENSE-drifty Use image instead of Unicode Character for Copy Button 2015-11-09 20:48:22 +00:00
LICENSE-freebie_application_icon_set Show link on hover for headings and anchors in documentation 2014-12-09 01:14:32 +00:00
LICENSE-h2 Build with Buck 2013-05-09 13:40:36 +00:00
LICENSE-jgit Build with Buck 2013-05-09 13:40:36 +00:00
LICENSE-jsch Build with Buck 2013-05-09 13:40:36 +00:00
LICENSE-MPL1.1 Build with Buck 2013-05-09 13:40:36 +00:00
LICENSE-ow2 Build with Buck 2013-05-09 13:40:36 +00:00
LICENSE-page.js Build bower_components with buck 2015-11-12 19:01:53 -05:00
LICENSE-polymer Build bower_components with buck 2015-11-12 19:01:53 -05:00
LICENSE-postgresql Build with Buck 2013-05-09 13:40:36 +00:00
LICENSE-prologcafe Update license text for PrologCafe 2013-05-13 09:44:25 -07:00
LICENSE-promise-polyfill Build bower_components with buck 2015-11-12 19:01:53 -05:00
LICENSE-protobuf Add dependency on the Google protocol buffer library 2013-09-10 15:59:25 -07:00
LICENSE-PublicDomain Build with Buck 2013-05-09 13:40:36 +00:00
LICENSE-slf4j Build with Buck 2013-05-09 13:40:36 +00:00
LICENSE-xz Download commands: Add JGit archive 2014-03-03 23:34:46 +00:00
local.defs Buck: Align gerrit build interface to bucklets 2014-09-09 13:20:47 +00:00
maven.defs Buck: Tweak Eclipse project generation to include sources again 2015-10-15 08:11:19 +02:00