28 Commits

Author SHA1 Message Date
David Pursehouse
320fe96778 Update GWT version to 2.6.0 in debug launcher
Change-Id: I6502af84372248f890b3299f5c73fc1c47880ecf
2014-04-08 17:14:05 +09:00
David Ostrovsky
c2e42230fd Fix build
063e0fd4fd688c1963e5e0402bee1d27b57db009 removed
gerrit-acceptance-tests/configs rule, but missed to update
tools/eclipse/BUCK file.

Change-Id: Ia270966a9d81cc69257dfa1b15efc089d8d6121b
2014-01-31 18:27:09 +01:00
David Ostrovsky
a283507bcc Update GWT version to 2.6.0-rc3
GWT 2.6.0 has Java 7 support and other new features [1].

Internal Jetty version, shipped with GWT was updated to 8.1. This
version collides with the version that is used internally by Gerrit
(9.1).  To resolve the conflict, GWT's own Jetty version is stripped
from the gwt-dev.jar with maven_jar() method and Gerrit's own Jetty
used instead. Missing Jetty artifacts, needed for the GWT to run in
dev mode:

* jetty-webapp
* jetty-xml

are included now as dependency of gerrit-gwtdebug project.

New GWT version updates a number of dependencies that are used in
Gerrit [3]. Update them too.

EditIteratorTest test is failing with NSME Exception in gwt-test-utils
framework, so deactivate it for now [2].

[1] http://www.gwtproject.org/release-notes.html#Release_Notes_2_6_0_RC1
[2] https://code.google.com/p/gwt-test-utils/issues/detail?id=179
[3]
* Guava 15.0
* Protobuf 2.5.0
* ASM 4.1

Change-Id: I0fa96da6465d52febeae65168b0bd1c2913f6c7e
2014-01-23 06:39:08 +01:00
Dave Borowitz
88da34f7fc Support acceptance tests running with different configs
Store a library of configs to be used as the base gerrit.config during
tests. Specify at a per-acceptance_tests-rule level which of these
configs to generate rules for, passing in the config file via a system
property in a new rule named based on the config file name.

Include two additional labels for each test, "acceptance_config" and
"config_<name>", for including and excluding specific configs or all
non-default configs.

This preserves the behavior of running a single test class per VM, at
the cost of making it harder to run tests with nonstandard configs
from Eclipse. For that, developers can create custom run
configurations with different VM args passing the appropriate -D.

Change-Id: If29bcba26ac271479a63da836008b0f6608a1b6c
2014-01-16 15:39:28 -08:00
David Pursehouse
9db23781da Use consistent test site locations in documentation and debug configs
The naming of the test site is inconsistent in the documentation.  Some
parts refer to `gerrit_testsite` while other parts, and the default
debug configurations, refer to `test_site`.

Update the documentation and debug configs to use `gerrit_testsite`.

Change-Id: I5b1fb5c9dcc6c9a39e7d95e88d4e0ea9df384b09
2013-12-17 19:36:24 +09:00
Shawn Pearce
130afbd65e Don't put plugins into system classpath
Plugin code is often loaded into the workspace in Eclipse, and is
therefore part of the default project path. Detect this at startup
time by looking for gerrit.buck-out system property and building a
new classpath consisting only of the primary classes and JARs.

The GWT compiler, tests and plugins are excluded from the classpath,
preventing weird collisions with the dynamically loaded plugins from
$site_path/plugins.

PluginLoader recognizes the split output directory used by Eclipse and
loads the latest classes files ahead of anything from the JAR in
$site_path/plugins. This makes development of most code changes quick
by hiding the staleness of the installed JAR.

Change-Id: I4b879eebbcb332384c4e747d3f0c4b5c948c5fed
2013-11-30 15:34:54 -08:00
Shawn Pearce
9e4d5aa347 Isolate plugin class directories from each other
Configure Eclipse to compile/copy each plugin's classes and resources
into its own private classes folder.  This should fix the duplicate
resource warnings for about.md or other documentation and static image
assets.

Move test and utility classes into their own directories too. This
has no real impact on the runtime classpath at this time, but opens
the door to do something more creative later.

Change-Id: If2a048dfe0349f671a17f9e80d6f22a69a5c0ade
2013-11-30 13:17:18 -08:00
Shawn Pearce
cda2121828 Unify debug launch configs and auto-detect browser
Use the same permutation selector applied by the server at runtime to
automatically detect the browser making the request and build/refresh
that UI permutation.

Change-Id: I31603a80e23a8e4e2c46325be4dac808d8f98a5c
2013-11-29 18:14:57 -08:00
Bruce Zu
2d6c1e3a10 Fix build failure caused by missing 'gerrit-plugin-gwtui:client' target
In bb360ebe the target '//gerrit-plugin-gwtui:client' was renamed to
'//gerrit-plugin-gwtui:gwtui-api', but the 'tools/eclipse/BUCK' and
'tools/gwt-constants.defs' files were not updated to use it, thus
running 'tools/eclipse/project' failed with a "No such build target"
error.

Change-Id: I72307de9bac2484722b666ac0f5d0c0bb99b3906
2013-11-25 03:00:25 +00:00
Shawn Pearce
10f09d3d52 Require Java 7
Jetty 9 was built with compiler settings producing class files that
are not recognized by Java 6 runtimes.

Gerrit 2.9 will require Java 7 as its minimum runtime version.

