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

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