25 Commits

Author SHA1 Message Date
Shawn Pearce
06e069cfcc Update Buck and use gwt_binary()
Migrate gwt build tool chain to built in gwt_binary() rule [1].

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

Change-Id: I1f13f4d29864bc7e7278f8a2b2e39c882acf44aa
2014-05-19 11:41:31 -07:00
Jonathan Nieder
13d776504b Merge branch 'stable-2.9'
* stable-2.9:
  Include gerrit.war in api_{install,deploy}

Change-Id: I5f9222d82ec252a3cc3ee00b7e5a0f1feec64d2b
2014-05-01 13:48:59 -07:00
Jonathan Nieder
f24b7f9d92 Merge branch 'stable-2.8' into stable-2.9
* stable-2.8:
  Include gerrit.war in api_{install,deploy}

Change-Id: I7c4b47f1023b9db24d7742e3cf56d5b734184188
2014-05-01 12:44:01 -07:00
Dariusz Luksza
3ffc86a6a0 Include gerrit.war in api_{install,deploy}
This patch adds gerrit.war into api_{install,deploy} buck build step.
This allows third party maven based builds depend on gerrit.war
artifact.

Change-Id: I22c8d3339a1647913967e423e45462c2c5c255de
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
2014-05-01 01:32:15 +02:00
David Ostrovsky
21e231cd2b Buck: Add aliases for popular browsers
This change allows to compile optimized GWT version for popular brwosers:

  buck build chrome
  buck build firefox
  buck build safari

And no: IE is not among them:

  buck build ie
  BUILD FAILED: No directory ie when resolving target //ie:ie

Change-Id: I4f888bd114928555967022c5586e2b3ef16396b0
2014-03-27 01:20:35 +00:00
David Ostrovsky
e64e30dda4 Buck: Add all target
Change-Id: I6ceb667b286ed9d1bd9c9096fd708bde4082a18b
2014-03-25 16:30:51 +00:00
David Ostrovsky
acc959d645 Buck: add build for gerrit-plugin-gwtui
This plugin module was left out during Buck migration.

  $>buck build api

produces now plugin-gwtui.jar and plugin-gwtui-src.jar.

Buck Maven bridge was enhanced to {install|deploy} the new artifact to
remote or local Maven repositories:

  $>buck build install_api

deployes

  gerrit-plugin-gwtui-2.9-SNAPSHOT-sources.jar
  gerrit-plugin-gwtui-2.9-SNAPSHOT.jar

to local Maven repository.

Change-Id: Idae18f6df2e67fe53d57b8c35caa4226333e269b
(cherry picked from commit c8cffc8e928a9277621ffff6cb740f79cd662195)
2013-12-05 17:20:26 +09:00
David Ostrovsky
bb360ebe06 Buck: generate javadocs for plugin and extension API
buck build api

generates now javadocs.

  buck build api_install

installs all plugin/extension related artifacts with javadocs in the
local Maven repository.

Change-Id: Ifa6a8eb469f388e16449576ff2bff01a5dce67dd
2013-11-24 02:04:51 +01:00
David Ostrovsky
c8cffc8e92 Buck: add build for gerrit-plugin-gwtui
This plugin module was left out during Buck migration.

  $>buck build api

produces now plugin-gwtui.jar and plugin-gwtui-src.jar.

Buck Maven bridge was enhanced to {install|deploy} the new artifact to
remote or local Maven repositories:

  $>buck build install_api

deployes

  gerrit-plugin-gwtui-2.9-SNAPSHOT-sources.jar
  gerrit-plugin-gwtui-2.9-SNAPSHOT.jar

to local Maven repository.

Change-Id: Idae18f6df2e67fe53d57b8c35caa4226333e269b
2013-11-07 19:52:15 +01:00
Yuxuan 'fishy' Wang
ec4b06a6e2 REST endpoint for searching Gerrit documentation.
The documentation of this endpoint is available in
rest-api-docsearch[.txt|.html].

The UI of showing the search result and doing the search will be in a
separate change.

Change-Id: Ifa4f5a7d576ada7f88a4fa1b765a38cba6d7e964
2013-10-18 18:33:17 -07:00
Shawn Pearce
a7a3ee1e3a Update Buck to latest master
genrule() no longer supports running commands run only for the
side-effect with no output file. Actions like download_sources or
eclipse need to be handled using Python scripts executed from the
user's shell, otherwise Buck fails if caching is enabled.

Change-Id: I361fc20675f211e15e4ab7942ef52778d0a615c2
2013-09-20 19:41:26 -07:00
David Ostrovsky
a32af6920f Buck: add javax.http package to gerrit-plugin-api
Change-Id: I6399562053203f6b5ee21b3d7d84f82eed065b23
2013-08-13 09:18:06 +02:00
Christian Aistleitner
4c67736d8b Add basic init classes of gerrit-pgm again to plugin api
Since the tentative switch to Buck, plugins could no longer hook into
gerrit's init procedure, as the plugin api no longer exposed the
required classes. We re-add the required classes to make hooks-its
compile against the plugin api.

Change-Id: I0da8089c718f4a3c246ccc34cc45ae2f6b7d1aab
2013-08-06 09:39:50 -07:00
Shawn Pearce
e31a767d39 Move download and download_sources to //tools
These are already named using the alias in the .buckconfig.  Moving
them down to tools allows their program to drop a visbility rule, and
shortens the top level file a bit.

