You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BUCK 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. include_defs('//tools/git.defs')
  2. java_library(
  3. name = 'pgm',
  4. srcs = glob(['src/**']),
  5. resources = glob(['resources/**']),
  6. deps = [
  7. ':services',
  8. '//org.eclipse.jgit:jgit',
  9. '//org.eclipse.jgit.archive:jgit-archive',
  10. '//org.eclipse.jgit.http.apache:http-apache',
  11. '//org.eclipse.jgit.ui:ui',
  12. '//lib:args4j',
  13. ],
  14. visibility = ['PUBLIC'],
  15. )
  16. prebuilt_jar(
  17. name = 'services',
  18. binary_jar = ':services__jar',
  19. )
  20. genrule(
  21. name = 'services__jar',
  22. cmd = 'cd $SRCDIR ; zip -qr $OUT .',
  23. srcs = glob(['META-INF/services/*']),
  24. out = 'services.jar',
  25. )
  26. genrule(
  27. name = 'jgit',
  28. cmd = ''.join([
  29. 'mkdir $TMP/META-INF &&',
  30. 'cp $(location :binary_manifest) $TMP/META-INF/MANIFEST.MF &&',
  31. 'cp $(location :jgit_jar) $TMP/jgit.jar &&',
  32. 'cd $TMP && zip $TMP/jgit.jar META-INF/MANIFEST.MF &&',
  33. 'cat $SRCDIR/jgit.sh $TMP/jgit.jar >$OUT &&',
  34. 'chmod a+x $OUT',
  35. ]),
  36. srcs = ['jgit.sh'],
  37. out = 'jgit',
  38. visibility = ['PUBLIC'],
  39. )
  40. java_binary(
  41. name = 'jgit_jar',
  42. deps = [
  43. ':pgm',
  44. '//lib:slf4j-simple',
  45. '//lib:tukaani-xz',
  46. ],
  47. blacklist = [
  48. 'META-INF/DEPENDENCIES',
  49. 'META-INF/maven/.*',
  50. ],
  51. )
  52. genrule(
  53. name = 'binary_manifest',
  54. cmd = ';'.join(['echo "%s: %s" >>$OUT' % e for e in [
  55. ('Manifest-Version', '1.0'),
  56. ('Main-Class', 'org.eclipse.jgit.pgm.Main'),
  57. ('Bundle-Version', git_version()),
  58. ('Implementation-Title', 'JGit Command Line Interface'),
  59. ('Implementation-Vendor', 'Eclipse.org - JGit'),
  60. ('Implementation-Vendor-URL', 'http://www.eclipse.org/jgit/'),
  61. ('Implementation-Vendor-Id', 'org.eclipse.jgit'),
  62. ]] + ['echo >>$OUT']),
  63. out = 'MANIFEST.MF',
  64. )