blob: 1a8fcd44771367d998d53bc1ae68edf2fc26baa1 [file] [log] [blame]
David Ostrovskyfa189072016-11-30 08:52:06 +01001load("//tools/bzl:genrule2.bzl", "genrule2")
2load("//tools/bzl:gwt.bzl", "gwt_module")
David Ostrovskyb81b4f72016-05-21 19:55:01 +02003
David Ostrovskyfa189072016-11-30 08:52:06 +01004SRC = "src/main/java/org/eclipse/jgit/"
David Ostrovskyb81b4f72016-05-21 19:55:01 +02005
6gwt_module(
David Ostrovskyfa189072016-11-30 08:52:06 +01007 name = "client",
8 srcs = [
9 SRC + "diff/Edit_JsonSerializer.java",
10 SRC + "diff/ReplaceEdit.java",
11 ],
12 gwt_xml = SRC + "JGit.gwt.xml",
13 visibility = ["//visibility:public"],
14 deps = [
15 ":Edit",
16 "//lib:gwtjsonrpc",
17 "//lib/gwt:user",
18 ],
David Ostrovskyb81b4f72016-05-21 19:55:01 +020019)
20
21gwt_module(
David Ostrovskyfa189072016-11-30 08:52:06 +010022 name = "Edit",
23 srcs = [":jgit_edit_src"],
24 visibility = ["//visibility:public"],
David Ostrovskyb81b4f72016-05-21 19:55:01 +020025)
26
27genrule2(
David Ostrovskyfa189072016-11-30 08:52:06 +010028 name = "jgit_edit_src",
29 outs = ["edit.srcjar"],
30 cmd = " && ".join([
David Ostrovskye51b7452016-11-06 18:07:10 +010031 "unzip -qd $$TMP $(location //lib/jgit/org.eclipse.jgit:jgit-source) " +
David Ostrovskyfa189072016-11-30 08:52:06 +010032 "org/eclipse/jgit/diff/Edit.java",
33 "cd $$TMP",
34 "zip -Dq $$ROOT/$@ org/eclipse/jgit/diff/Edit.java",
35 ]),
David Ostrovskye51b7452016-11-06 18:07:10 +010036 tools = ["//lib/jgit/org.eclipse.jgit:jgit-source"],
David Ostrovskyb81b4f72016-05-21 19:55:01 +020037)
38
39java_library(
David Ostrovskyfa189072016-11-30 08:52:06 +010040 name = "server",
41 srcs = [
42 SRC + x
43 for x in [
44 "diff/EditDeserializer.java",
45 "diff/ReplaceEdit.java",
46 "internal/storage/file/WindowCacheStatAccessor.java",
47 "lib/ObjectIdSerialization.java",
48 ]
49 ],
50 visibility = ["//visibility:public"],
51 deps = [
52 "//lib:gson",
53 "//lib/jgit/org.eclipse.jgit:jgit",
54 ],
David Ostrovskyb81b4f72016-05-21 19:55:01 +020055)
56
57java_test(
David Ostrovskyfa189072016-11-30 08:52:06 +010058 name = "jgit_patch_tests",
59 srcs = glob(["src/test/java/**/*.java"]),
60 test_class = "org.eclipse.jgit.diff.EditDeserializerTest",
61 visibility = ["//visibility:public"],
62 deps = [
63 ":server",
64 "//lib:junit",
65 "//lib/jgit/org.eclipse.jgit:jgit",
66 ],
David Ostrovskyb81b4f72016-05-21 19:55:01 +020067)