David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 1 | load("//tools/bzl:genrule2.bzl", "genrule2") |
| 2 | load("//tools/bzl:gwt.bzl", "gwt_module") |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 3 | |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 4 | SRC = "src/main/java/org/eclipse/jgit/" |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 5 | |
| 6 | gwt_module( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 7 | 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 Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 19 | ) |
| 20 | |
| 21 | gwt_module( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 22 | name = "Edit", |
| 23 | srcs = [":jgit_edit_src"], |
| 24 | visibility = ["//visibility:public"], |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 25 | ) |
| 26 | |
| 27 | genrule2( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 28 | name = "jgit_edit_src", |
| 29 | outs = ["edit.srcjar"], |
| 30 | cmd = " && ".join([ |
David Ostrovsky | e51b745 | 2016-11-06 18:07:10 +0100 | [diff] [blame] | 31 | "unzip -qd $$TMP $(location //lib/jgit/org.eclipse.jgit:jgit-source) " + |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 32 | "org/eclipse/jgit/diff/Edit.java", |
| 33 | "cd $$TMP", |
| 34 | "zip -Dq $$ROOT/$@ org/eclipse/jgit/diff/Edit.java", |
| 35 | ]), |
David Ostrovsky | e51b745 | 2016-11-06 18:07:10 +0100 | [diff] [blame] | 36 | tools = ["//lib/jgit/org.eclipse.jgit:jgit-source"], |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 37 | ) |
| 38 | |
| 39 | java_library( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 40 | 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 Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 55 | ) |
| 56 | |
| 57 | java_test( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 58 | 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 Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 67 | ) |