This project is a non Maven project in second generation: Buck, Bazel.
We discourage usage of Maven and not maintaining the tool chain. To
start writing gerrit plugins there are enough resources:
* more than 100 production ready plugins
* cookbook-plugin
* examples plugins, pending for review: [1].
* https://gerrit-review.googlesource.com/91698
Change-Id: I322e9b77f7daa26ea9927231d57f292919974ffe
Currently too big files are published, because some unwanted transitive
dependencies are included in the final artifacts. That will be fixed in
follow-up change by using neverlink option in java_library rule or using
provided_deps attribute that will be addded in future releases of Bazel:
[1].
TEST PLAN:
$ VERBOSE=1 tools/maven/api.sh install bazel
$ VERBOSE=1 tools/maven/api.sh install buck
* [1] https://github.com/bazelbuild/bazel/issues/1402
Change-Id: Ie73d4ae34d96be7f97f6329c4c30c814f54688d5
Split the current gerrit-acceptance-tests in two parts:
* framework + some needed deps, that is exposed as additional plugin
artifact
* rest of the gerrit-acceptance-test project
To implement the split and not to pull in too many dependencies, some
refactoring was needed. Particularly, gerrit-server:testutil depends
on gerrit-server:server, that depends on almost everything. Similar
problem was with gerrit-pgm:pgm, that is needed for AbstractDaemonTest
to work. Split the rules in gerrit-pgm to break transitive dependency
chain. We shouldn't ship artifacts twice, in plugin-api and in
acceptance-framework.
This change also partially reverts Ie9e63de622, where
//gerrit-acceptance-tests:lib with all its transitive dependencies was
included in plugin-api artifact.
Expose gerrit-acceptance-framework as new plugin artifact. This allows
us to support unit tests in plugins in three different build modes:
* Buck in tree build mode
* Buck standalone build mode
* Maven build
To install gerrit-acceptance-framework locally, the following command
is used:
buck build api_install
To deploy gerrit-acceptance-framework to Maven Central, the following
command is used:
buck build api_deploy
To support unit tests in tree build mode, the following Buck variable
is exposed: GERRIT_TESTS and can be used, e.g.:
java_test(
name = 'cookbook_tests',
srcs = glob(['src/test/java/**/*IT.java']),
labels = ['cookbook-plugin'],
source_under_test = [':cookbook-plugin__plugin'],
deps = GERRIT_PLUGIN_API + GERRIT_TESTS + [
':cookbook-plugin__plugin',
],
)
To support unit tests in standalone build mode, acceptance-framework
maven jar is defined in lib/gerrit/BUCK file:
maven_jar(
name = 'acceptance-framework',
id = 'com.google.gerrit:gerrit-acceptance-framework:' + VER,
license = 'Apache2.0',
attach_source = False,
repository = REPO,
)
bucklets/gerrit_plugin.bucklet is extended with the same variable
that points to the new maven_jar artifact, so that the same Buck
java_test() rule can be used in both modes.
Test plan:
1. run tests in gerrit tree
2. apply corresponding change to cookbook-plugin and run tests in
gerrit tree mode
3. apply corresponding change to bucklets, and run tests for
cookbook-plugin in standalone build mode
Change-Id: I4cadf6616de36ca24712f8b07d282b7a50911105
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
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
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
Switch deploying Gerrit extension and plugin API from Google storage
bucket to Maven Central.
To simplify the troubleshooting new trace option was added to
underlying python script. When environment variable VERBOSE=1
is set, then the mvn command is printed to stderr:
VERBOSE=1 buck build api_deploy_oss
Change-Id: I9ebe44ec8aca91aa6b5514f561209e7c50377927
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>
9a13f852f04b956f1d8b51526732d187258ef58b add utility script to update
pom.xml with newest version. gerrit-plugin-gwtui project doesn't have
pom.xml and must not be updated.
Change-Id: If2d367e8b8c0a5c4960bfc0a059b42cf951e7462
(cherry picked from commit c092bc24fefce072079ea8af58ef7f5c35236c67)
Running the script in the root of the Gerrit folder:
./tools/version NEW_VERSION
will replace the value in the first occurrence of the <version> tag
in the plugin archetype pom files with the value specified by
NEW_VERSION.
Change-Id: I9f529852af22a1eef7f30e2fcaea8acea28057d9