3 Commits

Author SHA1 Message Date
Han-Wen Nienhuys
ccb26667ba Simplify local JGit development
Put all the logic in jgit.bzl, where a single edit suffices to get
the local flavor.

Given that all sha1 for jgit dependencies are in jgit.bzl, we can
remove the constants and use sha1 values directly.

Change-Id: Icabf651e02f226e5c025457d54588074a11ae283
2017-03-23 21:46:55 +01:00
David Ostrovsky
e51b745efa Bazel: Allow to consume jgit from development tree
Now that Bazel build for JGit is fully implemented, we can document
the process of routing the JGit dependency to the development tree
instead of consuming it from Central or ~/.m2 local repository:

1. Activate local jgit repository in WORKSPACE file:

  local_repository(
      name = "jgit",
      path = "/home/<user>/projects/jgit",
  )

2. Uncomment alias to jgit repository in lib/jgit/**/BUILD files.
It shouldn't be needed and is tracked under this issue upstream: [1]:

  alias(
      name = "jgit-alias",
      actual = select({
          "@//lib:jgit-dev": "@jgit//org.eclipse.jgit:jgit",
          "//conditions:default": "@jgit_lib//jar",
      }),
      visibility = ["//visibility:public"],
  )

Test plan:

Update local JGit tree, run tests and verify that local JGit tree
modifications are relfected in gerrit build:

  $ bazel build --define jgit-dev=1 headless

To consume JGit from Central, do not pass jgit-dev=1:

  $ bazel test ...

[1] https://github.com/bazelbuild/bazel/issues/2707
Change-Id: I1b0fee7df802f6cbd54acbb0bc73157e2b8bc7cf
2017-03-22 22:27:12 +01:00
David Pursehouse
0a93ba1442 Bazel: Add dummy BUILD file in lib/jgit
Fixes the error:

  Unable to load package for '//lib/jgit:jgit.bzl':
  BUILD file not found on package path.

Change-Id: Ic3506f8777fc1875f00e295bd1775c774b56ef19
2016-10-26 09:37:22 +09:00