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.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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.lfs:jgit-lfs',
  12. '//org.eclipse.jgit.lfs.server:jgit-lfs-server',
  13. '//org.eclipse.jgit.ui:ui',
  14. '//lib:args4j',
  15. '//lib:httpcomponents',
  16. '//lib:httpcore',
  17. '//lib/jetty:http',
  18. '//lib/jetty:io',
  19. '//lib/jetty:server',
  20. '//lib/jetty:servlet',
  21. '//lib/jetty:security',
  22. '//lib/jetty:util',
  23. '//lib:servlet-api'
  24. ],
  25. visibility = ['PUBLIC'],
  26. )
  27. prebuilt_jar(
  28. name = 'services',
  29. binary_jar = ':services__jar',
  30. )
  31. genrule(
  32. name = 'services__jar',
  33. cmd = 'cd $SRCDIR ; zip -qr $OUT .',
  34. srcs = glob(['META-INF/services/*']),
  35. out = 'services.jar',
  36. )
  37. genrule(
  38. name = 'jgit',
  39. cmd = ''.join([
  40. 'mkdir $TMP/META-INF &&',
  41. 'cp $(location :binary_manifest) $TMP/META-INF/MANIFEST.MF &&',
  42. 'cp $(location :jgit_jar) $TMP/jgit.jar &&',
  43. 'cd $TMP && zip $TMP/jgit.jar META-INF/MANIFEST.MF &&',
  44. 'cat $SRCDIR/jgit.sh $TMP/jgit.jar >$OUT &&',
  45. 'chmod a+x $OUT',
  46. ]),
  47. srcs = ['jgit.sh'],
  48. out = 'jgit',
  49. visibility = ['PUBLIC'],
  50. )
  51. java_binary(
  52. name = 'jgit_jar',
  53. deps = [
  54. ':pgm',
  55. '//lib:slf4j-simple',
  56. '//lib:tukaani-xz',
  57. ],
  58. blacklist = [
  59. 'META-INF/DEPENDENCIES',
  60. 'META-INF/maven/.*',
  61. ],
  62. )
  63. genrule(
  64. name = 'binary_manifest',
  65. cmd = ';'.join(['echo "%s: %s" >>$OUT' % e for e in [
  66. ('Manifest-Version', '1.0'),
  67. ('Main-Class', 'org.eclipse.jgit.pgm.Main'),
  68. ('Bundle-Version', git_version()),
  69. ('Implementation-Title', 'JGit Command Line Interface'),
  70. ('Implementation-Vendor', 'Eclipse.org - JGit'),
  71. ('Implementation-Vendor-URL', 'http://www.eclipse.org/jgit/'),
  72. ('Implementation-Vendor-Id', 'org.eclipse.jgit'),
  73. ]] + ['echo >>$OUT']),
  74. out = 'MANIFEST.MF',
  75. )