171 Commits

Author SHA1 Message Date
Shawn Pearce
60bdd68aa5 Merge "Fix download target to only download binary JARs" 2013-05-14 15:25:43 +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
6d9ad02f9b Merge "Support downloading from other Maven repositories" 2013-05-14 07:00:32 +00:00
David Pursehouse
72a1701927 Add missing import of symlink in download_jar.py
Missing import of `symlink` from the `os` module causes an error:

  Traceback (most recent call last):
    File "/work/gerrit/tools/download_jar.py", line 108, in <module>
      symlink(cache_ent, args.o)
  NameError: name 'symlink' is not defined

Change-Id: Ie0d6b6dbdd211f830a4443c98bd5ea3b3ab56e3e
2013-05-14 15:47:16 +09:00
Shawn Pearce
1b89f85874 Support downloading from other Maven repositories
Developers may now request buck to use a local mirror by setting
the URL into local.properties, a file already ignored under the
current buck build process, e.g.:

  download.GERRIT = http://nexus.my-company.com/
  download.MAVEN_CENTRAL = http://nexus.my-company.com/

To support this usage buck now passes to download_jar.py only the name
of the repository in the URL.  download_jar parses local.properties
(if present) and replaces the "MAVEN_CENTRAL:" prefix with the URL
supplied by the user.

Because the URL can vary cache entries in buck-cache are now using the
SHA-1 we expect/verify against, instead of the SHA-1 of the URL.  This
makes it easier to find a specific JAR in the cache.  The artifact,
version and SHA-1 as named in the maven_jar() rule are the strings
used in the file name in buck-cache.

If no SHA-1 verification happens (e.g.  source attachment JARs that
are not included into the build) then sha1(canonical_url) is used.
Here the canonical URL uses the repository id prefix string, e.g.:

  MAVEN_CENTRAL:org/apache/mina/mina-core/2.0.5/mina-core-2.0.5-sources.jar

Change-Id: I5a469ab15fd36b81bf76f6b51e1110dfdcf04c86
2013-05-13 23:45:13 -07:00
Shawn Pearce
7e2eff6e4d Use --proxy-anyauth when running curl
This option should permit curl to pick up proxy authentication
information from ~/.netrc rather than requiring it to be embedded into
the http_proxy environment variable.  This is important on shared user
systems where the environment of a process is typically readable by
any user, while ~/.netrc is usually set with a mode 0600.

Change-Id: I995e6c8e9677dbda14a4e79942eed6682e381c36
2013-05-13 19:47:49 -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
f62ed18438 Fix broken print function in download_jar.py
Change-Id: I1b8459166115ae201bf20d3387e35b5db8a11225
2013-05-13 15:42:58 -07: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
Shawn Pearce
c676e446ce Merge "Python3 support" 2013-05-13 16:38:17 +00:00
Shawn Pearce
762678c2dd Merge "Print the url of dependency JARs being downloaded in buck build" 2013-05-13 16:01:04 +00: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
David Pursehouse
bae05fd5c1 Print the url of dependency JARs being downloaded in buck build
When the build is downloading a lot of dependency JARs, there is
no output on the console.

Print the URL of the file that is being downloaded.

Change-Id: Id1bbecf3c38818b6bffb23cf0bef13ee00002a47
2013-05-10 10:25:14 -07:00
Shawn Pearce
0c2467a9bf Merge branch 'stable-2.7'
* stable-2.7:
  Fix spelling errors in access-control.txt
  Access control documentation: Formatting
  Access control documentation: Clean up of categories
  Access Control Documentation: Explain special and magic refs
  Set core plugins to correct revisions for 2.6-rc2
  Update developer instructions for cloning the Gerrit project
  Fix Windows build

Conflicts:
	Documentation/access-control.txt

Change-Id: I1ee212d357f0da6d006c5fef9427a4b7138c7536
2013-05-10 10:06:20 -07:00
Shawn Pearce
98cd151eb1 Merge branch 'stable-2.6' into stable-2.7
* stable-2.6:
  Fix spelling errors in access-control.txt
  Access control documentation: Formatting
  Access control documentation: Clean up of categories
  Access Control Documentation: Explain special and magic refs
  Set core plugins to correct revisions for 2.6-rc2
  Update developer instructions for cloning the Gerrit project
  Fix Windows build

