9 Commits

Author SHA1 Message Date
David Ostrovsky
fa18907d7f Bazel: Reformat build files
Reformat the Bazel build files with the buildifier tool [1].

The style is different for Bazel files. Most notably, indentation level
is 4 spaces instead of 2, and " is used instead of '.

[1] https://github.com/bazelbuild/buildifier

Change-Id: I95c0c6f11b6d76572797853b4ebb5cee5ebd3c98
2016-12-07 11:33:07 +00:00
Han-Wen Nienhuys
c1a6976b50 bazel: put source jars in the same package.
This lets us associate the jar and the src jar in the java_import()
declaration, so IDE plugins could understand how artifacts and source
are connected.

Classpath generation for Eclipse IDE was adjusted to reflect the changed
location of the source artifact.

Change-Id: I2cf9c6db3ad4b648457f2ac8d380c3771b4a3ee2
2016-11-30 08:48:20 +01:00
David Ostrovsky
8c9a9ea486 Expose sources in GWT UI plugin API
gwt_binary() uses Bazel feature to retrieve the sources from the
dependency libraries. For the standalone API this feature cannot be
used as the only dependency is GWT UI plugin API. Expose the sources
in GWT UI plugin API as well.

TEST PLAN:

Apply this change and create the plugin API:

  $ ./tools/maven/api.sh install

Apply reviewers plugin Bazel build implementation change: [1] and
verify, that the reviewers plugin can be built with the GWT UI plugin
API created with this change.

[1] https://gerrit-review.googlesource.com/91830

Change-Id: I2b065a8eccbc33020d461834704d684871f463d7
2016-11-22 22:16:18 +00:00
David Ostrovsky
2502fab15a Bazel: Implement GWT UI build for the plugins
TEST PLAN:

  $ bazel build plugins/cookbook-plugin

Deploy to the server site and verify that it works.

Change-Id: I98af807f9c92ba4ed7efad332d8fdee407bb8ce6
2016-11-15 15:29:13 -08:00
David Ostrovsky
6546085df7 Bazel: use a custom maven_jar rule
Using existing download_file.py from custom maven_jar Skylark rule
gives us the following advantages:

* fetching of sources (needed for GWT JSNI build and IDE integration)
* server support for proxies
* global, per-user cache of artifacts
* support for local maven repository (~/.m2)

Change-Id: Ic246dd9298775a6819f05453c601c688d8cb7ab9
2016-11-09 08:31:11 +01:00
Yuxuan 'fishy' Wang
75b98f77d9 bazel: add license to appropriate lib/ targets
This is to prepare for implementing genlicenses rule in bazel.

Change-Id: I60d79d5b53f9dd05c9f9ebfe6e6f658604c5a037
2016-09-26 16:42:38 +08:00
David Ostrovsky
a0ebd115f7 Bazel: Fix building GWT UI
Change-Id: I83dd5ca82868474ec0c6a7a77eed40e62e1570b1
2016-09-21 18:04:04 +02:00
David Ostrovsky
013af9ec3f Bazel: Build GWT UI
Port Buck gwt_binary() native rule: [1] to Skylark.

TEST PLAN:

  bazel build gerrit-gwtui:ui_optdbg

* [1] https://github.com/facebook/buck/issues/109

Change-Id: I24d11f10928a8000304bc4233156ddc50fad8931
2016-09-20 13:47:12 +02:00
David Ostrovsky
b81b4f75ae Implement Bazel build
To run the tests:

  bazel test //...

To build the Gerrit plugin API, run:

  bazel build gerrit-plugin-api:plugin-api_deploy.jar

To build the Gerrit extension API, run:

  bazel build gerrit-extension-api:extension-api_deploy.jar

TODOs:

Licenses
Reduce visibility (all public for now)
Generate HTML Documentation
Core plugins
gerrit_plugin() rule to build plugins in tree and standalone modes
GWT UI (only gwt_module() skylark rule is provided, no gwt_binary())
PolyGerrit UI
WAR
Publish artifacts to Maven Central
Ask Bazel team to add Gerrit to their CI on ci.bazel.io

Contributed-By: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: I9a86e670882a44a5c966579cdeb8ed79b1590de3
2016-06-14 21:12:02 +02:00