Files
gerrit/gerrit-common/BUCK
Michael Zhou 42c22a8fc8 Use @GwtIncompatible to exclude files incompatible with GWT
Currently, GWT's Super Dev Mode shows "Ignored 7 units with
compilation errors in first pass". This is because the 6 files listed
in this change refer to classes / methods that are not emulated in GWT
and should be excluded from the compilation. The production build
doesn't suffer from this problem because we exclude them in
gerrit-common/BUCK.

Instead of listing them in BUCK, rely on Guava's handy
@GwtIncompatible annotation. This tells the GWT compiler to ignore the
file entirely, both in Super Dev Mode and production build.

Add "-strict" to the launch configurations of Super Dev Mode so that
developers can catch errors earlier.

Change-Id: I6e2d6be303fa888a9b4776aaae1148d4fd9a211c
2016-04-11 08:12:06 +00:00

74 lines
1.6 KiB
Python

SRC = 'src/main/java/com/google/gerrit/'
ANNOTATIONS = [
SRC + 'common/Nullable.java',
SRC + 'common/audit/Audit.java',
SRC + 'common/auth/SignInRequired.java',
]
java_library(
name = 'annotations',
srcs = ANNOTATIONS,
visibility = ['PUBLIC'],
)
gwt_module(
name = 'client',
srcs = glob([SRC + 'common/**/*.java']),
gwt_xml = SRC + 'Common.gwt.xml',
exported_deps = [
'//gerrit-extension-api:api',
'//gerrit-prettify:client',
'//lib:guava',
'//lib:gwtorm_client',
'//lib/joda:joda-time',
'//lib/log:api',
'@jgit//org.eclipse.jgit:jgit',
],
provided_deps = ['//lib:servlet-api-3_1'],
visibility = ['PUBLIC'],
)
java_library(
name = 'server',
srcs = glob([SRC + 'common/**/*.java'], excludes = ANNOTATIONS),
deps = [
':annotations',
'//gerrit-extension-api:api',
'//gerrit-patch-jgit:server',
'//gerrit-prettify:server',
'//gerrit-reviewdb:server',
'//lib:guava',
'//lib:gwtjsonrpc',
'//lib:gwtorm',
'//lib/joda:joda-time',
'//lib/log:api',
'@jgit//org.eclipse.jgit:jgit',
],
provided_deps = ['//lib:servlet-api-3_1'],
visibility = ['PUBLIC'],
)
TEST = 'src/test/java/com/google/gerrit/common/'
AUTO_VALUE_TEST_SRCS = [TEST + 'AutoValueTest.java']
java_test(
name = 'client_tests',
srcs = glob(['src/test/java/**/*.java'], excludes = AUTO_VALUE_TEST_SRCS),
deps = [
':client',
'//lib:guava',
'//lib:junit',
],
source_under_test = [':client'],
)
java_test(
name = 'auto_value_tests',
srcs = AUTO_VALUE_TEST_SRCS,
deps = [
'//lib:truth',
'//lib/auto:auto-value',
],
)