0b774c478e
This version fixed a major issue: [1] that was a reason of frustration of many plugin developers: Not cache sources files under symbolic link. Now for all such source files, the warning is issued: " Disabling caching for target //plugins/wip:wip__plugin, because one or more input files are under a symbolic link ({plugins/wip=/home/davido/projects/wip}). This will severely impact performance! To resolve this, use separate rules and declare dependencies instead of using symbolic links. " To suppress this warning we add project.allow_symlink option. This doesn't have any impact for gerrit core but silences the warning above when plugins are built in gerrit tree mode. As pointed out in this issue: [2], we are using some artifacts as source to the java_library() rule as well as binary_jar for prebuilt_ja rule. To avoid the warning, we rename sources to have "-sources.jar" suffix and we rename *.zip to end with .jar in other places. " Assuming edit.src.zip is a JAR and renaming to edit.src.jar in //gerrit-patch-jgit:edit_src. Change the extension of the binary_jar to '.jar' to remove this warning. " source_under_test attribute was removed from java_test() rule. Replication and cookbook-plugin are updated as well. local.properties support was removed, but we use it only for download process customization in our own python script, so that we can keep it usage and not need to move it to .buckconfig.local. [1] https://github.com/facebook/buck/issues/341 [2] https://github.com/facebook/buck/issues/855 Change-Id: Idf76cc71c21df43e808179b645f9175767b322a8
89 lines
1.8 KiB
Python
89 lines
1.8 KiB
Python
include_defs('//lib/JGIT_VERSION')
|
|
include_defs('//lib/GUAVA_VERSION')
|
|
|
|
SRC = 'src/main/java/com/google/gerrit/extensions/'
|
|
SRCS = glob([SRC + '**/*.java'])
|
|
|
|
EXT_API_SRCS = glob([SRC + 'client/*.java'])
|
|
|
|
gwt_module(
|
|
name = 'client',
|
|
srcs = EXT_API_SRCS,
|
|
gwt_xml = SRC + 'Extensions.gwt.xml',
|
|
visibility = ['PUBLIC'],
|
|
)
|
|
|
|
java_library(
|
|
name = 'client-lib',
|
|
srcs = EXT_API_SRCS,
|
|
resources = EXT_API_SRCS + glob([SRC + 'Extensions.gwt.xml']),
|
|
visibility = ['PUBLIC'],
|
|
)
|
|
|
|
java_binary(
|
|
name = 'extension-api',
|
|
deps = [':lib'],
|
|
visibility = ['PUBLIC'],
|
|
)
|
|
|
|
java_library(
|
|
name = 'lib',
|
|
exported_deps = [
|
|
':api',
|
|
'//lib:guava',
|
|
'//lib/guice:guice',
|
|
'//lib/guice:guice-assistedinject',
|
|
'//lib/guice:guice-servlet',
|
|
'//lib:servlet-api-3_1',
|
|
],
|
|
visibility = ['PUBLIC'],
|
|
)
|
|
|
|
java_library(
|
|
name = 'api',
|
|
srcs = glob([SRC + '**/*.java']),
|
|
deps = [
|
|
'//gerrit-common:annotations',
|
|
],
|
|
provided_deps = [
|
|
'//lib:guava',
|
|
'//lib/guice:guice',
|
|
'//lib/guice:guice-assistedinject',
|
|
],
|
|
visibility = ['PUBLIC'],
|
|
)
|
|
|
|
java_sources(
|
|
name = 'extension-api-src',
|
|
srcs = SRCS,
|
|
visibility = ['PUBLIC'],
|
|
)
|
|
|
|
java_test(
|
|
name = 'api_tests',
|
|
srcs = glob(['src/test/java/**/*.java']),
|
|
deps = [
|
|
':api',
|
|
'//lib:truth',
|
|
'//lib/guice:guice',
|
|
],
|
|
)
|
|
|
|
java_doc(
|
|
name = 'extension-api-javadoc',
|
|
title = 'Gerrit Review Extension API Documentation',
|
|
pkgs = ['com.google.gerrit.extensions'],
|
|
source_jar = ':extension-api-src',
|
|
srcs = SRCS,
|
|
deps = [
|
|
'//lib:guava',
|
|
'//lib/guice:javax-inject',
|
|
'//lib/guice:guice_library',
|
|
'//lib/guice:guice-assistedinject',
|
|
'//lib/jgit/org.eclipse.jgit:jgit',
|
|
'//gerrit-common:annotations',
|
|
],
|
|
visibility = ['PUBLIC'],
|
|
external_docs = [JGIT_DOC_URL, GUAVA_DOC_URL],
|
|
)
|