Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Ostrovsky2015-12-04 07:27:57 +0000
committerShawn Pearce2015-12-31 18:08:55 +0000
commit13502fef8f4814c6c5bdfa63674c94f9d32b5531 (patch)
tree0859856732a406008ba6fda2c813567abfdcd27f
parent2fbd98dbe8e56aafe4bbf4252b5734c762fb225f (diff)
downloadjgit-13502fef8f4814c6c5bdfa63674c94f9d32b5531.tar.gz
jgit-13502fef8f4814c6c5bdfa63674c94f9d32b5531.tar.xz
jgit-13502fef8f4814c6c5bdfa63674c94f9d32b5531.zip
Implement Buck driven build
Today there are plenty of modern build tool systems available in the wild (in no particular order): * http://bazel.io * https://pantsbuild.github.io * http://shakebuild.com * https://ninja-build.org * https://buckbuild.com The attributes, that all these build tools have in common, are: * reliable * correct * very fast * reproducible It must not always be the other build tool, this project is currently using. Or, quoting Gerrit Code Review maintainer here: "Friends, don't let friends use <the other build tool system>!" This change is non-complete implementation of JGit build in Buck, needed by Gerrit Code Review to replace its dependency with standlone JGit cell. This is very useful when a developer is working on both projects and is trying to integrate changes made in JGit in Gerrit. The supported workflow is: $ cd jgit $ emacs <hack> $ cd ../gerrit $ buck build --config repositories.jgit=../jgit gerrit With --config repositories.jgit=../jgit jgit cell is routed through JGit development tree. To build jgit, issue: $ buck build //:jgit [-] PROCESSING BUCK FILES...FINISHED 0,0s Yes, you can't measure no-op build time, given that Buck daemon is used. Change-Id: I301a71b19fba35a5093d8cc64d4ba970c2877a44 Signed-off-by: David Ostrovsky <david@ostrovsky.org>
-rw-r--r--.buckconfig15
-rw-r--r--.gitignore2
-rw-r--r--BUCK38
-rw-r--r--lib/BUCK62
-rw-r--r--org.eclipse.jgit.archive/BUCK13
-rw-r--r--org.eclipse.jgit.http.server/BUCK10
-rw-r--r--org.eclipse.jgit.junit/BUCK10
-rw-r--r--org.eclipse.jgit/BUCK20
-rw-r--r--tools/default.defs42
9 files changed, 212 insertions, 0 deletions
diff --git a/.buckconfig b/.buckconfig
new file mode 100644
index 0000000000..ef82fa07f7
--- /dev/null
+++ b/.buckconfig
@@ -0,0 +1,15 @@
+[buildfile]
+ includes = //tools/default.defs
+
+[java]
+ src_roots = src, resources
+
+[project]
+ ignore = .git
+
+[cache]
+ mode = dir
+
+[download]
+ maven_repo = http://repo1.maven.org/maven2
+ in_build = true
diff --git a/.gitignore b/.gitignore
index 139e5aee6d..6c62199484 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
/target
/.project
+/buck-cache
+/buck-out
diff --git a/BUCK b/BUCK
new file mode 100644
index 0000000000..7704281ecf
--- /dev/null
+++ b/BUCK
@@ -0,0 +1,38 @@
+java_library(
+ name = 'jgit',
+ exported_deps = ['//org.eclipse.jgit:jgit'],
+ visibility = ['PUBLIC'],
+)
+
+java_library(
+ name = 'jgit_src',
+ exported_deps = ['//org.eclipse.jgit:jgit_src'],
+ visibility = ['PUBLIC'],
+)
+
+java_library(
+ name = 'jgit-servlet',
+ exported_deps = [
+ ':jgit',
+ '//org.eclipse.jgit.http.server:jgit-servlet'
+ ],
+ visibility = ['PUBLIC'],
+)
+
+java_library(
+ name = 'jgit-archive',
+ exported_deps = [
+ ':jgit',
+ '//org.eclipse.jgit.archive:jgit-archive'
+ ],
+ visibility = ['PUBLIC'],
+)
+
+java_library(
+ name = 'junit',
+ exported_deps = [
+ ':jgit',
+ '//org.eclipse.jgit.junit:junit'
+ ],
+ visibility = ['PUBLIC'],
+)
diff --git a/lib/BUCK b/lib/BUCK
new file mode 100644
index 0000000000..19cc2e0392
--- /dev/null
+++ b/lib/BUCK
@@ -0,0 +1,62 @@
+maven_jar(
+ name = 'jsch',
+ bin_sha1 = '658b682d5c817b27ae795637dfec047c63d29935',
+ src_sha1 = '791359d94d6edcace686a56d0727ee093a2f7c33',
+ group = 'com.jcraft',
+ artifact = 'jsch',
+ version = '0.1.53',
+)
+
+maven_jar(
+ name = 'javaewah',
+ bin_sha1 = 'eceaf316a8faf0e794296ebe158ae110c7d72a5a',
+ src_sha1 = 'a50d78eb630e05439461f3130b94b3bcd1ea6f03',
+ group = 'com.googlecode.javaewah',
+ artifact = 'JavaEWAH',
+ version = '0.7.9',
+)
+
+maven_jar(
+ name = 'httpcomponents',
+ bin_sha1 = '4c47155e3e6c9a41a28db36680b828ced53b8af4',
+ src_sha1 = 'af4d76be0c46ee26b0d9d1d4a34d244a633cac84',
+ group = 'org.apache.httpcomponents',
+ artifact = 'httpclient',
+ version = '4.3.6',
+)
+
+maven_jar(
+ name = 'slf4j-api',
+ bin_sha1 = '0081d61b7f33ebeab314e07de0cc596f8e858d97',
+ src_sha1 = '58d38f68d4a867d4552ae27960bb348d7eaa1297',
+ group = 'org.slf4j',
+ artifact = 'slf4j-api',
+ version = '1.7.2',
+)
+
+maven_jar(
+ name = 'servlet-api',
+ bin_sha1 = '3cd63d075497751784b2fa84be59432f4905bf7c',
+ src_sha1 = 'ab3976d4574c48d22dc1abf6a9e8bd0fdf928223',
+ group = 'javax.servlet',
+ artifact = 'javax.servlet-api',
+ version = '3.1.0',
+)
+
+maven_jar(
+ name = 'commons-compress',
+ bin_sha1 = 'c7d9b580aff9e9f1998361f16578e63e5c064699',
+ src_sha1 = '396b81bdfd0fb617178e1707ef64832215307c78',
+ group = 'org.apache.commons',
+ artifact = 'commons-compress',
+ version = '1.6',
+)
+
+maven_jar(
+ name = 'junit',
+ bin_sha1 = '4e031bb61df09069aeb2bffb4019e7a5034a4ee0',
+ src_sha1 = '28e0ad201304e4a4abf999ca0570b7cffc352c3c',
+ group = 'junit',
+ artifact = 'junit',
+ version = '4.11',
+)
diff --git a/org.eclipse.jgit.archive/BUCK b/org.eclipse.jgit.archive/BUCK
new file mode 100644
index 0000000000..ae170324e3
--- /dev/null
+++ b/org.eclipse.jgit.archive/BUCK
@@ -0,0 +1,13 @@
+java_library(
+ name = 'jgit-archive',
+ srcs = glob(
+ ['src/**'],
+ excludes = ['src/org/eclipse/jgit/archive/FormatActivator.java'],
+ ),
+ resources = glob(['resources/**']),
+ provided_deps = [
+ '//org.eclipse.jgit:jgit',
+ '//lib:commons-compress',
+ ],
+ visibility = ['PUBLIC'],
+)
diff --git a/org.eclipse.jgit.http.server/BUCK b/org.eclipse.jgit.http.server/BUCK
new file mode 100644
index 0000000000..3743557aa5
--- /dev/null
+++ b/org.eclipse.jgit.http.server/BUCK
@@ -0,0 +1,10 @@
+java_library(
+ name = 'jgit-servlet',
+ srcs = glob(['src/**']),
+ resources = glob(['resources/**']),
+ provided_deps = [
+ '//org.eclipse.jgit:jgit',
+ '//lib:servlet-api',
+ ],
+ visibility = ['PUBLIC'],
+)
diff --git a/org.eclipse.jgit.junit/BUCK b/org.eclipse.jgit.junit/BUCK
new file mode 100644
index 0000000000..7e2543220a
--- /dev/null
+++ b/org.eclipse.jgit.junit/BUCK
@@ -0,0 +1,10 @@
+java_library(
+ name = 'junit',
+ srcs = glob(['src/**']),
+ resources = glob(['resources/**']),
+ provided_deps = [
+ '//org.eclipse.jgit:jgit',
+ '//lib:junit',
+ ],
+ visibility = ['PUBLIC'],
+)
diff --git a/org.eclipse.jgit/BUCK b/org.eclipse.jgit/BUCK
new file mode 100644
index 0000000000..73e2080576
--- /dev/null
+++ b/org.eclipse.jgit/BUCK
@@ -0,0 +1,20 @@
+SRCS = glob(['src/**'])
+RESOURCES = glob(['resources/**'])
+
+java_library(
+ name = 'jgit',
+ srcs = SRCS,
+ resources = RESOURCES,
+ deps = [
+ '//lib:javaewah',
+ '//lib:jsch',
+ '//lib:httpcomponents',
+ '//lib:slf4j-api',
+ ],
+ visibility = ['PUBLIC'],
+)
+
+java_sources(
+ name = 'jgit_src',
+ srcs = SRCS + RESOURCES,
+)
diff --git a/tools/default.defs b/tools/default.defs
new file mode 100644
index 0000000000..3481fa1f8a
--- /dev/null
+++ b/tools/default.defs
@@ -0,0 +1,42 @@
+def java_sources(
+ name,
+ srcs,
+ visibility = ['PUBLIC']
+ ):
+ java_library(
+ name = name,
+ resources = srcs,
+ visibility = visibility,
+ )
+
+def maven_jar(
+ name,
+ group,
+ artifact,
+ version,
+ bin_sha1,
+ src_sha1,
+ visibility = ['PUBLIC']):
+ jar_name = '%s__jar' % name
+ src_name = '%s__src' % name
+
+ remote_file(
+ name = jar_name,
+ sha1 = bin_sha1,
+ url = 'mvn:%s:%s:jar:%s' % (group, artifact, version),
+ out = '%s.jar' % jar_name,
+ )
+
+ remote_file(
+ name = src_name,
+ sha1 = src_sha1,
+ url = 'mvn:%s:%s:src:%s' % (group, artifact, version),
+ out = '%s.jar' % src_name,
+ )
+
+ prebuilt_jar(
+ name = name,
+ binary_jar = ':' + jar_name,
+ source_jar = ':' + src_name,
+ visibility = visibility)
+

Back to the top