xref: /JGit/org.eclipse.jgit.test/BUILD (revision 22973d13ea4eaef390a9ce00d448317808e07ced)
10f6ddb37SDavid Ostrovskyload(
20f6ddb37SDavid Ostrovsky    "@com_googlesource_gerrit_bazlets//tools:genrule2.bzl",
30f6ddb37SDavid Ostrovsky    "genrule2",
40f6ddb37SDavid Ostrovsky)
5*22973d13SMatthias Sohnload("@rules_java//java:defs.bzl", "java_import", "java_library")
69150caa8SDavid Pursehouseload(":tests.bzl", "tests")
70f6ddb37SDavid Ostrovsky
80f6ddb37SDavid OstrovskyPKG = "tst/org/eclipse/jgit/"
90f6ddb37SDavid Ostrovsky
10488d9557SThomas WolfHELPERS = glob(
11488d9557SThomas Wolf    ["src/**/*.java"],
12f4c0189fSDavid Pursehouse    exclude = ["src/org/eclipse/jgit/transport/ssh/*.java"],
13488d9557SThomas Wolf) + [PKG + c for c in [
140f6ddb37SDavid Ostrovsky    "api/AbstractRemoteCommandTest.java",
150f6ddb37SDavid Ostrovsky    "diff/AbstractDiffTestCase.java",
160f6ddb37SDavid Ostrovsky    "internal/storage/file/GcTestCase.java",
170f6ddb37SDavid Ostrovsky    "internal/storage/file/PackIndexTestCase.java",
180f6ddb37SDavid Ostrovsky    "internal/storage/file/XInputStream.java",
190f6ddb37SDavid Ostrovsky    "nls/GermanTranslatedBundle.java",
200f6ddb37SDavid Ostrovsky    "nls/MissingPropertyBundle.java",
210f6ddb37SDavid Ostrovsky    "nls/NoPropertiesBundle.java",
220f6ddb37SDavid Ostrovsky    "nls/NonTranslatedBundle.java",
230f6ddb37SDavid Ostrovsky    "revwalk/RevQueueTestCase.java",
240f6ddb37SDavid Ostrovsky    "revwalk/RevWalkTestCase.java",
25a6da0591SDavid Pursehouse    "transport/ObjectIdMatcher.java",
260f6ddb37SDavid Ostrovsky    "transport/SpiTransport.java",
270f6ddb37SDavid Ostrovsky    "treewalk/filter/AlwaysCloneTreeFilter.java",
280f6ddb37SDavid Ostrovsky    "test/resources/SampleDataRepositoryTestCase.java",
290f6ddb37SDavid Ostrovsky    "util/CPUTimeStopWatch.java",
300f6ddb37SDavid Ostrovsky    "util/io/Strings.java",
310f6ddb37SDavid Ostrovsky]]
320f6ddb37SDavid Ostrovsky
330f6ddb37SDavid OstrovskyDATA = [
340f6ddb37SDavid Ostrovsky    PKG + "lib/empty.gitindex.dat",
350f6ddb37SDavid Ostrovsky    PKG + "lib/sorttest.gitindex.dat",
360f6ddb37SDavid Ostrovsky]
370f6ddb37SDavid Ostrovsky
38488d9557SThomas WolfRESOURCES = glob(["resources/**"])
39488d9557SThomas Wolf
40bbef67e8SDavid Ostrovskytests(tests = glob(
410f6ddb37SDavid Ostrovsky    ["tst/**/*.java"],
42904e9f8bSDavid Pursehouse    exclude = HELPERS + DATA,
430f6ddb37SDavid Ostrovsky))
440f6ddb37SDavid Ostrovsky
450f6ddb37SDavid Ostrovskyjava_library(
460f6ddb37SDavid Ostrovsky    name = "helpers",
470f6ddb37SDavid Ostrovsky    testonly = 1,
480f6ddb37SDavid Ostrovsky    srcs = HELPERS,
490f6ddb37SDavid Ostrovsky    resources = DATA,
500f6ddb37SDavid Ostrovsky    deps = [
5108b0a863SThomas Wolf        "//lib:jsch",
5228cfda54SDavid Pursehouse        "//lib:junit",
532532fa74SMatthias Sohn        "//lib:mockito",
541fd09a19SDavid Pursehouse        "//lib:slf4j-simple",
550f6ddb37SDavid Ostrovsky        "//org.eclipse.jgit:jgit",
560f6ddb37SDavid Ostrovsky        "//org.eclipse.jgit.junit:junit",
570f6ddb37SDavid Ostrovsky    ],
580f6ddb37SDavid Ostrovsky)
590f6ddb37SDavid Ostrovsky
60488d9557SThomas Wolfjava_library(
61488d9557SThomas Wolf    name = "sshd-helpers",
62488d9557SThomas Wolf    testonly = 1,
63488d9557SThomas Wolf    srcs = glob(["src/org/eclipse/jgit/transport/ssh/*.java"]),
64488d9557SThomas Wolf    resource_strip_prefix = "org.eclipse.jgit.test/resources",
65488d9557SThomas Wolf    resources = RESOURCES,
66488d9557SThomas Wolf    visibility = [
67488d9557SThomas Wolf        "//org.eclipse.jgit.ssh.apache.test:__pkg__",
68488d9557SThomas Wolf    ],
69f4c0189fSDavid Pursehouse    deps = [
70f4c0189fSDavid Pursehouse        "//lib:jsch",
71f4c0189fSDavid Pursehouse        "//lib:junit",
72f4c0189fSDavid Pursehouse        "//lib:sshd-core",
73f4c0189fSDavid Pursehouse        "//lib:sshd-sftp",
74f4c0189fSDavid Pursehouse        "//org.eclipse.jgit:jgit",
75f4c0189fSDavid Pursehouse        "//org.eclipse.jgit.junit:junit",
761316d43eSThomas Wolf        "//org.eclipse.jgit.junit.ssh:junit-ssh",
77f4c0189fSDavid Pursehouse    ],
78488d9557SThomas Wolf)
79488d9557SThomas Wolf
800f6ddb37SDavid Ostrovskyjava_import(
810f6ddb37SDavid Ostrovsky    name = "tst_rsrc",
820f6ddb37SDavid Ostrovsky    jars = [":tst_rsrc_jar"],
830f6ddb37SDavid Ostrovsky)
840f6ddb37SDavid Ostrovsky
850f6ddb37SDavid Ostrovskygenrule2(
86904e9f8bSDavid Pursehouse    name = "tst_rsrc_jar",
87904e9f8bSDavid Pursehouse    srcs = glob(["tst-rsrc/**"]),
88904e9f8bSDavid Pursehouse    outs = ["tst_rsrc.jar"],
89904e9f8bSDavid Pursehouse    cmd = "o=$$PWD/$@ && tar cf - $(SRCS) | tar -C $$TMP --strip-components=2 -xf - && cd  $$TMP && zip -qr $$o .",
900f6ddb37SDavid Ostrovsky)
91