26 Commits

Author SHA1 Message Date
David Ostrovsky
7a29533643 Build Gerrit in headless mode
buck build headless

produces binary artifact without GWT.

Change-Id: Ic98312e9924d32057d6876effbdf12e489d44a8b
2015-03-04 10:59:02 +09:00
Shawn Pearce
16570463ab Add buck build soyc to output GWT split point report
The GWT compiler can output a report (or "story of your compile"),
describing the size of the JavaScript and which source classes
contributed to the overall download size. This is useful for
optimizing code splits in Dispatcher, and generally understanding
the impact of linking code together.

Only the "Split Point Report" is created.
The "Compiler Metrics" are not output.

The report is very slow to create, so it is not done by default.

Change-Id: I6ce86d65ee5f3e4bdba573d1f777ccc59767341d
2015-01-15 04:40:28 +00:00
David Ostrovsky
11c56681b0 Update GWT to 2.7
As pointed out in this thread on GWT-discuss development group [1],
gwt-dev is going to be unbundled in 2.7 release. That means that we
would have to supply its dependencies explicitly.  To start with we
need to pass in ASM library.

It's unclear though, if we need asm-commons and asm-xml as it compiles
without it, but corresponding parent-pom contains it [2].

GWT unit tests were disabled as gwt-test-utils doesn't seem to work yet
against upcoming GWT 2.7 release. Issue was filed upstream [3].

As was pointed out in this thread [4], codeserver is now shipped in
gwt-dev.jar as well. Stop fetching codeserver.jar in addition and use
the bits from gwt-dev.jar.

[1] https://groups.google.com/d/topic/google-web-toolkit/LwXXQCG_I_k/discussion
[2] http://repo1.maven.org/maven2/org/ow2/asm/asm-parent/5.0.3/asm-parent-5.0.3.pom
[3] https://github.com/gwt-test-utils/gwt-test-utils/issues/68
[4] https://groups.google.com/d/topic/google-web-toolkit-contributors/pFYPE7Uoub8/discussion

Bug: issue 3008
Bug: issue 3027
Change-Id: Ib8f9ed0c767e9f41f104253fdc8b74a8cbbe38ab
2014-12-04 11:23:01 +09:00
Yuxuan 'fishy' Wang
f780397780 Add buck rule to generate docs for static hosting.
Add rule to build search-free documentation for static hosting, and update
dev-release documentation to reflect the new rule.

Change-Id: Ifc9284d3c44349e3099ad582fcc14ba27695f30a
2014-09-05 14:19:15 -07:00
David Ostrovsky
12968f26df GWT DevMode is dead; set up SuperDevMode
The codeserver runs separately and cannot easily be embedded in Gerrit
because it depends on an outdated version of Jetty. We may change this
behavior when GWT is updated.

Prerequisite is to download gwt-codeserver.jar and dependencies:

  buck build codeserver

Start CodeServer with new launch configuration:

  tools/eclipse/gerrit_gwt_codeserver.launch

And follow the instructions: [1].

[1] http://stackoverflow.com/a/18333050/116472

Inspired-By: Thomas Broyer <t.broyer@gmail.com>
Change-Id: Ieff7190db6bc151eae1274105ccf828eaa652027
2014-08-15 21:33:18 +00:00
David Ostrovsky
0927a52b64 Buck: Share buck cache directory between multiple source trees
Change-Id: I37c29caf4aaac13a77c8d12af89816d929af67b2
2014-06-12 09:58:24 +02:00
David Pursehouse
14bdaef845 Merge branch 'stable-2.9'
* stable-2.9:
  Fix GitWeb link for parent commits
  Move gerrit.war from api_{install,deploy} to war_{install,deploy}
  New review UI: Fix display of large avatar image in user popup panel

Conflicts:
	.buckconfig

Change-Id: I3ec139fb5b95fc443be834fba8866528e7a51ab2
2014-05-21 15:39:04 +09:00
David Ostrovsky
358a4582fd Move gerrit.war from api_{install,deploy} to war_{install,deploy}
I22c8d3339 added unconditionally installation of gerrit.war to API install
process.  Because it depends on '//:release' target all core plugins,
documentation and optimized permutations of all supported GWT client
agents must be built to update a new version of plugin API.

In some cases it cannot be built at all, i.e. if Gerrit tree was cloned
non-recursively, and core plugins are not available.

Very repetitive tasks in development process like building new version of
plugin API that other plugins depend on should be very easy and fast doable.

Decouple installation and deployment of gerrit.war in its own targets:

  $ buck build war_{install,deploy}

Change-Id: I7fce3b126621580dde43104aa811d704cf6e8997
2014-05-20 06:41:08 +00: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
Saša Živkov
9cd9e87e03 Cache buck build results locally by default
Use buck-out/cache folder for local cache of buck build results.
Since we don't (yet) have a shared set of Cassandra cache nodes,
using a local cache is a good default. This will speed up build
times when switching between different version of Gerrit (for example
master/stable) and also when running "git bisect".

Change-Id: Id23c6053e7cb0498d129345f6ead18288d0e9701
2013-12-11 13:21:39 +01:00
David Pursehouse
c08d03ebc4 Buck: Add 'withdocs' as an alias for '//:withdocs'
Also expand the documentation in dev-buck to include this
build target.

Change-Id: I564734ca291b081db6a030978b631ae732b19bc8
2013-12-10 18:26:41 +09: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
Sasa Zivkov
a3b3135228 Let buck ignore the .git folder
According to [1] buck makes no assumption about source code versioning
systems which means that it will also scan the .git folder for the file
system monitoring (buckd) and when searching for the BUCK files.

[1] http://facebook.github.io/buck/concept/buckconfig.html

Change-Id: Ic9248326232684f8b85a951f5b01b542127a080a
2013-09-17 08:48:35 +02:00
David Pursehouse
f635b5785a Buck build: Add 'docs' as an alias for Documentation:html
Now it is possible to build the documentation from the Gerrit
root folder with:

 $ buck build docs

Change-Id: I995d792167abaef2b7962c620a9520d4d930ede5
2013-09-05 09:47:36 +09:00
Shawn Pearce
5047911dba Rename DEFS files to *.defs
The build system used mixed names for essentially the same things.
Rename all DEFS files to *.defs matching the handful of other files
that are already using this convention.

Change-Id: I3269bd5db5d8d83f5e192ea910f19431c2a4a1cf
2013-07-30 17:18:33 +00: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
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
Shawn Pearce
279e07de52 Move //lib/DEFS to //tools/DEFS
The macro rules this file defines have nothing to do with the
third-party dependency libraries, but instead are global definitions
used throughout the Gerrit build process. Most build tools are
hidden under //tools, so move these definitions to that directory.

Change-Id: I5e95d7cef734228ca818428a266afc0ac9fa0385
2013-05-18 14:10:44 -07: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
4ce73cc4ba Sort aliases in .buckconfig
Since we have more than 1, lets try to keep them sorted.

Change-Id: I6b291a597b39cb36dd39e607badcf2f4ad4f9b2f
2013-05-13 19:35:52 -07:00
David Pursehouse
fd34feabfd Add "api" as an alias for "//:api" in the buck configuration
Change-Id: I53d105263cf79584f7983e9fe83cac0dae2de041
2013-05-13 09:25:23 +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
39bdec8add Declare aliases for the major top-level targets
This avoids needing to type ":" in front of the name to build.
Eventually I can move the eclipse targets down into a different
area and hide them from the top level file.

Change-Id: I9781099348cbe969bfd9c1f38711c37e1b92d3e2
2013-05-10 11:37:05 -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