Change-Id: I4193249c02850cb7aca3bf7fab81113c5f7b7d8b
2013-07-30 17:15:59 +00:00
Shawn Pearce
064978650b Move Maven support to //tools/maven
Rewrite the Maven tool to accept a spec of things to process on the
command line and use $(location) in the invoking genrule() to locate
the necessary files from Buck.  This gets rid of special cases in the
mvn wrapper tool and allows the definition to be given completely from
Buck as part of the build description.

Maven needs to be single threaded to perform repository updates safely
so only one genrule() target is declared to buck for the deploy or
install action. The rule is given all artifact information in a single
pass, allowing the mvn.py wrapper to execute them.

Change-Id: Idbcf645b69280420987a0e8f52947ba93ac9e6f0
2013-07-29 17:30:58 -07:00
Shawn Pearce
3765bb8add Cleanup maven_deploy, maven_install build rules
Use GERRIT_VERSION rather than GERRIT_VER.  VER is not a commonly used
term to name the version string of a software product; VERSION is.

Make the maven_deploy and maven_install rules a little more typical
by passing in the target name separate from the action.

Change-Id: I13a5d94cf5b078cfcb91c69177cadfc2953db33e
2013-07-29 14:05:26 -07:00
Shawn Pearce
11d27c8ee8 Update Buck
Latest version of buck is faster than the prior version used by
Gerrit.  No-op updates when loading a debug version of the UI now take
only 1.804s on my laptop (previously 7s) and a draft UI compile is
only 24.659s (previously 39s).

The slow acceptance tests must now be excluded with `--exclude slow`.
Buck changed the meaning of the -e option to be --emulator, which is
unfortunately useful only for Android application developers.

genrule() now needs to use $(exe) to reference the binary to run,
offers $(location) to make it easier to find files in the build tree.

The empty srcs array is no longer required for genrule().  Buck has
determined it is sufficiently powerful with $(location) and deps that
requiring srcs is unnecessary.

Supporting .src.zip files in the srcs array of java_library() means
Gerrit no longer needs to run a separate genrule() to extract files
produced by ANTLR, or call javac inside of the BuckPrologCompiler
support glue.

Change-Id: Ib03042921a081b867a7aad0423bd45523e42917a
2013-07-26 18:11:51 -07:00
David Ostrovsky
6e6a967004 BUCK: deploy plugin api to local and remote maven repos
`buck build api_install` copies the artifacts to the local maven repository.

`buck build api_deploy` uploads the artifacts to the remote maven repository.
The type of the repo is induced from the Gerrit version name, i. e.
* 2.8-SNAPSHOT: snapshot repo
* 2.8: release repo

Change-Id: I063834bb39311a4d92f5fdbb183f70b1fb8418b6
2013-05-31 19:54:23 +02:00
David Ostrovsky
df36b6a972 Make source JARs for {extension,plugin}-api targets
BUCK is currently lacking native support for source jar generation.
Generate sources JARs for the API manually, until BUCK supports it.

Change-Id: I64fda0fdd82ca3ca37ac46d74e9550b2d9dddb39
2013-05-30 14:27:59 -07:00
Shawn Pearce
bd5629718f Update buck build for strict dependencies
java_library() targets must now list every dependency they need for
an import. This permits buck to run more targets in parallel as it
has a better view of the dependency graph, and opens the door for
buck to make even more optimizations in the future.

Change-Id: I132bf47a725e44ba5950ba6ca76bfa72c3876906
2013-05-16 01:14:27 +00:00
Shawn Pearce
7b55326512 Fix download target to only download binary JARs
Previously it also setup the prebuilt_jar() which isn't actually
necessary to execute the download. This reduces the size of the
command line passed into the child buck process.

Before this change not all libraries were downloaded during the
download target. Targets in the root of //lib were skipped due to
an incorrect regex passed to egrep. This has been fixed with the
new regex inside of download_all.py.

The initial binary download now requires ~59s on my home cable modem,
and pulls 84M.

Source JARs are now only downloaded when the user builds the
download_sources target.  This saves ~30s of setup time on a
the same connection and reduces the initial download by 16M.

Change-Id: Ie3bc97c9101c94f8bc4b89664bbd218323ad7230
2013-05-14 14:51:17 +00:00
Shawn Pearce
82e66ee4e5 Move Eclipse related stuff into tools/eclipse
Try to reduce the size of the top-level BUCK file by moving
anything that has to do with Eclipse project generation and
classpath management into tools/eclipse.

Change-Id: Id779eaff4fe732908b28a8e3441004e364b59e21
2013-05-10 12:42:54 -07:00
Shawn Pearce
57492bbaf6 Use __fake.?__ syntax for fake genrule outputs
These genrules do not produce an output file, instead they are run
by the developer to obtain their side-effects like building other
targets they happen to depend on.

Make it more clear these are fake by naming them __fake.?__, a name
we should never see appear in buck-out/.

Change-Id: Id749b095a0b2990f8d9c7e3942215fc7463a5255
2013-05-10 10:56:10 -07:00
Shawn Pearce
be1ebcd1c4 Fix :chrome and :firefox draft WAR builds
A last minute fix renamed the targets in gerrit-gwtui, breaking these
top-level rules. Correct them to point to ui_chrome and ui_firefox.

Change-Id: Ib1d5494548330fe3865288fa547c76c8adc16105
2013-05-09 08:03:29 -07: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