Browse Source

buck: build standalone jgit binary

Construct the java_application JAR wrapped with the shell script
header.  This is enough to clone a repository over HTTPs:

  $ buck build :jgit_bin
  $ buck-out/gen/jgit_bin/jgit_bin clone https://...

Change-Id: I4aceb4e77b2ec9be76a32ec93d94f2dafe9acce6
stable-4.3
Shawn Pearce 9 years ago
parent
commit
34de70a5d4
  1. 6
      BUCK
  2. 36
      lib/BUCK
  3. 12
      org.eclipse.jgit.http.apache/BUCK
  4. 44
      org.eclipse.jgit.pgm/BUCK
  5. 7
      org.eclipse.jgit.ui/BUCK

6
BUCK

@ -36,3 +36,9 @@ java_library(
], ],
visibility = ['PUBLIC'], visibility = ['PUBLIC'],
) )
genrule(
name = 'jgit_bin',
cmd = 'ln -s $(location //org.eclipse.jgit.pgm:jgit) $OUT',
out = 'jgit_bin',
)

36
lib/BUCK

@ -25,6 +25,24 @@ maven_jar(
version = '4.3.6', version = '4.3.6',
) )
maven_jar(
name = 'httpcore',
bin_sha1 = 'f91b7a4aadc5cf486df6e4634748d7dd7a73f06d',
src_sha1 = '1b0aa62a6a91e9fa00c16f0a4a2c874804ed3b1e',
group = 'org.apache.httpcomponents',
artifact = 'httpcore',
version = '4.3.3',
)
maven_jar(
name = 'commons-logging',
bin_sha1 = 'f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f',
src_sha1 = '28bb0405fddaf04f15058fbfbe01fe2780d7d3b6',
group = 'commons-logging',
artifact = 'commons-logging',
version = '1.1.3',
)
maven_jar( maven_jar(
name = 'slf4j-api', name = 'slf4j-api',
bin_sha1 = '0081d61b7f33ebeab314e07de0cc596f8e858d97', bin_sha1 = '0081d61b7f33ebeab314e07de0cc596f8e858d97',
@ -34,6 +52,15 @@ maven_jar(
version = '1.7.2', version = '1.7.2',
) )
maven_jar(
name = 'slf4j-simple',
bin_sha1 = '760055906d7353ba4f7ce1b8908bc6b2e91f39fa',
src_sha1 = '09474919128b3a7fcf21a5f9c907f5251f234544',
group = 'org.slf4j',
artifact = 'slf4j-simple',
version = '1.7.2',
)
maven_jar( maven_jar(
name = 'servlet-api', name = 'servlet-api',
bin_sha1 = '3cd63d075497751784b2fa84be59432f4905bf7c', bin_sha1 = '3cd63d075497751784b2fa84be59432f4905bf7c',
@ -52,6 +79,15 @@ maven_jar(
version = '1.6', version = '1.6',
) )
maven_jar(
name = 'args4j',
bin_sha1 = '139441471327b9cc6d56436cb2a31e60eb6ed2ba',
src_sha1 = '22631b78cc8f60a6918557e8cbdb33e90f63a77f',
group = 'args4j',
artifact = 'args4j',
version = '2.0.15',
)
maven_jar( maven_jar(
name = 'junit', name = 'junit',
bin_sha1 = '4e031bb61df09069aeb2bffb4019e7a5034a4ee0', bin_sha1 = '4e031bb61df09069aeb2bffb4019e7a5034a4ee0',

12
org.eclipse.jgit.http.apache/BUCK

@ -0,0 +1,12 @@
java_library(
name = 'http-apache',
srcs = glob(['src/**']),
resources = glob(['resources/**']),
deps = [
'//org.eclipse.jgit:jgit',
'//lib:commons-logging',
'//lib:httpcomponents',
'//lib:httpcore',
],
visibility = ['PUBLIC'],
)

44
org.eclipse.jgit.pgm/BUCK

@ -0,0 +1,44 @@
java_library(
name = 'pgm',
srcs = glob(['src/**']),
resources = glob(['resources/**']),
deps = [
':services',
'//org.eclipse.jgit:jgit',
'//org.eclipse.jgit.archive:jgit-archive',
'//org.eclipse.jgit.http.apache:http-apache',
'//org.eclipse.jgit.ui:ui',
'//lib:args4j',
],
visibility = ['PUBLIC'],
)
prebuilt_jar(
name = 'services',
binary_jar = ':services__jar',
)
genrule(
name = 'services__jar',
cmd = 'cd $SRCDIR ; zip -qr $OUT .',
srcs = glob(['META-INF/services/*']),
out = 'services.jar',
)
genrule(
name = 'jgit',
cmd = 'cat $SRCDIR/jgit.sh $(location :jgit_jar) >$OUT;' +
'chmod a+x $OUT',
srcs = ['jgit.sh'],
out = 'jgit',
visibility = ['PUBLIC'],
)
java_binary(
name = 'jgit_jar',
main_class = 'org.eclipse.jgit.pgm.Main',
deps = [
':pgm',
'//lib:slf4j-simple',
],
)

7
org.eclipse.jgit.ui/BUCK

@ -0,0 +1,7 @@
java_library(
name = 'ui',
srcs = glob(['src/**']),
resources = glob(['resources/**']),
deps = ['//org.eclipse.jgit:jgit'],
visibility = ['PUBLIC'],
)
Loading…
Cancel
Save