Change-Id: Ic6a27ddffed8521f10aaca9ca6619840174be1ff
2013-05-10 09:58:57 -07:00
David Pursehouse
2879877ef4 Catch CalledProcessError when downloading dependencies with buck
When calling curl with check_call, CalledProcessError can be
raised.  Catch it to avoid an ugly python traceback in the build
log.

Change-Id: Icd56b94391fc6fb51e4d84889b123e892d15bc5b
2013-05-09 15:49:12 +01: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
Orgad Shaneh
60e5b36f1b Fix Windows build
perl does not allow -i without backup extension on Windows

Change-Id: I650e261dc37e1fa578ce5c9e4ca8fecc53f39dd3
2013-05-08 17:12:51 +03:00
Shawn Pearce
bd4e609c3d Always run acceptance tests
I can't trust Maven to run the tests with -Pacceptance. At least
half of my attempts produced no tests run. This is of zero value to
me as a build system, but our contributors have determined Gerrit
will remain stuck with Maven.

Stick contributors with the burden of running the acceptance tests
by default. This way we know the tests are executed.

Change-Id: I678e42651efc162f66929c605247583d7ef6cc8a
2013-05-06 15:36:46 -07:00
Shawn Pearce
edf82ea721 Update plugin versions during release
Change-Id: Ia8c7c1d5a2a8e6ca69c6f2f64d041e49f916484b
2013-05-06 15:36:46 -07:00
Shawn Pearce
b0c599d1fd Ensure core plugins are bundled by Maven
Require the core plugins whenever a Gerrit build is run.
These are pulled into the Maven Reactor by being inside
of git submodules. Plugins can be omitted by passing a
-Dgerrit.plugins.skip=true flag on the command line.

Change-Id: I7246389bcae9e98d5f1d46208ff515855eb7c474
2013-05-06 15:36:46 -07:00
Shawn Pearce
c5f4ab29e6 Always run acceptance tests when creating a release build
Change-Id: I19fc734a5ab64ea7e18d828d6c76cbabde6d8d87
2013-05-06 15:36:34 -07:00
Shawn Pearce
8d6dcac0b6 Always build all components of Gerrit
If we are committed to Maven as a build tool we need to have Maven
always building the correct targets when a user runs `mvn package`.
Include all modules as part of the build, all of the time.

Change-Id: I23f02cf040437bfe91e8badb6fdb6f765e707b6f
2013-05-06 15:36:34 -07:00
Shawn Pearce
6a971631df Always include documention in the build
By default run AsciiDoc and package the documentation as part of
the WAR. This ensures the default `mvn package` will include user
documentation, as folks have come to expect it to exist in builds.

If AsciiDoc is not available documentation can be skipped by
passing -Dgerrit.documentation.skip=true on the command line.
This naming convention matches with -Dmaven.test.skip=true as
a way to avoid running unit tests.

Change-Id: Ic433c5bb291c9abb48117d61c2eabc031a5c5ca0
2013-05-06 15:36:21 -07:00
Shawn Pearce
ccb099b3f2 Always run acceptance tests
I can't trust Maven to run the tests with -Pacceptance. At least
half of my attempts produced no tests run. This is of zero value to
me as a build system, but our contributors have determined Gerrit
will remain stuck with Maven.

Stick contributors with the burden of running the acceptance tests
by default. This way we know the tests are executed.

Change-Id: I678e42651efc162f66929c605247583d7ef6cc8a
2013-05-06 15:23:07 -07:00
Shawn Pearce
5f59e528c5 Update plugin versions during release
Change-Id: Ia8c7c1d5a2a8e6ca69c6f2f64d041e49f916484b
2013-05-06 14:59:24 -07:00
Shawn Pearce
bf8ebbe90a Ensure core plugins are bundled by Maven
Require the core plugins whenever a Gerrit build is run.
These are pulled into the Maven Reactor by being inside
of git submodules. Plugins can be omitted by passing a
-Dgerrit.plugins.skip=true flag on the command line.

