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
In some cases it might be useful to be able to pass dependencies as non
transitive dependencies, that not included in final plugin binary.
Why? When plugin dependencies are needed in both bootstrap classpath and
in plugin then they must be put in $gerrit_path/lib dir. Having them in lib
and inside the plugin doesn't make much sense.
This change exposes compile_deps parameter to the gerrit_{plugin|extension}
methods. It is possible to create both versions of the plugin: with and without
dependencies.
gerrit_plugin(
name = 'javamelody',
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/resources/**/*']),
manifest_entries = [
'Gerrit-PluginName: javamelody',
'Gerrit-Module: com.googlesource.gerrit.plugins.javamelody.Module',
'Gerrit-HttpModule: com.googlesource.gerrit.plugins.javamelody.HttpModule',
],
deps = [
'//plugins/javamelody/lib:javamelody',
'//plugins/javamelody/lib:jrobin',
],
)
gerrit_plugin(
name = 'javamelody-no-deps',
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/resources/**/*']),
manifest_entries = [
'Gerrit-PluginName: javamelody',
'Gerrit-Module: com.googlesource.gerrit.plugins.javamelody.Module',
'Gerrit-HttpModule: com.googlesource.gerrit.plugins.javamelody.HttpModule',
],
compile_deps = [
'//plugins/javamelody/lib:javamelody',
'//plugins/javamelody/lib:jrobin',
],
)
Change-Id: Ia274dbeb18de8807f0ab1edf7144f12ff0d02d74
This plugin module was left out during Buck migration.
$>buck build api
produces now plugin-gwtui.jar and plugin-gwtui-src.jar.
Buck Maven bridge was enhanced to {install|deploy} the new artifact to
remote or local Maven repositories:
$>buck build install_api
deployes
gerrit-plugin-gwtui-2.9-SNAPSHOT-sources.jar
gerrit-plugin-gwtui-2.9-SNAPSHOT.jar
to local Maven repository.
Change-Id: Idae18f6df2e67fe53d57b8c35caa4226333e269b
(cherry picked from commit c8cffc8e928a9277621ffff6cb740f79cd662195)
Add the necessary settings in the fake pom.xml file, and correct the URL
in the BUCK file to make deployment with gs-maven-wagon work.
Change-Id: I6d1f84c850c70f731d061d9e50a062d37c68baf2
* changes:
Don't put plugins into system classpath
Isolate plugin class directories from each other
Display UI build failures in browser
Unify debug launch configs and auto-detect browser
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
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
Since this Buck's commit 59759043f66de17140b423a7f11a2d8827b4cbbf the whole
unflattened subtree is used.
Change-Id: I4ec930a452d4867add3f5dd46430d3184c2a7277
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
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
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
Buck lacks a feature to set java source level and target level per project
base, i. e. in .buckconfig file under java section.
The only method that currently is supported and described in the
documentation is to pass custom levels to java_library and java_test methods.
That would work, but that approach would require to touch dozens of files.
Second approach could be to just patch system wide Buck with this patch[1].
However that is not really an option because in this case the increased
java source and target level applies on all projects and branches.
Particularly it is undesirable to build Gerrit 2.8 stable branch or other
projects that were migrated to Buck (e. g. JGit) with increased java source
and target level.
This change redefines the standard definitions of java_test() and
java_library() methods and increases the java source and target level in the
new defined functions. With the combination of "include = default.defs"
construct in .buildconfig file it is garanteed that all BUCK files first
"see" the redefined methods.
Disadvantage of the approach is that every time the original method
definitions are changed in upstream Buck (i. e. new paramters are introduced)
this patch must be changed too.
The best approach would be to extend Buck and enable definition of source and
target level per project base (in .buckconfig file).
[1] https://github.com/facebook/buck/pull/67
Change-Id: Ifaba1eb41e9ac2f033e704a75723f3595e1c1ee5
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
The plugin api moved into the gerrit-plugin-api package.
Change the reference created by gerrit_plugin() to match.
Change-Id: I390a22f512835847367ae2993a7a9bddf9d11b5c
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
Currently only predefined Maven repositories are supported by Buck maven_jar.
Additional logic exists to redirect to a local repository mirror.
Current implementation relies on the repository name matching between repo
passed to maven_jar and redirect definition defined in local.properties that
is not under Git control.
This change extends that by allowing to pass not only the repo name but the
complete URL to maven_jar. The augmented implementation checks if it is a
known Maven repository: if it is, then the behavious is unchanged, if not,
then the passed URL is used.
As result plugin's can use custom Maven repositories:
GERRIT_FORGE = 'http://gerritforge.com/snapshot'
maven_jar(
name = 'gitblit',
id = 'com.gitblit:gitblit:1.4.0',
sha1 = '1b130dbf5578ace37507430a4a523f6594bf34fa',
license = 'Apache2.0',
repository = GERRIT_FORGE,
)
Plugin owned Maven repositories can also be rewritten in local.properties.
To achieve that custom repository name must be passed to the maven_jar()
function, like known repositories, and the URL must be defined in
local.properties.
local.properties excerpt:
download.GERRIT_FORGE = http://my.company.mirror/gerrit-forge
BUCK excerpt:
GERRIT_FORGE = 'GERRIT_FORGE:'
maven_jar(
name = 'gitblit',
id = 'com.gitblit:gitblit:1.4.0',
sha1 = '1b130dbf5578ace37507430a4a523f6594bf34fa',
license = 'Apache2.0',
repository = GERRIT_FORGE,
)
Python unit test can be executed with other Java unit tests:
buck test tools:python_tests
Change-Id: Ib31d51f0884b1ca1a07b6492f861f404db115946
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
This changes extends gerrit_plugin function with additional gwt_module
parameters. When passed, GWT application is created. Assumtion is met,
that this application depends on gerrit-plugin-gwtui module.
With this change Gerrit GWT plugins can be build with Buck:
MODULE = 'com.googlesource.gerrit.plugins.cookbook.HelloForm'
gerrit_plugin(
name = 'cookbook-plugin',
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/**/*']),
gwt_module = MODULE,
manifest_entries = [
'Gerrit-PluginName: cookbook',
'Gerrit-Module: com.googlesource.gerrit.plugins.cookbook.Module',
'Gerrit-HttpModule: com.googlesource.gerrit.plugins.cookbook.HttpModule',
'Gerrit-SshModule: com.googlesource.gerrit.plugins.cookbook.SshModule',
]
)
Change-Id: I4b131c7c2672675d99457651fcee63bf4f149c2f
This plugin module was left out during Buck migration.
$>buck build api
produces now plugin-gwtui.jar and plugin-gwtui-src.jar.
Buck Maven bridge was enhanced to {install|deploy} the new artifact to
remote or local Maven repositories:
$>buck build install_api
deployes
gerrit-plugin-gwtui-2.9-SNAPSHOT-sources.jar
gerrit-plugin-gwtui-2.9-SNAPSHOT.jar
to local Maven repository.
Change-Id: Idae18f6df2e67fe53d57b8c35caa4226333e269b
After switching to Eclipse Maven repository for pulling JGit lib, we
have the problem that according to Eclipse release train the JARs have
to be signed. That collids with our jgit patch for diff deserialization.
To rectify that, add `unsign` parameter to maven_jar() function.
Change-Id: Ib7bfa5d16f980a64b887d61a4b4ec325e6ffb0a1
After switching to Eclipse Maven repository for pulling JGit lib, we
have the problem that according to Eclipse release train the JARs have
to be signed. That collids with our jgit patch for diff deserialization.
To rectify that, add `unsign` parameter to maven_jar() function.
Change-Id: Ib7bfa5d16f980a64b887d61a4b4ec325e6ffb0a1
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
$TMP, $DEPS, $SRCS, $OUT are no longer supplied by Buck in the
environment unless they appear in the command line. Pass $TMP
where it was assumed to be magically supplied. This allows steps
to continue to use buck-out/gen/ for temporary storage instead of
polluting the system /tmp.
Change-Id: Iea8380e5f93fa16ec77457eb76404832bde93a39
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
Having these in the classpath permits the sources to be modified
in Eclipse just like any other Java source file.
Change-Id: I6256f5db793dd056a61e934720cb40056d50cfd0
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
This query suite tester allows queries to be stored in
files to easily be executed in bulk. The output of the
queries are stored for easy analysis.
Change-Id: Ibcfb395ec0fdfb2c46ed2cc02032cc4eb7395a43
Asciidoctor doesn't support the conf file, so we remove it, do the macro
replacing ourselves, and put all the attributes into the command line
parameters.
Change-Id: I21b49e5a2d75ff0f9b52f26fccaae42fcbaa0837
The correct reference to the action name is args.a. action is an old
variable that was replaced by args.a and this reference was missed.
Bug: issue 2086
Change-Id: Ibfbf523db8a8adfbf72f31de3ddc7b0ec96014eb
This change fixes the following problems:
* MAVEN_LOCAL definition must be prefixed with 'file://' for curl to work
* src_sha1 was unnecessary required to define source artifact
* update the documentation that sha1 must not be provided
Change-Id: I1cee6588897c928f01bac5cc9fb252251f4f8027
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
Standardize the definition of MAVEN_LOCAL as ~/.m2/repository.
This makes it slightly easier to point to a custom build of a
dependency such as gwtorm or PrologCafe by installing the JAR to
the local Maven repository and updating the maven_jar() rule to
use repository = MAVEN_LOCAL instead of GERRIT.
Change-Id: I2e54d1039608c0195a992dbc12fe74bb513466c6
shutil.copyfile can raise shutil.Error and IOError. Catch these and
exit with error status after logging the error to the console.
Change-Id: I63b8caa371cc7034bbb3f19d0bd3fdd0446af2bf
If extracting files fails, it prints the error message but then
continues.
Make it exit with error status in this case.
Change-Id: I19fafda68a85b46300a1abaf6a86567cf1f712b0
download_file caches original zips in ~/.gerritcodereview/buck-cache.
If this is a different filesystem than $(pwd)/buck-out a symlink
was used to connect the build file with the original archive. This
confuses Buck when creating the $SRCDIR for a genrule().
If a hardlink does not work, copy the file.
Change-Id: If66c59fb6aecc93b5a3e85cdd76ef880538875ff
The build system used mixed names for essentially the same things.
Rename all DEFS files to *.defs matching the handful of other files
that are already using this convention.
Change-Id: I3269bd5db5d8d83f5e192ea910f19431c2a4a1cf