Downloaded artifacts went directly into
~/.gerritcodereview/buck-cache
while artifacts built by BUCK went into the directory's `cache`
subdirectory:
~/.gerritcodereview/buck-cache/cache
. When just walking the file hierarchy on the command line, this
`cache` sub-directory is hardly visible, due to all the downloaded
artifacts. To increase visibility, we change to
* ~/.gerritcodereview/buck-cache/downloaded-artifacts
(for downloaded artifacts)
* ~/.gerritcodereview/buck-cache/locally-built-artifacts
(for artifacts built by buck locally)
That way `~/.gerritcodereview/buck-cache` (instead of one directory
and 100s files) now only contains two directories.
Change-Id: I7327ff6c1736f9af8ea15450949dc6a4bc10b684
Refactor the code so that the replacement is done in a submethod
using `re.sub` on the entire content of the file, rather than per
line.
Use the refactored method to also do the replacement in the VERSION
file.
Add replacement in the dev-plugin file in the Documentation.
Change-Id: I5ca81e5c290ba4635a92b56b1680e906429b11c8
After refactoring done in Ia46c0559a lib/jgit is recognized as source
folder for the non existing Edit patch library:
$ buck audit classpath //gerrit-gwtui:ui_module
buck-out/gen/lib/jgit/lib__Edit__output/Edit.jar
As the consequence non existing path is induced from it and included
in .classpath file:
path="/home/davido/projects/gerrit/lib/jgit/src/main/java"
Add a check for existence of source folder and include it only if the
folder exists.
Change-Id: Icef39196173722c9c8b760c041a4c9ec9d22ab7c
GWT 2.7 dev JAR no longer lists org.json:json as a dep in its pom.xml
file. Instead it requests ow2-asm. Fix the dep list to drop the
difficult org.json:json and put in the requested ow2 JARs.
Move ow2-asm deps down onto gwt-dev JAR where they belong. These are
required by the compiler code inside gwt-dev, not user code linked
with gwt_module().
Change-Id: I54df92daf40d77e61bed4ed4b549981e8d798ca1
Buck extensively uses caching and storing metadata in buck-out
directory, so that it's not possible per design to re-trigger the
execution of custom rule, without wiping out the whole buck-out
directory. See also the discussion on this issue: [1].
The implementation of Maven deployment as a custom build rule with
a side effect is wrong approach to start with. It was only done as a
workaround, because buck doesn't offer `install` or `publish` command
that must not be free of side effects like it's the case with `build`
command. Having side effects with `build` command breaks bucks model.
As workaround for now add standalone Python script, that re-uses Buck
api_{deploy|install} targets, resolves $(location <target>) macros and
executes the deployment by calling mvn.py utility directly:
$ tools/maven/api.py {deploy,install}
Dry run mode is supported as well:
$ tools/maven/api.py -n {deploy,install}
[1] https://github.com/facebook/buck/issues/342
Change-Id: I7fb86ad6967a1fa1e7ac842ba5e0e8cf0103b773
Use the canonical syntax to specify the python executable to use.
Avoids a fatal error if /usr/bin/python is a too old version (< 2.7).
Change-Id: I3e8affb52be993d35c0dcf90774d962a59ef5635
DisableCastChecking option was first added in I5dc633d5b. Since Issue
3389, that caused breakage of all Google products for many weeks, this
option is added again in the development build to prevent such severe
regressions in future.
Because the generated javascript code is bigger with cast checks, this
option is still added in release mode.
Side effect of this change is that the plugins that expose GWT module
are compiled without DisableCastChecking option in Gerrit tree mode.
Standalone bucklets driven build mode is not affected by this change.
Another side effect, that 'soyc' target for "compiler story" was
duplicated and the corresponding release mode with DisableCastChecking
is also provided with alias 'soyc_r'.
TEST PLAN:
$ buck build gerrit
should pass only -XdisableClassMetadata option to GWT compiler. Whereas
$ buck build release
should pass both -XdisableClassMetadata -XdisableCastChecking options.
Bug: Issue 3389
Change-Id: Ia99647357e7bff889137d4855e9c0059e6c6a4f3
Since [1] dependencies to targets used in $(exe //path/to:target) and
$(location //path/to:target) macros are added implicitly.
[1] https://github.com/facebook/buck/issues/128
Change-Id: Id98257e1118830205821e35816d0e562e56e961a
If a plugin is symlinked in the plugins folder, and that plugin does
not have any tags, the `git describe` command fails with:
fatal: No names found, cannot describe anything
which causes the build to fail. This was broken by change If5e7be8d.
Add the `--always` option on `git describe` so that it will return a
value even when there are no tags.
Change-Id: I3d0c472c9ac469d079626a9df17149422dc5e4e6
Building two versions of a gerrit plugin using the same buck would make
buck use the cached manifest file from the previous build.
With this change the result of git_describe() is used to determine
archetype version, so the manifest file will be rebuilt.
Change-Id: If5e7be8d7f11b965e973172f77fe7bfc93019f3a
Eclipse installations disagree about where to put unmatched top-level
packages. Settle this ambiguity by listing all top-level packages used
by Gerrit. Also explicitly include unmatched static imports.
The import order thus listed corresponds to the Google Java Style
Guide:
https://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s3.3.3-import-ordering-and-spacing
Organize all imports to reflect the new reality.
Change-Id: I7c541b1c522e66869669d2291dcf78ff1d8784d0
Update the Checkstyle configuration to only warn on lines that exceed
150 characters.
In code reviews we usually ask people to wrap lines at around 80 columns,
but there are too many existing long lines (between 80 and 150) to bother
fixing them all now.
Only wrap the ones that are egregiously long (i.e. more than 150) and add
suppressions for the ones that cannot be wrapped, for example containing
long URLs.
Change-Id: I09625efa7a0509f1d88c27ebc83dda67b6afd026
Since I3778f9c8 we have had non-ASCII characters in our source files.
javac may decide to read the locale from its environment, which fails
on such source files, causing warnings at best and test failures at
worst.
Hack our default java rule defs to pass -encoding.
Change-Id: I53dfd2d551eed7c1c1fa8ef5cfcfb726d67e3a62
Based on the "Google Style" configuration [1] that comes pre-installed
in the Checkstyle Plugin for Eclipse, with some warnings disabled to
reduce the amount of noise.
This can be loaded into the Checkstyle plugin in Eclipse:
- Select "Preferences" -> "Checkstyle" -> "New..."
- Change "Type" to "External Configuration File"
- Add a unique name in the "Name" field
- Select "Browse" and choose the file
- "OK"
After loading, select the profile and press "Set as Default".
[1] https://google-styleguide.googlecode.com/svn-history/r130/trunk/javaguide.html
Change-Id: Ia192a3d7360641ce994f069a78d563a5fc09255a
As explained in [1], [2] in tree build mode is currently broken for
plugins that expose GWT modules.
To rectify, isolate the libraries that used for building regular and
GWT modules. While regular modules need the whole Plugin API as their
dependency, GWT modules should only consume pre-defined set of GWT
API modules.
[1] https://github.com/facebook/buck/issues/109
[2] https://gerrit-review.googlesource.com/63489
Change-Id: I4694745254ec0f2d9578d79b62110241d4b8b429
When updating the version, the VERSION file also needs to be updated.
The documentation implies that the version.py file does that, but it
doesn't.
Update the version.py file tool to do it.
Change-Id: I8671688e819608659685b79a553c592604093890
The gerrit project has a customized import order setting, which is
under version control in the Eclipse setting file:
.settings/org.eclipse.jdt.ui.prefs
However some of the other Gerrit related projects (i.e. non-core
plugins) do not have this setting. In some cases the whole .settings
folder is ignored by git.
Add a file that can be imported into the project to set the correct
import order.
Change-Id: I188d7915f27b9c7c0dc5e04c9e6b2f5dcabd0807
In GWT 2.7 asm isn't shipped any more in gwt-dev JAR. In Ib8f9ed0c7 asm
dependency was added as transitive dependency to gwt_binary() rule
invocation. Unfortunately the gerrit plugin code path was missed, thus
the plugins that make use of GWT module cannot be compiled any more.
This bug wasn't noticed, because no core plugins make use of GWT
modules.
Change-Id: Id388caf119887263863c4829c7ada4e1fa94eb85
Fix some minor issues that were reported by pyflakes and pylint.
- Rename arguments to prevent redefinition of built-in 'dir'
- Rename method call to prevent redefinition of built-in 'help'
- Remove unused imports
- Prefix unused variable with underscore to prevent warning
Change-Id: Ia9e21c0f1a69af43f6e4566be46c31bdda540d2f
One of the major features of upcoming GWT release 2.7 is incremental
compilation in SDM session. Because Buck recompilation is
integrated as HTTP filter on every request, this optimization is
jeopardized: Buck is unaware that a SDM debug session is active.
We cannot entirely skip the Buck integration in SDM debug session
as the site must be initialized at least once.
Pass a Java property from Eclipse launch configuration and maintain
initialization map with initialized flag per user agent for the site.
This improves the time by a factor of 10, ca. 2 sec. for incremental
recompilation on my laptop:
Compilation succeeded -- 1,822s
Linking into
<site>/gerrit-gwtui/com.google.gerrit.GerritGwtUI/compile-5/war/gerrit_ui;
Writing extras to
<site>/gerrit-gwtui/com.google.gerrit.GerritGwtUI/compile-5/extras/gerrit_ui
Link succeeded
Linking succeeded -- 0,190s
2,140s total -- Compile completed
Change-Id: Id2cb19a675d500c04e6748216a77dbb4f26fa1ab
AutoValue[1] is a lightweight annotation-processor-based library for
implementing classes with simple, obvious value semantics.
Add support for AutoValue to build rules and Eclipse project
generation. Buck does not currently have an officially-supported
interface for specifying annotation processor dependencies[2], so we
have to take the slightly ugly approach of monkey-patching
java_library and java_test to add annotation processor arguments to
each rule that requires annotation processing; hopefully this ugliness
can be reduced in the future.
[1] https://github.com/google/auto/tree/master/value
[2] https://github.com/facebook/buck/issues/85
Change-Id: I8b49d6f9f25d61688b667d964848c6ce106ae4ec
This version fixes this bug [1] that allows us to eliminate these ugly
shell backticks and switch again to escaped macro like invocations:
\$(dirname $OUT)
[1] https://github.com/facebook/buck/issues/212
Change-Id: Ie43b3ff6dfc89c4d840f2ff75c64ac0a5c6346b6
This version fixes a critical bug [1] that prevents us from simplifying
bucklets intergration. In this version, Buck only allows defining new
rule functions in files included with include_defs, not actually
instantiating rules, so we need to reshuffle some rules.
After this commit [2] "$(macro ...)" syntax is preserved for buck
macros, we need to use a backslash to send commands directly to the
shell: "\$(macro ...)". It turns out this doesn't work yet, shell
backticks seem to work though [3].
[1] https://github.com/facebook/buck/issues/182
[2] d6f3252170
[3] https://github.com/facebook/buck/issues/212
Change-Id: Ie99757bafc626d4ac2c5a75a2983d91b0c4f6d24
With the option --plugins project.py creates an own eclipse project
for each plugin. The plugin projects depend on the /gerrit project.
All libraries in the gerrit project are exported now in order to make
them available for the plugin projects.
The advantage of this is that now each eclipse project only contains
sources belonging to a single git repository. EGit assumes one git
repository per eclipse project. When the plugin sources are part of the
gerrit eclipse project, EGit cannot determine the git repository
correctly.
Change-Id: I154ca2e474e5a729d2adc2ec44fcfd9429387e51
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
There is now only one supported way to debug GWT, so remove the "SDM"
naming, as it's basically an implementation detail. Be consistent
between the launcher and class names,
gerrit_gwt_dbg -> GerritGwtDebugLauncher.
Update the documentation to be consistent as well, and link to the
article about Super Dev Mode.
Change-Id: If541bc48bf828a8af64d631d7acd6f663d5ecea1
Switch again to Maven Central, as new version that fixes sporadic
handshake failures was released. Also remove traces of Atlassian
maven repository from build tool chain. It was temporarily used
as workaround for not officially released bug fix [1].
[1] https://issues.apache.org/jira/browse/SSHD-330
Change-Id: Id3c50de0ace5b8ba298fcf39d5bdaa65eba10e5a
Simplify SDM experience by embedding codeserver and daemon in one
process: no multiple launch configurations must be started and
the output must not be captured in different IDE console windows.
Unfortunately, as is Codeserver implementation is based on outdated
Jetty. Replace WebServer.java from GWT project (same license like
Gerrit itself, preserving the license header) and adjust it to run
against Jetty 9 that is used by Gerrit.
This also removes the need to fetch outdated Jetty version that we
have just wiped out from gwt-dev.jar during download from Central.
Change-Id: I616a53eb080d49a2bdf7a2211067b821af9f85d7
There is a bug with this script only when plugins are added to the plugins
folder. I found it when attempting to debug the its-bugzilla plugin.
It places the plugin dependent libraries ahead of the Gerrit core libraries
which can cause conflicts and failures with Gerrit core. This change
switches the ordering.
Change-Id: Id39a9035928c1dcc3daf034f5fdd7d88d87bb024
Bucklets are reusable building blocks for buck driven build. Many
bucklets match Gerrit's own methods and were derived from them. To
enable buck driven build of gerrit plugins bucklets, are used. This
simplifies the implementation without need of code duplication. The
problem is however, that unlike maven driven build, in gerrit tree
build mode is supported for plugins. Because of mismatch of buck
build interface between gerrit core and bucklets this currently can
not be done. This change synchronizes the interfaces between gerrit
and bucklets by exposing building blocks that are shared between gerrit
and bucklets in own files and linking them from bucklets directory.
That way bucklets can be (re-)used from both build modes: in gerrit
tree and standalone.
Change-Id: I8457b99936f009b4bc531f3b5633e4f19cb3b676
* stable-2.10:
Add full names for options on list groups REST API
Add full names for options on list projects REST API
Make `-S` an alias of `--start` in changes query REST API
Mention deprecation of sortkey parameters in 2.9 release notes
Set the version to 2.10-SNAPSHOT
Run change hooks and ref-updated events after indexing is done.
Fix Guice module auto-discover for plugin providers
Fix broken formatting in changes REST documentation
Restrict the input of plugin_archetype_deploy.sh
Gracefully handle `buck audit` failure
Revert "Make VisibleRefFilter.Filter reuse the refs passed from JGit."
Conflicts:
VERSION
gerrit-extension-api/pom.xml
gerrit-plugin-api/pom.xml
gerrit-plugin-archetype/pom.xml
gerrit-plugin-gwt-archetype/pom.xml
gerrit-plugin-gwtui/pom.xml
gerrit-plugin-js-archetype/pom.xml
gerrit-war/pom.xml
Change-Id: I01f5e9ffa67058d914485c53c8c7b64643da4c84
* stable-2.9:
Add full names for options on list groups REST API
Add full names for options on list projects REST API
Make `-S` an alias of `--start` in changes query REST API
Mention deprecation of sortkey parameters in 2.9 release notes
Run change hooks and ref-updated events after indexing is done.
Fix broken formatting in changes REST documentation
Restrict the input of plugin_archetype_deploy.sh
Gracefully handle `buck audit` failure
Revert "Make VisibleRefFilter.Filter reuse the refs passed from JGit."
Conflicts:
gerrit-server/src/main/java/com/google/gerrit/server/change/PutTopic.java
gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java
tools/pack_war.py
Change-Id: I89a9b42c049ec1365ef6dec53c73c7a10a41e888
Input mispelled option of plugin_archetype_deploy.sh
it starts to run. Restrict the input to avoid this error.
Add confirm before run.
Change-Id: I6fdc8b592679c45891210261a47285171b50e35f
New buck version added native support for python_test() rule, so that
our home made java_test() wrapper around python unittest framework is
not needed any more.
Change-Id: If7bae742b7f22a994c5237fb161a35f3f33aaa80
Handle exception raised when invoking `buck audit` and exit
with an error message, instead of dumping a python Traceback.
Change-Id: I3786c4eddffa03117f4437314fc12ee68c689a85
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