Change-Id: I7246389bcae9e98d5f1d46208ff515855eb7c474
2013-05-06 14:35:50 -07:00
Shawn Pearce
ed95865d00 Always run acceptance tests when creating a release build
Change-Id: I19fc734a5ab64ea7e18d828d6c76cbabde6d8d87
2013-05-06 12:47:50 -07:00
Shawn Pearce
32b461e7fe Always build all components of Gerrit
If we are committed to Maven as a build tool we need to have Maven
always building the correct targets when a user runs `mvn package`.
Include all modules as part of the build, all of the time.

Change-Id: I23f02cf040437bfe91e8badb6fdb6f765e707b6f
2013-05-06 12:25:49 -07:00
Shawn Pearce
05751387f0 Always include documention in the build
By default run AsciiDoc and package the documentation as part of
the WAR. This ensures the default `mvn package` will include user
documentation, as folks have come to expect it to exist in builds.

If AsciiDoc is not available documentation can be skipped by
passing -Dgerrit.documentation.skip=true on the command line.
This naming convention matches with -Dmaven.test.skip=true as
a way to avoid running unit tests.

Change-Id: Ic433c5bb291c9abb48117d61c2eabc031a5c5ca0
2013-05-06 12:16:45 -07:00
Edwin Kempin
7e20897c51 Adapt dbg launch config to inclusion of gwtexpui as gerrit-gwtexpui
Change-Id: Id3c4578a0ffed1ac267580992d09fa6a6c67e2d1
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-04-12 09:31:57 +02:00
Edwin Kempin
2ca5ef7edb Exclude all pom.xml files that are archetype resources in version.sh
The versions in the pom.xml files that are archetype resources should
not be modified by the tools/version.sh script.

Change-Id: I47d6af01c56ddb7a92bc0cf27bedb2bcba5a5d5a
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2012-12-06 17:41:54 +01:00
Steffen Gebert
da631c788c Abort release, if asciidoc is missing
It is hard to figure out, why no documentation is built, if asciidoc is
not installed on the build system.

Thus, abort the build and advise to either install asciidoc or add the
--without-documentation parameter.

Change-Id: I12c5c71d4f36333eabf01515344111ee9436a07c
2012-11-05 08:17:46 +01:00
Edwin Kempin
0334815ae9 Exclude pom in archetype resources from version replacement
The 'tools/version.sh' script updates the versions in all pom.xml
files. gerrit-plugin-archetype has a pom.xml as resource that is used
to generate new plugin projects. This pom.xml file should not be
touched by 'tools/version.sh'.

Change-Id: I6f2d751b941bf3a32d2c02864f95e6e04420fa40
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
2012-07-31 15:22:58 +02:00
Edwin Kempin
8645dd906c Merge "Package core plugins in Gerrit war and install them on init" 2012-07-30 02:58:05 -07:00
Edwin Kempin
67e09dc69e Package core plugins in Gerrit war and install them on init
This change adds a new Maven project 'gerrit-package-plugins' which
adds the core plugin jars to the Gerrit war file. Inside of the
resulting Gerrit war file the plugins are stored under
'WEB-INF/plugins/'.

The init command will now look at this folder during the site
initialization and offer the plugins for installation.

Change-Id: Ia6c28ef13bbbb7a0358c84e785b8422a2e6a47b3
2012-07-26 09:05:28 +02:00
Chad Horohoe
07c45144c4 Add the run profiles to the favorites menu because I'm lazy
Change-Id: I4d35751daba3839a81e5d3509e6c2ea9395e376d
2012-07-25 10:53:34 -04:00
Edwin Kempin
8d6f7df2f6 Disable assertions for KeyCommandSet when running in gwtdebug mode
The com.google.gwtexpui.globalkey.client.KeyCommandSet has some
assertions that are currently evaluated when running Gerrit in the
gwtdebug mode, but which are not evaluated when running Gerrit via the
pgm daemon. These assertions e.g. cause failures if a KeyCommand is
registered multiple times. E.g. at the moment the CommitMessageBlock
is registering a KeyCommand for starring a change. This registration
is done whenever the display method is invoked. This is e.g. the case
when the change gets abandoned/restored. If running in gwtdebug mode
the assertion failure on re-registering the KeyCommand for starring the
change makes the popup for the abandon/restore message stay open.
Afterwards a browser refresh is needed to recover from this state. This
is annoying when debugging and it is also confusing to see these errors
in debug mode when everything is fine when running Gerrit via the pgm
daemon. This is why this change disables the assertions for the
KeyCommandSet class when running in debug mode. Alternatively we could
of course try to fix the code so that re-registration of keys is not
happening.