Change-Id: Ifed3f9e07bf77a7a737b16c20e6e400acd990649
2013-11-16 19:58:03 -08:00
David Ostrovsky
0dd4462e97 gerrit-plugin-gwtui: make the project visible to eclipse
Change-Id: I67e32e675294b34a43954b69090a1551293dbe80
2013-11-08 19:59:07 +01:00
David Ostrovsky
e6bc8b523b Add unit test for EditDeserializer
Change-Id: I42ebb8a5f085066cd4d8dbe8cc953d7fcb849eef
2013-11-05 14:19:06 -08: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
David Pursehouse
7a16e859a4 Handle KeyboardInterrupt in Buck build wrapper scripts
Pressing Ctrl-C during the build results in an ugly Python
TraceBack.

Add handling of KeyboardInterrupt and print a useful message.

This fixes most cases, but there are still a few TraceBacks
coming from inside Buck.  These will need to be fixed upstream.

Change-Id: I3f0dc19f3be599460a2a6409642a70a195b50753
2013-10-18 15:10:25 +09:00
Shawn Pearce
b899eff7f3 Include lib/asciidoctor/java in the Eclipse classpath
Having these in the classpath permits the sources to be modified
in Eclipse just like any other Java source file.

Change-Id: I6256f5db793dd056a61e934720cb40056d50cfd0
2013-10-07 17:15:26 -07:00
David Pursehouse
6c25ea8fdd Fix a few coding style nits in Buck build Python scripts
- Prefix regex strings with `r`
- Remove unused imports
- Rename variables and parameters to avoid redefinition of
  built-in types `dir` and `type`

Change-Id: Ia21667b89631c751f241dd6499a2e460e3435697
2013-09-26 16:50:07 +09:00
Shawn Pearce
0672a19c54 Create buck.properties during tools/eclipse/project.py
Change-Id: I7fdccee7d08e2177a5bb4a4ecbcf17be9d4ada39
2013-09-24 12:27:31 -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
Shawn Pearce
71ab2f0f63 Simplify buck build eclipse by removing $OUT and $DEPS
It does not appear to be necessary to include either $OUT or $DEPS
in the command line when building the project and classpath files
for Eclipse. Omit these as $DEPS is starting to be deprecated by
Buck and will eventually disappear.

Change-Id: I40f9a357dfa8114efaf0212bd1ff4cb51197b67f
2013-08-14 16:25:58 -07:00
Shawn Pearce
b46c76ea89 Split acceptance tests into one target per test
Buck runs tests in parallel based on the targets declared in BUCK
files.  Making each test its own target allows the tests to run in
parallel in separate JVMs.  Parallel execution enables slow acceptance
tests to take less wall clock time when multiple cores are available.

Acceptance tests leak an entire server environment for every @Test
method run.  Fragmenting the tests into units allows them to be
garbage collected by the operating system when the test JVM dies.
This avoids stressing the Java GC with lots of garbage as more tests
pile into the finite heap space.

With this change and the newer version of buck, a clean build and
execution of all tests takes my laptop only 1m25s to execute when
running on battery.

Change-Id: Ia3f689a9e6ca6c620026cc720ccca924387e1363
2013-07-27 11:34:23 -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
Shawn Pearce
fb58a8cd87 Fix eclipse classpath to include GWT unit test deps
Change-Id: Ia8fe603e40a94be29962ee27c3f073f80958f392
2013-06-14 14:17:23 -07:00
Dave Borowitz
bc7a9ea30c Merge "Fix the buck springboard to always work from Eclipse" 2013-05-13 23:38:13 +00:00
Dave Borowitz
3d581315f5 Rename Buck Eclipse launch targets to buck_*
While we support both Buck and Maven, these names are confusing
because which target to launch depends how the project is imported
into Eclipse. This is especially bad for gwt_debug (Buck) vs.
gwtui_debug (Maven), but it's worth disambiguating for the rest as
well.

Change-Id: I058e2fddef26b182ae0836a3d8337671be62ac12
2013-05-13 15:39:41 -07:00
Shawn Pearce
e6f95721d7 Increase gwt_debug permgen to 128M
On Mac OS X the hosted mode crashed when it ran out of permgen space.
Give it 128M, this seems to resolve the errors on my MacBook.

Change-Id: I0bc24f03b1186b2f90077c0418f37de57b09dd3a
2013-05-13 13:12:20 -07:00
Shawn Pearce
6dec5bf32e Fix the buck springboard to always work from Eclipse
JettyDaemon invokes buck build to ensure GWT JS is up-to-date before
running the server.  To be completely compatible with the command line
build it uses the same PATH environment variable, ignoring the PATH
that is inherited from Eclipse.

Including the PATH as part of the genrule() command ensures buck will
rewrite the properties file anytime the user modifies the PATH, rather
than only when there are updates to GWT Java sources.

Using a properties file frees us from worrying about double quoting in
shell: once in the genrule, again in the script itself.

Using a single properties file ensures any GWT UI can be computed or
verified by JettyDaemon.  This change simplifies bootstrap for a
developer as they no longer need to build the UI before launching the
server from within Eclipse.  JettyDaemon now takes care of it.

Change-Id: If096a60d9a3f9d6d1502cc947b966109b4458717
2013-05-13 13:02:25 -07:00
Chirayu Desai
4c5ee48f47 Python3 support
* Mostly involves changing print to be a function, and adding
  "from __future__ import print_function" for copatibility.

Change-Id: I3129233726e0116a348753a2e2bb68806a08668c
Signed-off-by: Chirayu Desai <cdesai@cyanogenmod.org>
2013-05-13 14:07:42 +05:30
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