8 Commits

Author SHA1 Message Date
Han-Wen Nienhuys
b6a4048986 Apply buildifier to .bzl files.
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
2018-07-10 20:38:52 +09:00
Paladox none
03b8b2caad license and doc: Add support for python3
With homebrew's recent change of making python3 the default
over python2, lets support python3.

Bug: Issue 8474
Change-Id: I8dba441c8d717ae06d156c9201a02926884fd5f0
2018-03-08 15:36:20 +09:00
David Ostrovsky
de255d9b8b Bazel: Make build tool chain python 3 compatible
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)
2018-03-08 10:23:46 +09:00
David Pursehouse
2d08500516 Format .bzl files with Bazel Buildifier
Change-Id: I3ab30565e5ac110a18cbe3d34f76307801c30373
2016-12-11 19:00:21 +09:00
Yuxuan 'fishy' Wang
14fdf9342e bazel: genasciidoc and genasciidoc_zip rule
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
2016-10-07 15:20:35 +08:00
Yuxuan 'fishy' Wang
9d0e8eac3b bazel: generate licenses.txt
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
2016-09-28 04:57:42 +08:00
Han-Wen Nienhuys
c65ad9749c bazel: add test that forbids DO_NOT_DISTRIBUTE in //gerrit-pgm:pgm.
Change-Id: Idf4695294c34bbca157d104cfb6e708bac727473
2016-09-21 19:52:53 +00:00
Han-Wen Nienhuys
eb16fe05a1 bazel: generate license list for documentation.
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
2016-09-21 18:34:56 +00:00