
Implement a new build system using Buck[1], Facebook's open source clone of Google's internal build system. Pros: - Concise build language - Test and build output is concise - Test failures and stack traces show on terminal - Reliable incrementals; clean is unnecessary - Extensible with simple blocks of Python - Fast buck: clean: 0.452s, full 1m21.083s [*], no-op: 7.145s, mvn: clean: 4.596s, full 2m53.776s, no-op: 59.108s, [*] full build includes downloading all dependencies, time can vary due to remote server performance. Cons: - No Windows support - No native Maven Central support (added by macros) - No native GWT, Prolog, or WAR support (added by macros) - Bootstrap of buck requires Ant Getting started: git clone https://gerrit.googlesource.com/buck cd buck ant Mac OS X: PATH="`pwd`/bin:/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands:$PATH" Linux: PATH="`pwd`/bin:$PATH" Importing into Eclipse: $ time buck build :eclipse 0m48.949s Import existing project from `pwd` Import 'gerrit' (do not import other Maven based projects) Expand 'gerrit' Right click 'buck-out' > Properties Under Attributes check 'Derived' If the code doesn't currently compile but an updated classpath is needed, refresh the configs and obtain missing JARs: $ buck build :eclipse_project :download Running JUnit tests: $ time buck test --all -e slow # skip slow tests 0m19.320s $ time buck test --all # includes acceptance tests 5m17.517s Building WAR: $ buck build :gerrit $ java -jar buck-out/gen/gerrit.war Building release: $ buck test --all && buck build :api :release $ java -jar buck-out/gen/release.war $ ls -lh buck-out/gen/{extension,plugin}-api.jar Downloading dependencies: Dependencies are normally downloaded automatically, but Buck can inspect its graph and download missing dependencies so future compiles can run without the network: $ buck build :download [1] http://facebook.github.io/buck/ Change-Id: I40853b108bd8e153cefa0896a5280a9a5ff81655
66 lines
1.5 KiB
Python
66 lines
1.5 KiB
Python
include_defs('//lib/maven.defs')
|
|
|
|
REPO = GERRIT
|
|
VERS = '2.3.1.201302201838-r.211-g36144e1'
|
|
|
|
maven_jar(
|
|
name = 'jgit',
|
|
id = 'org.eclipse.jgit:org.eclipse.jgit:' + VERS,
|
|
bin_sha1 = '4328d64fb5f5a5a07795965801850a10901b0979',
|
|
src_sha1 = 'e55f1e231138df01edee9014df94ca3c6cbf0d8e',
|
|
license = 'jgit',
|
|
repository = REPO,
|
|
deps = [':ewah'],
|
|
exclude = [
|
|
'META-INF/eclipse.inf',
|
|
'about.html',
|
|
'plugin.properties',
|
|
],
|
|
)
|
|
|
|
maven_jar(
|
|
name = 'jgit-servlet',
|
|
id = 'org.eclipse.jgit:org.eclipse.jgit.http.server:' + VERS,
|
|
sha1 = '269b4096780247a26368985b05e4b66f16785946',
|
|
license = 'jgit',
|
|
repository = REPO,
|
|
deps = [':jgit'],
|
|
exclude = [
|
|
'about.html',
|
|
'plugin.properties',
|
|
],
|
|
)
|
|
|
|
maven_jar(
|
|
name = 'junit',
|
|
id = 'org.eclipse.jgit:org.eclipse.jgit.junit:' + VERS,
|
|
sha1 = '0fa01088b0f7a847dabafec59318221828832b36',
|
|
license = 'DO_NOT_DISTRIBUTE',
|
|
repository = REPO,
|
|
deps = [':jgit'],
|
|
)
|
|
|
|
maven_jar(
|
|
name = 'ewah',
|
|
id = 'com.googlecode.javaewah:JavaEWAH:0.5.6',
|
|
sha1 = '1207c0fc8552d4f5f574b50f29321d923521128e',
|
|
license = 'Apache2.0',
|
|
)
|
|
|
|
prebuilt_jar(
|
|
name = 'Edit',
|
|
binary_jar = genfile('edit-src.jar'),
|
|
deps = [':jgit_edit_src'],
|
|
visibility = ['PUBLIC'],
|
|
)
|
|
|
|
genrule(
|
|
name = 'jgit_edit_src',
|
|
cmd = 'unzip -qd $TMP $SRCS org/eclipse/jgit/diff/Edit.java;' +
|
|
'cd $TMP;' +
|
|
'zip -Dq $OUT org/eclipse/jgit/diff/Edit.java',
|
|
srcs = [genfile('jgit/org.eclipse.jgit-%s-src.jar' % VERS)],
|
|
out = 'edit-src.jar',
|
|
deps = [':jgit_src']
|
|
)
|