17 Commits

Author SHA1 Message Date
David Pursehouse
31c82401f0 Merge branch 'stable-2.15' into stable-2.16
* 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
2019-09-04 16:35:55 +09:00
David Pursehouse
3ab6d2d880 Merge branch 'stable-2.14' into stable-2.15
* 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
2019-09-04 14:30:47 +09:00
David Ostrovsky
20c2fd4f0b Bazel: Add fixes for --incompatible_load_{java|python}_rules_from_bzl
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
2019-09-02 00:42:25 +02:00
David Ostrovsky
e1359a35e1 Bazel: Harmonize names of external repositories
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
2018-06-13 11:38:03 +09:00
David Pursehouse
a5d14bdd0a Merge branch 'stable-2.14' into stable-2.15
* stable-2.14:
  Add integration test classes for "ssh index" commands
  Bazel: Harmonize names of external repositories

Change-Id: I081bb8c1fc148f7a86b82586a47ac445f521d8bb
2018-06-12 10:10:44 +09:00
David Ostrovsky
f98a60b35f Bazel: Harmonize names of external repositories
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
2018-06-08 19:33:01 +09:00
David Ostrovsky
cefa09d0d9 Dissolve gerrit-index top-level directory
Change-Id: Id480f7a9408389ef0af05cce567148799f66fc19
2017-10-31 11:02:36 -04:00
David Ostrovsky
0c36f1f74a Move gerrit-index/antlr3 sources to top-level antlr3 directory
Change-Id: I75d6bc4d7af2cb17622ef0f722f88f068509cb46
2017-10-31 11:02:36 -04:00
David Ostrovsky
c9266206a4 Bazel: Avoid UsePerfData generation
Change-Id: I6a0a177ce18476fa4a20336c8fa28fc86427b127
2017-08-30 09:17:31 +02:00
Dave Borowitz
e47be68709 Move general index classes from gerrit-server to gerrit-index
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
2017-08-14 15:40:09 -04:00
Dave Borowitz
62a434ec70 Start moving index code to gerrit-index directory
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
2017-08-14 11:20:27 -04:00
David Ostrovsky
fdbfcad77d Remove Buck based build
Bug: Issue 5302
Change-Id: I6e860446ef30ff0ad1c7c49fc0e39d39d921820b
2017-01-23 12:44:58 +00:00
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
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
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
David Pursehouse
12855752dd Bump antlr to version 3.5.2
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
2015-01-07 00:46:18 +00:00
Shawn Pearce
fd6bb9f6a5 Build with Buck
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
2013-05-09 13:40:36 +00:00