c53827816d
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
127 lines
2.8 KiB
Python
127 lines
2.8 KiB
Python
include_defs('//gerrit-gwtui/gwt.defs')
|
|
include_defs('//tools/gwt-constants.defs')
|
|
|
|
genrule(
|
|
name = 'ui_optdbg',
|
|
cmd = 'cd $TMP;' +
|
|
'unzip -q $SRCDIR/ui_dbg.zip;' +
|
|
'mv' +
|
|
' gerrit_ui/gerrit_ui.nocache.js' +
|
|
' gerrit_ui/gerrit_dbg.nocache.js;' +
|
|
'unzip -qo $SRCDIR/ui_opt.zip;' +
|
|
'mkdir -p $(dirname $OUT);' +
|
|
'zip -qr $OUT .',
|
|
srcs = [
|
|
genfile('ui_dbg.zip'),
|
|
genfile('ui_opt.zip'),
|
|
],
|
|
deps = [
|
|
':ui_dbg',
|
|
':ui_opt',
|
|
],
|
|
out = 'ui_optdbg.zip',
|
|
visibility = ['PUBLIC'],
|
|
)
|
|
|
|
gwt_application(
|
|
name = 'ui_opt',
|
|
module_target = MODULE,
|
|
compiler_opts = GWT_COMPILER_OPTS,
|
|
deps = APP_DEPS,
|
|
)
|
|
|
|
gwt_application(
|
|
name = 'ui_dbg',
|
|
module_target = MODULE,
|
|
compiler_opts = DEBUG_OPTS + ['-strict'],
|
|
deps = APP_DEPS,
|
|
visibility = ['//:eclipse'],
|
|
)
|
|
|
|
gwt_user_agent_permutations(
|
|
name = 'ui',
|
|
module_name = 'gerrit_ui',
|
|
module_target = MODULE,
|
|
compiler_opts = DEBUG_OPTS + ['-draftCompile'],
|
|
browsers = BROWSERS,
|
|
deps = APP_DEPS,
|
|
visibility = ['//:'],
|
|
)
|
|
|
|
DIFFY = glob(['src/main/java/com/google/gerrit/client/diffy*.png'])
|
|
|
|
gwt_module(
|
|
name = 'ui_module',
|
|
srcs = glob(['src/main/java/**/*.java']),
|
|
gwtxml = 'src/main/java/%s.gwt.xml' % MODULE.replace('.', '/'),
|
|
resources = glob(['src/main/java/**/*'], excludes = DIFFY),
|
|
deps = [
|
|
':diffy_logo',
|
|
'//gerrit-gwtexpui:Clippy',
|
|
'//gerrit-gwtexpui:CSS',
|
|
'//gerrit-gwtexpui:GlobalKey',
|
|
'//gerrit-gwtexpui:Linker',
|
|
'//gerrit-gwtexpui:Progress',
|
|
'//gerrit-gwtexpui:SafeHtml',
|
|
'//gerrit-gwtexpui:UserAgent',
|
|
'//gerrit-common:client',
|
|
'//gerrit-extension-api:client',
|
|
'//gerrit-patch-jgit:client',
|
|
'//gerrit-prettify:client',
|
|
'//gerrit-reviewdb:client',
|
|
'//lib:gwtjsonrpc',
|
|
'//lib:gwtjsonrpc_src',
|
|
'//lib:gwtorm',
|
|
'//lib/codemirror:codemirror',
|
|
'//lib/gwt:user',
|
|
'//lib/jgit:jgit',
|
|
],
|
|
visibility = [
|
|
'//tools/eclipse:classpath',
|
|
'//Documentation:licenses.txt',
|
|
],
|
|
)
|
|
|
|
prebuilt_jar(
|
|
name = 'diffy_logo',
|
|
binary_jar = genfile('diffy_images.jar'),
|
|
deps = [
|
|
'//lib:LICENSE-diffy',
|
|
'//lib:LICENSE-CC-BY3.0',
|
|
':diffy_image_files_ln',
|
|
],
|
|
)
|
|
|
|
genrule(
|
|
name = 'diffy_image_files_ln',
|
|
cmd = 'ln -s $(location :diffy_image_files) $OUT',
|
|
deps = [':diffy_image_files'],
|
|
out = 'diffy_images.jar',
|
|
)
|
|
|
|
java_library(
|
|
name = 'diffy_image_files',
|
|
resources = DIFFY,
|
|
)
|
|
|
|
java_test(
|
|
name = 'ui_tests',
|
|
srcs = glob(['src/test/java/**/*.java']),
|
|
resources = glob(['src/test/resources/**/*']) + [
|
|
'src/main/java/com/google/gerrit/GerritGwtUI.gwt.xml',
|
|
],
|
|
deps = [
|
|
':ui_module',
|
|
'//gerrit-common:client',
|
|
'//gerrit-extension-api:client',
|
|
'//lib:junit',
|
|
'//lib/gwt:dev',
|
|
'//lib/gwt:user',
|
|
'//lib/gwt:gwt-test-utils',
|
|
'//lib/jgit:jgit',
|
|
],
|
|
source_under_test = [':ui_module'],
|
|
vm_args = ['-Xmx512m'],
|
|
visibility = ['//tools/eclipse:classpath'],
|
|
)
|