Change-Id: I16ee8aa30281922cda08fc31cd966e07c194c926
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2012-07-19 08:23:52 +02:00
Edwin Kempin
8173d426e5 Add Maven profile to skip build of plugin modules
Building the plugin modules ('Plugin API' and 'Plugin Archetype') may
take a significant amount of time (since many jars are downloaded).
During development it is not needed to build the plugin modules. This
change adds a Maven profile that skips the build of the plugin modules,
so that developers have a faster turnaround. This profile is called
'no-plugins' and it's active by default. To include the plugin modules
into the build activate the 'all' profile:

mvn clean package -P all

The script to make release builds has been adapted to activate the
'all' profile so that the plugin modules are always built for release
builds.

Change-Id: I6c3bd7dfcb80f1bf9d681a660d6fca2707b35f75
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2012-06-27 09:28:02 +02:00
Shawn O. Pearce
dbd1acba07 Fix output references in tools/deploy_api.sh
Change-Id: I8d97e3055a01667b658ac8cae9994d6d75531469
2012-05-18 10:33:52 -07:00
Shawn O. Pearce
da4919abf6 Expose only extension-api to extensions
Unless a plugin declares "Gerrit-ApiType: plugin" in its manifest,
assume it is an extension and only make the gerrit-extension-api
available to it through the ClassLoader.

For non-plugins, do not make any Guice bindings available from the
server. This further restricts what an extension can see and do with
the system internals.

Change-Id: Ia38336c42786afb1419d64c06b0d908ae92a64d1
2012-05-18 09:51:09 -07:00
Shawn O. Pearce
1650acea38 Define gerrit-extension-api module
This module will hold a set of thin interfaces that extensions can
build against. Extensions are more lightweight than plugins and have
a smaller surface of the Gerrit server available to them.

Change-Id: I4213004f1ba5c034cf8fc7fbb9f6dd53f3ec8a96
2012-05-10 16:05:45 -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
Deen Sethanandha
52fc1e2165 Add --issues and --issue_numbers to gitlog2asciidoc.py
The --issues option can be used to only output the
commits with issues associated with them.

The --issue_numbers only outputs the actual issue
numbers of the commits with issues associated with them.

Change-Id: Icf1c03461fa8054c6ae75e66ef80d403cc7052bc
2012-03-26 12:51:38 -07:00
Martin Fick
87181822dc Unify issue processing and make more robust
The issue processing in gitlog2asciidoc.py missed
certain capitilazation combinations and was split
across 2 ifs.  Combine it into one if and make it case
insensitive using an ugly python(pre 2.7) backwards
compatible method.

Change-Id: I49fb4d66bd5b3777cc9641a947730a19222895f6
2012-03-26 12:50:00 -07:00
Martin Fick
7d4d16c337 Fix index error when message array is blank
This error occurs when running the gitlog2asciidoc.py
script on Gerrit from v2.2.1 to v2.2.2.1.

Change-Id: I7e9bca2f087765336fdb1f092c3b1453123d25f0
2012-03-22 10:47:11 -07:00
Deen Sethanandha
1c39b15ef6 Add scripts to create release notes from git log
These script generates a list of commits from git log between
<since> and <until>. The output of this script is in asciidoc
format containting list of commits subject and body.

Bug: issue 1272
Change-Id: I32b2ee055e81c5663128aafefd5f46c2e17e58c8
2012-03-01 14:56:37 -07:00