blob: b99bcfad8f9bc6b00565a9d31b4c5cac053613bf [file] [log] [blame]
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 = [
'//gerrit-gwtexpui:Clippy',
'//gerrit-gwtexpui:GlobalKey',
'//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',
],
compile_deps = [
':diffy_logo',
'//gerrit-gwtexpui:CSS',
'//gerrit-gwtexpui:Linker',
'//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_lib',
'//gerrit-common:client_lib',
'//gerrit-extension-api:client_lib',
'//lib:junit',
'//lib/gwt:dev',
'//lib/gwt:user',
'//lib/gwt:gwt-test-utils',
'//lib/jgit:jgit',
],
source_under_test = [':ui_module_lib'],
vm_args = ['-Xmx512m'],
visibility = ['//tools/eclipse:classpath'],
)