12 Commits

Author SHA1 Message Date
David Pursehouse
f3152ac168 version.py: Remove redundant replacement in dev-plugins.txt
Change-Id: I75a80190b3c7b21a673a02c2d57771250ac74e90
2017-03-23 21:15:16 +09:00
David Pursehouse
5476de3e30 version.py: Fix replacement in version.bzl
Change-Id: Ifca0a32a922a4bbce7b34069802c1f32ea00f23f
2017-03-23 21:10:58 +09:00
David Ostrovsky
a052e52971 Discontinue publishing of Maven archetypes
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
2016-12-10 18:02:38 +01:00
David Ostrovsky
50785fdbb2 Bazel: Publish maven artifacts to local and remote repositories
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
2016-11-03 12:47:24 +00:00
David Ostrovsky
947b5e53ac Expose acceptance test framework as new plugin artifact
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
2015-09-25 14:46:10 -04:00
David Pursehouse
8612f898bf version.py: Also update the version in the plugin documentation
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
2015-07-06 06:42:51 +00:00
Björn Pedersen
c357cebdae tools: use python on path
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
2015-06-18 17:10:11 +02:00
David Pursehouse
a022f3ea15 version.py: Also update the VERSION file
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
2015-01-22 16:55:41 +09:00
David Ostrovsky
520f29c16a Buck: Deploy plugin artifacts to Maven Central
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
2014-05-26 22:06:42 +02:00
Edwin Kempin
c7ddc2c0d1 Add pom with meta-data for plugin projects
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>
2014-05-21 16:24:39 +02:00
David Ostrovsky
84abbf6e30 No pom.xml in gerrit-plugin-gwtui to update
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)
2014-05-21 10:32:16 +00:00
David Pursehouse
9a13f852f0 Helper script to update API version in plugin archetype pom files
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
2014-03-26 18:01:33 -07:00