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
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
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
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
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
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
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
* 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>
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
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
* 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
* 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
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
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
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
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
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
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
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
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
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
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
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>
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
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>
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
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>
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>
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
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
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
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
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
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