Remove //lib/jgit:jgit from UI deps

This should only appear in the server deps.
For UI code build //lib/jgit:edit_lib which
has only the tiny slice of code used in the UI.

Change-Id: Ia46c0559a7180f80fda30efb8884ca236997c92d
diff --git a/gerrit-common/BUCK b/gerrit-common/BUCK
index a4d399b..718c751 100644
--- a/gerrit-common/BUCK
+++ b/gerrit-common/BUCK
@@ -32,7 +32,7 @@
     '//gerrit-reviewdb:client',
     '//lib:gwtjsonrpc',
     '//lib:gwtorm',
-    '//lib/jgit:jgit',
+    '//lib/jgit:Edit',
   ],
   visibility = ['PUBLIC'],
 )
diff --git a/gerrit-gwtui/BUCK b/gerrit-gwtui/BUCK
index 2a6c7f8..ce6e081 100644
--- a/gerrit-gwtui/BUCK
+++ b/gerrit-gwtui/BUCK
@@ -44,7 +44,7 @@
     '//lib:gwtorm',
     '//lib/codemirror:codemirror',
     '//lib/gwt:user',
-    '//lib/jgit:jgit',
+    '//lib/jgit:Edit',
   ],
   visibility = [
     '//tools/eclipse:classpath',
diff --git a/gerrit-patch-jgit/BUCK b/gerrit-patch-jgit/BUCK
index e621722..64155bf 100644
--- a/gerrit-patch-jgit/BUCK
+++ b/gerrit-patch-jgit/BUCK
@@ -10,7 +10,6 @@
   deps = [
     '//lib:gwtjsonrpc',
     '//lib/gwt:user',
-    '//lib/jgit:jgit',
     '//lib/jgit:Edit',
   ],
   visibility = ['PUBLIC'],
diff --git a/gerrit-prettify/BUCK b/gerrit-prettify/BUCK
index cc42d2b7..2a5367e 100644
--- a/gerrit-prettify/BUCK
+++ b/gerrit-prettify/BUCK
@@ -18,7 +18,7 @@
     '//lib:guava',
     '//lib:gwtjsonrpc',
     '//lib/gwt:user',
-    '//lib/jgit:jgit',
+    '//lib/jgit:Edit',
   ],
   visibility = ['PUBLIC'],
 )
diff --git a/lib/jgit/BUCK b/lib/jgit/BUCK
index 68847f6..c7c6376 100644
--- a/lib/jgit/BUCK
+++ b/lib/jgit/BUCK
@@ -67,17 +67,23 @@
   license = 'Apache2.0',
 )
 
-prebuilt_jar(
+gwt_module(
   name = 'Edit',
-  binary_jar = ':jgit_edit_src',
+  srcs = [':jgit_edit_src'],
+  deps = [':edit_src'],
   visibility = ['PUBLIC'],
 )
 
+prebuilt_jar(
+  name = 'edit_src',
+  binary_jar = ':jgit_edit_src',
+)
+
 genrule(
   name = 'jgit_edit_src',
   cmd = 'unzip -qd $TMP $(location :jgit_src) ' +
     'org/eclipse/jgit/diff/Edit.java;' +
     'cd $TMP;' +
     'zip -Dq $OUT org/eclipse/jgit/diff/Edit.java',
-  out = 'edit-src.jar',
+  out = 'edit.src.zip',
 )