28 Commits

Author SHA1 Message Date
David Ostrovsky
93789062e2 Make mime-utils and gwtexpui available for plugin build
Change-Id: Iecb21e6b5cb2522b36a4644abc6eabe3cea9bdd8
2014-10-02 22:52:39 +02:00
David Pursehouse
c7e5397b93 Bump version to 2.11-SNAPSHOT
Change-Id: I124b7b79f836ec7c32835978354b735f76c849d3
2014-07-23 12:05:35 +09:00
David Ostrovsky
48a30b60c7 Buck: Export gerrit-antlr artifacts to plugin-api library
Because of missing export for gerrit-antlr artifacts in tree Gerrit
plugin cannot compile when they reference gerrit antlr classes. For
example reviewers plugin needs it.  Fix by exporting these classes,
as it is already the case for other projects, like gerrit-common.

Change-Id: I9e5832310271821c1bf355841ad32ff92f60000a
2014-07-15 23:41:45 +02:00
Edwin Kempin
0b54dcfe55 Update version to 2.10-SNAPSHOT in pom.xml files
Change-Id: I3209f16fbebd65ab476b4a4644823f0580e5785f
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-06-04 13:09:27 +00:00
David Pursehouse
063f658042 Merge branch 'stable-2.9'
* stable-2.9:
  Define mvn() function only once
  Add pom with meta-data for plugin projects
  Add more bug-fixes to 2.9 release notes
  No pom.xml in gerrit-plugin-gwtui to update

Conflicts:
	tools/version.py

Change-Id: I653f71d4203d516a8b8e35bebbb23b7534e433ee
2014-05-23 11:16:23 +09:00
Edwin Kempin
c7ddc2c0d1 Add pom with meta-data for plugin projects
These pom files are needed to be able to upload the plugin artifacts
to Maven Central.

Change-Id: I7c812538a4c2ddf684c0b6696fb7efc0a42002e4
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-05-21 16:24:39 +02:00
David Ostrovsky
3f3e9ad20c Remove unnecessary reference to $SRCDIR in Buck genrules
In new buck version `$SRCDIR` is not necessary any more.  Buck now
always runs genrule relative to the $SRCDIR link forest.

Change-Id: Iee88bb575c7baa62bc087527927be5347a7f8f95
2014-03-26 18:20:13 -07:00
David Ostrovsky
9bbede1b0b Buck: Adapt GWT plugins to changed lib name
Change-Id: I779c1386a38966d80b4d1bab172dd1d1463778b1
2014-02-19 07:03:48 +01:00
Dave Borowitz
72221a738d gerrit-plugin-api: Add dep on new gerrit-plugin-gwtui package
Change-Id: Ie243f13ace2f9d526b49a70c4a52fbab0fe9bd40
2014-02-18 16:59:25 -08:00
David Ostrovsky
e01d9b7f20 Bump Jetty version to stable 9.1 and Servlet API to 3.1
Change-Id: Ic6a374afa978e66ec1a04a2b39801da158ba31d7
2014-01-04 22:28:10 +01:00
Shawn Pearce
05cb053378 Save GWT compile time by avoiding javac
GWT only needs the rebind code for CSS and ServerLinker to be
precompiled as bytecode. Save build time by passing no source
files to the java_library() used by gwt_module().

For a full draft build of ui_safari this cuts the refresh time
down from 32.015s to 26.158s on my MacBook. Saving 6s on each
UI reload adds up during development.

The common annotations need to be provided as bytecode, avoiding
spurious warnings from GWT when there is a Java syntax error.

Change-Id: I37826498650c65c05303e7d4d1177d05781c56f6
2013-11-30 11:06:50 -08:00
Shawn Pearce
ab2319061d Merge "Update Buck" 2013-11-30 02:11:54 +00:00
Shawn Pearce
4e1a8bc63d Update Buck
Buck changed export_deps from a boolean to be exported_deps, a list of
dependencies that are to be added to deps and also exported.  This
allows libraries to have dependencies for implementation use only, but
not expose them to callers for linkage.

