From cdc5ec821e4cbdaa31353916ac001bb596de8c55 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Wed, 2 May 2018 14:34:21 -0700 Subject: [PATCH] Bazel: Add a target to build jgit commandline tool This works well enough for basic testing, especially the "jgit daemon" command: $ bazel build org.eclipse.jgit.pgm:jgit INFO: Analysed target //org.eclipse.jgit.pgm:jgit (39 packages loaded). INFO: Found 1 target... Target //org.eclipse.jgit.pgm:jgit up-to-date: bazel-bin/org.eclipse.jgit.pgm/jgit.jar bazel-bin/org.eclipse.jgit.pgm/jgit INFO: Elapsed time: 15.862s, Critical Path: 14.74s INFO: 42 processes: 32 linux-sandbox, 1 local, 9 worker. INFO: Build completed successfully, 60 total actions $ bazel-bin/org.eclipse.jgit.pgm/jgit rev-list HEAD^..HEAD 2>/dev/null e5ed926e02dd29b5e970d421b63b6921cc1800f5 Still to do: - suppress "Failed to load class "org.slf4j.impl.StaticLoggerBinder" output - add org.eclipse.jgit.pgm.test tests to bazel build - supply package information so that "jgit version" can work Change-Id: Ie89872839fa5aae974d5d39b6776b96332b0e83f --- org.eclipse.jgit.pgm/BUILD | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/org.eclipse.jgit.pgm/BUILD b/org.eclipse.jgit.pgm/BUILD index 07922687e..bbf4b1c43 100644 --- a/org.eclipse.jgit.pgm/BUILD +++ b/org.eclipse.jgit.pgm/BUILD @@ -25,6 +25,12 @@ java_library( ], ) +java_binary( + name = "jgit", + runtime_deps = [":pgm"], + main_class = "org.eclipse.jgit.pgm.Main", +) + java_import( name = "services", jars = [":services_jar"],