10 Commits

Author SHA1 Message Date
Han-Wen Nienhuys
0a6495efc9 Documentation: check in (js_)licenses.txt
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
2019-03-28 15:45:58 +00:00
David Ostrovsky
a9bb94b9bc Bazel: Replace PACKAGE_NAME constant with package_name() function
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
2018-09-11 07:58:12 +02:00
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