exported_deps aren't transparently transitive anymore.  This mostly
impacts the plugin-api:lib rule.

This is the first time Gerrit is using upstream Buck with no patches.

- Java memory settings for Buck can now be supplied in a project
  specific file using `.buckjavaargs` in the root directory.  The file
  replaces the `.buckrc` previously supported by Gerrit's fork.

- Temporary directories for java_application() invoked from genrule()
  is now supplied as part of the arguments using $TMP.  This removes
  one of the patches Gerrit had for Buck.

- Unit tests use the system temporary directory during testing.  This
  can be faster if the temporary directory is a tmpfs.  Unfortunately
  not all passing tests clean up after themselves, making it possible
  to exhaust system memory and swap with useless tmpfs contents.
  Using the system temporary directory for tests removes another patch
  Gerrit had on top of Buck.

Change-Id: I3a9fe4aab0a33a8673df727e618122027a742638
2013-11-29 10:50:59 -08:00
Shawn Pearce
72fb6cc514 Remove unused .gitignore
These were necessary only for the Maven based build.

Change-Id: Ie26669e6ccae60a52d2db1b8ad362e2fa88a26f2
2013-11-28 22:56:51 -08:00
Shawn Pearce
154d4181a8 Fix plugin references to moved :plugin-api
The plugin api moved into the gerrit-plugin-api package.
Change the reference created by gerrit_plugin() to match.

Change-Id: I390a22f512835847367ae2993a7a9bddf9d11b5c
2013-11-24 13:45:30 -08: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
dcee57212f Delete Maven based build
The Maven build does not work since the introduction of CodeMirror.
Remove the build until to prevent people from trying to use a broken
build process.  If buck is rejected this commit will be reverted, and
we will attempt to fix the Maven build to include CodeMirror.  If buck
is accepted, we just saved time by avoiding a messy Maven change.

Change-Id: I147d8d1741d52f59de1d2ddce8e5e82583990c14
2013-05-21 20:28:56 -07:00
Shawn Pearce
9240c299f0 Begin 2.8
Change-Id: Ie0bc733853be435fba147dd64ef8cbc5a0027ee0
2013-05-06 19:39:10 -07:00
Dave Borowitz
7f53c5696f Build gwtexpui from in-subtree version
Rename the module and artifact to gerrit-gwtexpui.

Change-Id: Ica1b7aae7777b4188d7d557a9e7fef0c37bca5c7
2013-04-11 14:30:34 -07:00
Shawn Pearce
d47ca8a66d Start 2.7 development
Change-Id: I08dc590bb1f62af67d88eb11313d5d4cfe2423c4
2013-03-21 12:12:47 -07:00
Luca Milanesio
737285df3f Allow plugins to contribute InitStep to Gerrit init.
Plugin has to include a class that implements
com.google.gerrit.pgm.init.InitStep and specifying
the class name into the Plugin MANIFEST.MF.

Plugin InitStep is getting instantiated using the
Gerrit PGM injector and then is able to access
the same init objects.

Example:
--------
public class InitJira implements InitStep {
  private ConsoleUI ui;

  @Inject
  public InitJira(final ConsoleUI ui, final Section.Factory sections) {
    this.ui = ui;
    this.sections = sections;
  }

  @Override
  public void run() throws Exception {
    ui.header("Jira integration");
    // Jira-specific init steps.

    Section jira = sections.get("link", "jira");
    // Jira-specific link expansions
  }
}

MANIFEST.MF:
------------
Gerrit-InitStep: com.googlesource.plugins.jira.InitJira

Change-Id: I84fcb9acd6845c706961657219a14570e2060b0f
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
2012-10-22 10:07:31 -07:00
Edwin Kempin
011e132308 Use juniversalchardet from Maven central
juniversalchardet is now available in Maven central [1].
Update the groupId of juniversalchardet so that juniversalchardet
from Maven central is used.

So far juniversalchardet was retrieved from a Maven repository [2]
that contains Gerrit dependencies which are not available in Maven
central [3].

