Add a test that ensures that the checked in version is up to date.
The license generation is tied closely to the Bazel build and the
layout of the Gerrit source tree.
By checking in the license files, alternative builds (such as the
Google internal build) do not have to replicate the license
generation step, or rerun the upstream Gerrit bazel build.
Change-Id: I500717e38de6c337ce552815e46562648df48b2f
PACKAGE_NAME was deprecated in favor of package_name() function and is
going to be removed in future Bazel releases. Moreover Bazel is trying
to set --incompatible_package_name_is_a_function=true per default to
enforce Bazel users to stop using it: [1].
[1] https://github.com/bazelbuild/bazel/issues/5827
Change-Id: I4d1a6ccbeae611fdd0e9c1e9fdd89b6dd1294f36
Buildifier is now also used for formatting .bzl files.
This change was created by running buildifier 0.12 over our source tree.
Change-Id: I9f15112d4fe23e5cec0700cfe47f1ca649f61d2a
With homebrew's recent change of making python3 the default
over python2, lets support python3.
Bug: Issue 8474
Change-Id: I8dba441c8d717ae06d156c9201a02926884fd5f0
This change establishes Python 3 compatibility for the major part of
Gerrit build tool chain. Only two scripts remain non Python 3
compatible:
* Documentation/replace_macros.py
* tools/bzl/license-map.py
Those scripts explicitly invoked with python2 version.
Test Plan:
a. Python 2.7
* Switch to system where /usr/bin/python points to Python 2.7
* bazel build release
* bazel test //...
* tools/eclipse/project.py
b. Python 3.6
* Switch to system where /usr/bin/python points to Python 3.6
* bazel build release
* bazel test //...
* tools/eclipse/project.py
Pre-requisites for the test plan:
In case bazel action and repository caching is activated on the SUT, the
caches would need to be wiped out, to make sure that the complete build
tool chain was tested. On my system I had to run these commands:
* bazel clean --expunge_async
* rm -rf ~/.gerritcodereview/buck-cache/downloaded-artifacts/*
* rm -rf ~/.gerritcodereview/bazel-cache/cas/*
* rm -rf ~/.gerritcodereview/bazel-cache/repository/*
Bug: Issue 8151
Change-Id: Iece59d0c5149b77a02754b3fed4ce84d5d8085ee
(cherry picked from commit 0c9e13c11a9a0facd1538d6e5b45b02a90db5ab3)
Implement genasciidoc rule for bazel. It's a filegroup containing all
the html and resource files.
Also implement genasciidoc_zip rule for bazel, which is similar to
buck's genasciidoc rule to produce a zip file containing all asciidoctor
generated and resource files.
TEST PLAN:
bazel build Documentation
buck build Documentation:html
diff -u bazel-bin/Documentation/install.html buck-out/gen/Documentation/html__tmp/Documentation/install.html
Change-Id: I3065355800a982c6956d3bb634204baaa60c045e
Modify license_map rule to:
- Accept more than 1 targets
- Add '--asciidoctor' option to generate asciidoctor txt file
- Add support for multiple licenses for a single target (diffy_logo)
Also add test_license.sh for license_test rule to handle special
DO_NOT_DISTRIBUTE exceptions.
TESTED:
bazel build Documentation:licenses.txt
bazel test gerrit-pgm:pgm_license_test
bazel test gerrit-gwtui:ui_module_license_test
Change-Id: Ic64b227fea34882721e6e064b1520cd9a4d5d4a4
Example:
$ bazel build //Documentation:pgm-licenses.txt
..
$ cat bazel-genfiles/Documentation/pgm-licenses.txt
//lib:jsch //lib:LICENSE-jsch
//lib:servlet-api-3_1 //lib:LICENSE-Apache2.0
Still missing:
* check that there are dependencies on forbidden licenses
* check that there are no external dependencies except through the
//lib directory.
Change-Id: I8f0ed94de20f68e0dbc1fe87dfd56ce11e02fab7