* stable-2.15:
Bazel: Add fixes for --incompatible_load_{java|python}_rules_from_bzl
Bazel: Bump minimum supported version to 0.29.0
Lucene index configuration and docs.
Change-Id: I6c597cbc89fafece83c374e9b36c4c4c0126704f
* stable-2.14:
Bazel: Add fixes for --incompatible_load_{java|python}_rules_from_bzl
Bazel: Bump minimum supported version to 0.29.0
Lucene index configuration and docs.
Change-Id: I0a8c17c853746ca7367cc4b723b18f8d0f2b6094
This change is fixing "All Java build rules should be loaded from
Starlark" warning flagged by latest buildifier version: [1]. Python
rules are now also loaded from the Starlark.
Also extract codemirror library import to BUILD file. This is needed to
avoid cycle in the workspace file, after importing java rules from
Starlark.
[1] https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#native-java
Change-Id: I36192c9465d988b25cf09c250e110f15850910cd
Recent Bazel versions support dash character in external repository
names. Consistently use them with one exception: javax_inject. This is
needed to match the name in the rules_closure.
Change-Id: I1e75690fe1ee2ab32fffe07c0c30dbed84753960
Recent Bazel versions support dash character in external repository
names. Consistently use them with one exception: javax_inject. This is
needed to match the name in the rules_closure.
Change-Id: I1e75690fe1ee2ab32fffe07c0c30dbed84753960
These classes do not depend on any Gerrit server functionality, and
could even be used to define an index without depending on the
gerrit-server package. This allows for a clearer separation of BUILD
rules; the QueryParser and antlr targets don't escape the gerrit-index
package.
The general layout thus far is to put index definition code in
com.google.gerrit.index, and query-related code (predicates, etc.) in
com.google.gerrit.index.query.
The gerrit-index package is still of limited utility on its own, because
QueryProcessor and InternalQuery still live in the server package, and
untangling their dependencies will still be a bit more work.
Change-Id: I3c4616d08ecf19d5ccd1b9b91b3fd0b1fcedd901
Start by renaming the existing gerrit-antlr package to gerrit-index.
This naming reflects what the package is used for, not the
implementation detail that ANTLR is used for the parser.
Also rename the server.query package to index.query, to match the
top-level directory name, rather than mixing into the server package
"owned" by gerrit-server.
Move QueryParserTest into gerrit-index, next to the code it's testing.
Change-Id: I629fe4c7d15c76767a190ccf180772b8d7c96984
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
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
Update antlr and antlr-runtime to 3.5.2; the latest release before the
4-series which is released with a different artifact Id.
Version 3.2 seems to have been the latest version that was released with
a corresponding version of stringtemplate, so update stringtemplate to
version 4.0.2 which is the latest available.
Change-Id: I7c2af7d6747c73ae15c2fed4507ad8dcde8486ac
Implement a new build system using Buck[1], Facebook's
open source clone of Google's internal build system.
Pros:
- Concise build language
- Test and build output is concise
- Test failures and stack traces show on terminal
- Reliable incrementals; clean is unnecessary
- Extensible with simple blocks of Python
- Fast
buck: clean: 0.452s, full 1m21.083s [*], no-op: 7.145s,
mvn: clean: 4.596s, full 2m53.776s, no-op: 59.108s,
[*] full build includes downloading all dependencies,
time can vary due to remote server performance.
Cons:
- No Windows support
- No native Maven Central support (added by macros)
- No native GWT, Prolog, or WAR support (added by macros)
- Bootstrap of buck requires Ant
Getting started:
git clone https://gerrit.googlesource.com/buck
cd buck
ant
Mac OS X:
PATH="`pwd`/bin:/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands:$PATH"
Linux:
PATH="`pwd`/bin:$PATH"
Importing into Eclipse:
$ time buck build :eclipse
0m48.949s
Import existing project from `pwd`
Import 'gerrit' (do not import other Maven based projects)
Expand 'gerrit'
Right click 'buck-out' > Properties
Under Attributes check 'Derived'
If the code doesn't currently compile but an updated classpath
is needed, refresh the configs and obtain missing JARs:
$ buck build :eclipse_project :download
Running JUnit tests:
$ time buck test --all -e slow # skip slow tests
0m19.320s
$ time buck test --all # includes acceptance tests
5m17.517s
Building WAR:
$ buck build :gerrit
$ java -jar buck-out/gen/gerrit.war
Building release:
$ buck test --all && buck build :api :release
$ java -jar buck-out/gen/release.war
$ ls -lh buck-out/gen/{extension,plugin}-api.jar
Downloading dependencies:
Dependencies are normally downloaded automatically, but Buck can
inspect its graph and download missing dependencies so future
compiles can run without the network:
$ buck build :download
[1] http://facebook.github.io/buck/
Change-Id: I40853b108bd8e153cefa0896a5280a9a5ff81655