[1] http://code.google.com/p/juniversalchardet/issues/detail?id=7
[2] http://gerrit.googlecode.com/svn/mavenrepo/
[3] http://code.google.com/p/gerrit/issues/detail?id=422

Bug: issue 1543
Change-Id: I2f941fc129c5a191c5808a6073a5ffbee00e3509
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2012-08-29 12:32:43 +02:00
Edwin Kempin
20f99685d9 Update versions in pom's to start Gerrit 2.6 development
Change-Id: I4fb8cb41250c5b640a8d9e47caf97dc4670ff428
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2012-08-22 14:09:52 +02:00
Shawn O. Pearce
2e1cb2b849 Back in-memory caches with Guava, disk caches with H2
Instead of using Ehcache for in-memory caches, use Guava. The Guava
cache code has been more completely tested by Google in high load
production environments, and it tends to have fewer bugs. It enables
caches to be built at any time, rather than only at server startup.

By creating a Guava cache as soon as it is declared, rather than
during the LifecycleListener.start() for the CachePool, we can promise
any downstream consumer of the cache that the cache is ready to
execute requests the moment it is supplied by Guice. This fixes a
startup ordering problem in the GroupCache and the ProjectCache, where
code wants to use one of these caches during startup to resolve a
group or project by name.

Tracking the Gauva backend caches with a DynamicMap makes it possible
for plugins to define their own in-memory caches using CacheModule's
cache() function to declare the cache. It allows the core server to
make the cache available to administrators over SSH with the gerrit
show-caches and gerrit flush-caches commands.

Persistent caches store in a private H2 database per cache, with a
simple one-table schema that stores each entry in a table row as a
pair of serialized objects (key and value). Database reads are gated
by a BloomFilter, to reduce the number of calls made to H2 during
cache misses. In theory less than 3% of cache misses will reach H2 and
find nothing. Stores happen on a background thread quickly after the
put is made to the cache, reducing the risk that a diff or web_session
record is lost during an ungraceful shutdown.

Cache databases are capped around 128M worth of stored data by running
a prune cycle each day at 1 AM local server time. Records are removed
from the database by ordering on the last access time, where last
accessed is the last time the record was moved from disk to memory.

Change-Id: Ia82d056796b5af9bcb1f219fe06d905c9c0fbc84
2012-05-24 18:09:46 -07:00
Anatol Pomazau
f7d9ca5db4 Fix the name of IDEA project files
Change-Id: I116cb1e380ab65a3d8e5ea6d9aff808f98581dfb
2012-05-15 10:10:05 -07:00
Shawn O. Pearce
2aefecf604 Add support for HTTP plugins
Plugins may contribute to the /plugins/NAME/ URL space by providing
a ServletModule in the manifest using Gerrit-HttpModule and binding
servlets and filters using Guice bindings.

All names are relative to the plugin's directory, so

  serve("/").with(IndexServlet.class);

will handle /plugins/NAME/ and not "/" on the server. This makes a
plugin automatically relocatable to match its SSH command name or
the name in $site_dir/plugins.

Change-Id: I17e3007f0310d2bf4989d652f18864a77c5d5f2e
2012-05-10 08:49:29 -07:00
Shawn O. Pearce
9c11044bf7 Ignore Java settings files in gerrit-plugin-api
These settings are created by m2eclipse but don't matter on
this module because there are no Java source files here.

Change-Id: I3c21c40ad5200c320ecb4189aef3618d10333855
2012-05-09 19:21:11 -07:00
Shawn O. Pearce
980efdb376 Define gerrit-plugin-api as a subset API
This is a new JAR produced by the build that contains almost all of
the code that the corresponding WAR contains at runtime. This permits
plugin authors to compile against this single interface JAR, and then
load their plugin into a running server that uses the real WAR.

Having the API be a single JAR simplifies plugin development, Maven
users can depend on this single JAR using the provided scope. Other
IDE users can just make a new Java project and add this single JAR
as the only dependency.

Change-Id: Ie045ec4202d44b78b75ccb4af000e13c1e7378ce
2012-05-08 11:00:39 -07:00