Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
# Copyright (C) 2013 The Android Open Source Project
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2013-07-29 17:30:50 -07:00
|
|
|
# Rule definitions loaded by default into every BUCK file.
|
|
|
|
|
2013-11-20 21:02:54 +01:00
|
|
|
include_defs('//tools/buck.defs')
|
Buck: Add support for gerrit GWT plugins
This changes extends gerrit_plugin function with additional gwt_module
parameters. When passed, GWT application is created. Assumtion is met,
that this application depends on gerrit-plugin-gwtui module.
With this change Gerrit GWT plugins can be build with Buck:
MODULE = 'com.googlesource.gerrit.plugins.cookbook.HelloForm'
gerrit_plugin(
name = 'cookbook-plugin',
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/**/*']),
gwt_module = MODULE,
manifest_entries = [
'Gerrit-PluginName: cookbook',
'Gerrit-Module: com.googlesource.gerrit.plugins.cookbook.Module',
'Gerrit-HttpModule: com.googlesource.gerrit.plugins.cookbook.HttpModule',
'Gerrit-SshModule: com.googlesource.gerrit.plugins.cookbook.SshModule',
]
)
Change-Id: I4b131c7c2672675d99457651fcee63bf4f149c2f
2013-11-12 09:41:18 +01:00
|
|
|
include_defs('//tools/gwt-constants.defs')
|
|
|
|
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
def genantlr(
|
|
|
|
name,
|
|
|
|
srcs,
|
2013-07-24 08:09:31 -07:00
|
|
|
out):
|
|
|
|
tmp = name + '.src.zip'
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
genrule(
|
|
|
|
name = name,
|
|
|
|
srcs = srcs,
|
2013-07-24 08:09:31 -07:00
|
|
|
cmd = '$(exe //lib/antlr:antlr-tool) -o $TMP $SRCS;' +
|
2013-05-30 13:09:29 -07:00
|
|
|
'cd $TMP;' +
|
|
|
|
'zip -qr $OUT .',
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
deps = ['//lib/antlr:antlr-tool'],
|
2013-07-24 08:09:31 -07:00
|
|
|
out = out,
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
def gwt_module(
|
|
|
|
name,
|
|
|
|
srcs,
|
|
|
|
gwtxml = None,
|
|
|
|
resources = [],
|
|
|
|
deps = [],
|
2013-11-30 02:22:26 -08:00
|
|
|
compile_deps = [],
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
visibility = []):
|
|
|
|
if gwtxml:
|
|
|
|
resources = resources + [gwtxml]
|
|
|
|
java_library(
|
|
|
|
name = name,
|
2013-11-30 02:22:26 -08:00
|
|
|
deps = deps + compile_deps,
|
|
|
|
resources = srcs + resources,
|
|
|
|
visibility = visibility,
|
|
|
|
)
|
|
|
|
java_library(
|
|
|
|
name = name + '_lib',
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
srcs = srcs,
|
2013-11-30 02:22:26 -08:00
|
|
|
deps = [':' + name] + [d + '_lib' for d in deps] + compile_deps,
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
visibility = visibility,
|
|
|
|
)
|
|
|
|
|
|
|
|
def gwt_application(
|
|
|
|
name,
|
|
|
|
module_target,
|
|
|
|
compiler_opts = [],
|
|
|
|
compiler_jvm_flags = [],
|
|
|
|
deps = [],
|
|
|
|
visibility = []):
|
2013-10-17 20:29:05 -07:00
|
|
|
cmd = ['$(exe //lib/gwt:compiler)', module_target, '$TMP', '$OUT']
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
cmd += compiler_opts + ['--', '$DEPS']
|
|
|
|
genrule(
|
|
|
|
name = name,
|
|
|
|
cmd = ' '.join(cmd),
|
|
|
|
deps = [
|
|
|
|
'//lib/gwt:compiler',
|
|
|
|
'//lib/gwt:dev',
|
|
|
|
] + deps,
|
|
|
|
out = '%s.zip' % name,
|
|
|
|
visibility = visibility,
|
|
|
|
)
|
|
|
|
|
|
|
|
# Compiles a Java library with additional compile-time dependencies
|
|
|
|
# that do not show up as transitive dependencies to java_library()
|
|
|
|
# or java_binary() rule that depends on this library.
|
|
|
|
def java_library2(
|
|
|
|
name,
|
|
|
|
srcs = [],
|
|
|
|
resources = [],
|
|
|
|
deps = [],
|
|
|
|
compile_deps = [],
|
|
|
|
visibility = []):
|
|
|
|
c = name + '__compile'
|
|
|
|
t = name + '__link'
|
|
|
|
j = 'lib__%s__output/%s.jar' % (c, c)
|
|
|
|
o = 'lib__%s__output/%s.jar' % (name, name)
|
|
|
|
java_library(
|
|
|
|
name = c,
|
|
|
|
srcs = srcs,
|
|
|
|
resources = resources,
|
|
|
|
deps = deps + compile_deps,
|
2013-05-10 12:38:49 -07:00
|
|
|
visibility = ['//tools/eclipse:classpath'],
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
)
|
|
|
|
# Break the dependency chain by passing the newly built
|
|
|
|
# JAR to consumers through a prebuilt_jar().
|
|
|
|
genrule(
|
|
|
|
name = t,
|
|
|
|
cmd = 'mkdir -p $(dirname $OUT);ln -s $SRCS $OUT',
|
|
|
|
srcs = [genfile(j)],
|
|
|
|
deps = [':' + c],
|
|
|
|
out = o,
|
|
|
|
)
|
|
|
|
prebuilt_jar(
|
|
|
|
name = name,
|
|
|
|
binary_jar = genfile(o),
|
|
|
|
deps = deps + [':' + t],
|
|
|
|
visibility = visibility,
|
|
|
|
)
|
|
|
|
|
|
|
|
def gerrit_extension(
|
|
|
|
name,
|
|
|
|
deps = [],
|
Buck: Add support for non transitive plugin dependencies
In some cases it might be useful to be able to pass dependencies as non
transitive dependencies, that not included in final plugin binary.
Why? When plugin dependencies are needed in both bootstrap classpath and
in plugin then they must be put in $gerrit_path/lib dir. Having them in lib
and inside the plugin doesn't make much sense.
This change exposes compile_deps parameter to the gerrit_{plugin|extension}
methods. It is possible to create both versions of the plugin: with and without
dependencies.
gerrit_plugin(
name = 'javamelody',
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/resources/**/*']),
manifest_entries = [
'Gerrit-PluginName: javamelody',
'Gerrit-Module: com.googlesource.gerrit.plugins.javamelody.Module',
'Gerrit-HttpModule: com.googlesource.gerrit.plugins.javamelody.HttpModule',
],
deps = [
'//plugins/javamelody/lib:javamelody',
'//plugins/javamelody/lib:jrobin',
],
)
gerrit_plugin(
name = 'javamelody-no-deps',
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/resources/**/*']),
manifest_entries = [
'Gerrit-PluginName: javamelody',
'Gerrit-Module: com.googlesource.gerrit.plugins.javamelody.Module',
'Gerrit-HttpModule: com.googlesource.gerrit.plugins.javamelody.HttpModule',
],
compile_deps = [
'//plugins/javamelody/lib:javamelody',
'//plugins/javamelody/lib:jrobin',
],
)
Change-Id: Ia274dbeb18de8807f0ab1edf7144f12ff0d02d74
2013-12-09 23:45:40 +01:00
|
|
|
compile_deps = [],
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
srcs = [],
|
|
|
|
resources = [],
|
|
|
|
manifest_file = None,
|
2013-05-31 20:55:31 +02:00
|
|
|
manifest_entries = [],
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
visibility = ['PUBLIC']):
|
|
|
|
gerrit_plugin(
|
|
|
|
name = name,
|
|
|
|
deps = deps,
|
Buck: Add support for non transitive plugin dependencies
In some cases it might be useful to be able to pass dependencies as non
transitive dependencies, that not included in final plugin binary.
Why? When plugin dependencies are needed in both bootstrap classpath and
in plugin then they must be put in $gerrit_path/lib dir. Having them in lib
and inside the plugin doesn't make much sense.
This change exposes compile_deps parameter to the gerrit_{plugin|extension}
methods. It is possible to create both versions of the plugin: with and without
dependencies.
gerrit_plugin(
name = 'javamelody',
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/resources/**/*']),
manifest_entries = [
'Gerrit-PluginName: javamelody',
'Gerrit-Module: com.googlesource.gerrit.plugins.javamelody.Module',
'Gerrit-HttpModule: com.googlesource.gerrit.plugins.javamelody.HttpModule',
],
deps = [
'//plugins/javamelody/lib:javamelody',
'//plugins/javamelody/lib:jrobin',
],
)
gerrit_plugin(
name = 'javamelody-no-deps',
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/resources/**/*']),
manifest_entries = [
'Gerrit-PluginName: javamelody',
'Gerrit-Module: com.googlesource.gerrit.plugins.javamelody.Module',
'Gerrit-HttpModule: com.googlesource.gerrit.plugins.javamelody.HttpModule',
],
compile_deps = [
'//plugins/javamelody/lib:javamelody',
'//plugins/javamelody/lib:jrobin',
],
)
Change-Id: Ia274dbeb18de8807f0ab1edf7144f12ff0d02d74
2013-12-09 23:45:40 +01:00
|
|
|
compile_deps = compile_deps,
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
srcs = srcs,
|
|
|
|
resources = resources,
|
|
|
|
manifest_file = manifest_file,
|
2013-05-31 20:55:31 +02:00
|
|
|
manifest_entries = manifest_entries,
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
type = 'extension',
|
|
|
|
visibility = visibility,
|
|
|
|
)
|
|
|
|
|
|
|
|
def gerrit_plugin(
|
|
|
|
name,
|
|
|
|
deps = [],
|
Buck: Add support for non transitive plugin dependencies
In some cases it might be useful to be able to pass dependencies as non
transitive dependencies, that not included in final plugin binary.
Why? When plugin dependencies are needed in both bootstrap classpath and
in plugin then they must be put in $gerrit_path/lib dir. Having them in lib
and inside the plugin doesn't make much sense.
This change exposes compile_deps parameter to the gerrit_{plugin|extension}
methods. It is possible to create both versions of the plugin: with and without
dependencies.
gerrit_plugin(
name = 'javamelody',
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/resources/**/*']),
manifest_entries = [
'Gerrit-PluginName: javamelody',
'Gerrit-Module: com.googlesource.gerrit.plugins.javamelody.Module',
'Gerrit-HttpModule: com.googlesource.gerrit.plugins.javamelody.HttpModule',
],
deps = [
'//plugins/javamelody/lib:javamelody',
'//plugins/javamelody/lib:jrobin',
],
)
gerrit_plugin(
name = 'javamelody-no-deps',
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/resources/**/*']),
manifest_entries = [
'Gerrit-PluginName: javamelody',
'Gerrit-Module: com.googlesource.gerrit.plugins.javamelody.Module',
'Gerrit-HttpModule: com.googlesource.gerrit.plugins.javamelody.HttpModule',
],
compile_deps = [
'//plugins/javamelody/lib:javamelody',
'//plugins/javamelody/lib:jrobin',
],
)
Change-Id: Ia274dbeb18de8807f0ab1edf7144f12ff0d02d74
2013-12-09 23:45:40 +01:00
|
|
|
compile_deps = [],
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
srcs = [],
|
|
|
|
resources = [],
|
Buck: Add support for gerrit GWT plugins
This changes extends gerrit_plugin function with additional gwt_module
parameters. When passed, GWT application is created. Assumtion is met,
that this application depends on gerrit-plugin-gwtui module.
With this change Gerrit GWT plugins can be build with Buck:
MODULE = 'com.googlesource.gerrit.plugins.cookbook.HelloForm'
gerrit_plugin(
name = 'cookbook-plugin',
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/**/*']),
gwt_module = MODULE,
manifest_entries = [
'Gerrit-PluginName: cookbook',
'Gerrit-Module: com.googlesource.gerrit.plugins.cookbook.Module',
'Gerrit-HttpModule: com.googlesource.gerrit.plugins.cookbook.HttpModule',
'Gerrit-SshModule: com.googlesource.gerrit.plugins.cookbook.SshModule',
]
)
Change-Id: I4b131c7c2672675d99457651fcee63bf4f149c2f
2013-11-12 09:41:18 +01:00
|
|
|
gwt_module = None,
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
manifest_file = None,
|
2013-05-31 20:55:31 +02:00
|
|
|
manifest_entries = [],
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
type = 'plugin',
|
|
|
|
visibility = ['PUBLIC']):
|
|
|
|
mf_cmd = 'v=$(git describe HEAD);'
|
|
|
|
if manifest_file:
|
|
|
|
mf_src = [manifest_file]
|
|
|
|
mf_cmd += 'sed "s:@VERSION@:$v:g" $SRCS >$OUT'
|
|
|
|
else:
|
|
|
|
mf_src = []
|
|
|
|
mf_cmd += 'echo "Manifest-Version: 1.0" >$OUT;'
|
|
|
|
mf_cmd += 'echo "Gerrit-ApiType: %s" >>$OUT;' % type
|
2014-02-26 21:14:00 +01:00
|
|
|
mf_cmd += 'echo "Implementation-Version: $v" >>$OUT;'
|
|
|
|
mf_cmd += 'echo "Implementation-Vendor: Gerrit Code Review" >>$OUT'
|
2013-05-31 20:55:31 +02:00
|
|
|
for line in manifest_entries:
|
2014-03-17 08:16:10 +01:00
|
|
|
line = line.replace('$', '\$')
|
2013-05-31 20:55:31 +02:00
|
|
|
mf_cmd += ';echo "%s" >> $OUT' % line
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
genrule(
|
|
|
|
name = name + '__manifest',
|
|
|
|
cmd = mf_cmd,
|
|
|
|
srcs = mf_src,
|
|
|
|
out = 'MANIFEST.MF',
|
|
|
|
)
|
Buck: Add support for gerrit GWT plugins
This changes extends gerrit_plugin function with additional gwt_module
parameters. When passed, GWT application is created. Assumtion is met,
that this application depends on gerrit-plugin-gwtui module.
With this change Gerrit GWT plugins can be build with Buck:
MODULE = 'com.googlesource.gerrit.plugins.cookbook.HelloForm'
gerrit_plugin(
name = 'cookbook-plugin',
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/**/*']),
gwt_module = MODULE,
manifest_entries = [
'Gerrit-PluginName: cookbook',
'Gerrit-Module: com.googlesource.gerrit.plugins.cookbook.Module',
'Gerrit-HttpModule: com.googlesource.gerrit.plugins.cookbook.HttpModule',
'Gerrit-SshModule: com.googlesource.gerrit.plugins.cookbook.SshModule',
]
)
Change-Id: I4b131c7c2672675d99457651fcee63bf4f149c2f
2013-11-12 09:41:18 +01:00
|
|
|
gwt_deps = []
|
|
|
|
static_jars = []
|
|
|
|
if gwt_module:
|
|
|
|
gwt_deps = GWT_PLUGIN_DEPS
|
|
|
|
static_jars = [':%s-static-jar' % name]
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
java_library2(
|
|
|
|
name = name + '__plugin',
|
|
|
|
srcs = srcs,
|
|
|
|
resources = resources,
|
|
|
|
deps = deps,
|
Buck: Add support for non transitive plugin dependencies
In some cases it might be useful to be able to pass dependencies as non
transitive dependencies, that not included in final plugin binary.
Why? When plugin dependencies are needed in both bootstrap classpath and
in plugin then they must be put in $gerrit_path/lib dir. Having them in lib
and inside the plugin doesn't make much sense.
This change exposes compile_deps parameter to the gerrit_{plugin|extension}
methods. It is possible to create both versions of the plugin: with and without
dependencies.
gerrit_plugin(
name = 'javamelody',
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/resources/**/*']),
manifest_entries = [
'Gerrit-PluginName: javamelody',
'Gerrit-Module: com.googlesource.gerrit.plugins.javamelody.Module',
'Gerrit-HttpModule: com.googlesource.gerrit.plugins.javamelody.HttpModule',
],
deps = [
'//plugins/javamelody/lib:javamelody',
'//plugins/javamelody/lib:jrobin',
],
)
gerrit_plugin(
name = 'javamelody-no-deps',
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/resources/**/*']),
manifest_entries = [
'Gerrit-PluginName: javamelody',
'Gerrit-Module: com.googlesource.gerrit.plugins.javamelody.Module',
'Gerrit-HttpModule: com.googlesource.gerrit.plugins.javamelody.HttpModule',
],
compile_deps = [
'//plugins/javamelody/lib:javamelody',
'//plugins/javamelody/lib:jrobin',
],
)
Change-Id: Ia274dbeb18de8807f0ab1edf7144f12ff0d02d74
2013-12-09 23:45:40 +01:00
|
|
|
compile_deps = ['//gerrit-%s-api:lib' % type] + compile_deps + gwt_deps,
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
)
|
Buck: Add support for gerrit GWT plugins
This changes extends gerrit_plugin function with additional gwt_module
parameters. When passed, GWT application is created. Assumtion is met,
that this application depends on gerrit-plugin-gwtui module.
With this change Gerrit GWT plugins can be build with Buck:
MODULE = 'com.googlesource.gerrit.plugins.cookbook.HelloForm'
gerrit_plugin(
name = 'cookbook-plugin',
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/**/*']),
gwt_module = MODULE,
manifest_entries = [
'Gerrit-PluginName: cookbook',
'Gerrit-Module: com.googlesource.gerrit.plugins.cookbook.Module',
'Gerrit-HttpModule: com.googlesource.gerrit.plugins.cookbook.HttpModule',
'Gerrit-SshModule: com.googlesource.gerrit.plugins.cookbook.SshModule',
]
)
Change-Id: I4b131c7c2672675d99457651fcee63bf4f149c2f
2013-11-12 09:41:18 +01:00
|
|
|
if gwt_module:
|
|
|
|
prebuilt_jar(
|
|
|
|
name = '%s-static-jar' % name,
|
|
|
|
binary_jar = genfile('%s-static.zip' % name),
|
|
|
|
deps = [':%s-static' % name],
|
|
|
|
)
|
|
|
|
genrule(
|
|
|
|
name = '%s-static' % name,
|
|
|
|
cmd = 'mkdir -p $TMP/static' +
|
|
|
|
';unzip -qd $TMP/static $(location %s)' %
|
|
|
|
':%s__gwt_application' % name +
|
|
|
|
';cd $TMP' +
|
|
|
|
';zip -qr $OUT .',
|
|
|
|
out = '%s-static.zip' % name,
|
|
|
|
deps = [':%s__gwt_application' % name]
|
|
|
|
)
|
|
|
|
gwt_application(
|
|
|
|
name = name + '__gwt_application',
|
|
|
|
module_target = gwt_module,
|
|
|
|
compiler_opts = GWT_COMPILER_OPTS,
|
|
|
|
deps = [':%s__plugin' % name] + gwt_deps,
|
|
|
|
)
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
java_binary(
|
|
|
|
name = name,
|
|
|
|
manifest_file = genfile('MANIFEST.MF'),
|
|
|
|
deps = [
|
|
|
|
':%s__plugin' % name,
|
|
|
|
':%s__manifest' % name,
|
Buck: Add support for gerrit GWT plugins
This changes extends gerrit_plugin function with additional gwt_module
parameters. When passed, GWT application is created. Assumtion is met,
that this application depends on gerrit-plugin-gwtui module.
With this change Gerrit GWT plugins can be build with Buck:
MODULE = 'com.googlesource.gerrit.plugins.cookbook.HelloForm'
gerrit_plugin(
name = 'cookbook-plugin',
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/**/*']),
gwt_module = MODULE,
manifest_entries = [
'Gerrit-PluginName: cookbook',
'Gerrit-Module: com.googlesource.gerrit.plugins.cookbook.Module',
'Gerrit-HttpModule: com.googlesource.gerrit.plugins.cookbook.HttpModule',
'Gerrit-SshModule: com.googlesource.gerrit.plugins.cookbook.SshModule',
]
)
Change-Id: I4b131c7c2672675d99457651fcee63bf4f149c2f
2013-11-12 09:41:18 +01:00
|
|
|
] + static_jars,
|
Build with Buck
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
2013-05-08 14:14:24 -07:00
|
|
|
visibility = visibility,
|
|
|
|
)
|
2013-05-29 23:26:53 +02:00
|
|
|
|
|
|
|
def java_sources(
|
|
|
|
name,
|
|
|
|
srcs,
|
|
|
|
visibility = []
|
|
|
|
):
|
|
|
|
java_library(
|
|
|
|
name = name,
|
|
|
|
resources = srcs,
|
|
|
|
visibility = visibility,
|
|
|
|
)
|
2013-11-23 22:28:05 +01:00
|
|
|
|
|
|
|
def java_doc(
|
|
|
|
name,
|
|
|
|
title,
|
|
|
|
pkg,
|
|
|
|
paths,
|
|
|
|
srcs = [],
|
|
|
|
deps = [],
|
|
|
|
visibility = []
|
|
|
|
):
|
|
|
|
genrule(
|
|
|
|
name = name,
|
|
|
|
cmd = ' '.join([
|
|
|
|
'javadoc',
|
|
|
|
'-quiet',
|
|
|
|
'-protected',
|
|
|
|
'-encoding UTF-8',
|
|
|
|
'-charset UTF-8',
|
|
|
|
'-notimestamp',
|
|
|
|
'-windowtitle "' + title + '"',
|
|
|
|
'-link http://docs.oracle.com/javase/7/docs/api',
|
|
|
|
'-subpackages ' + pkg,
|
|
|
|
'-sourcepath ',
|
|
|
|
':'.join([n for n in paths]),
|
|
|
|
' -classpath ',
|
|
|
|
':'.join(['$(location %s)' % n for n in deps]),
|
|
|
|
'-d $TMP',
|
|
|
|
]) + ';jar cf $OUT -C $TMP .',
|
|
|
|
srcs = srcs,
|
|
|
|
deps = deps,
|
|
|
|
out = name + '.jar',
|
|
|
|
visibility = visibility,
|
|
|
|
)
|