blob: dbf02e8a59737d0898fc771fda45a455d883bfbe [file] [log] [blame]
David Ostrovskyab6c4b42016-09-04 13:12:44 +02001load('//tools/bzl:gwt.bzl', 'gwt_module')
David Ostrovsky013af9e2016-09-04 22:05:41 +02002load('//tools/bzl:genrule2.bzl', 'genrule2')
3load(':gwt.bzl', 'gwt_binary')
David Ostrovskyab6c4b42016-09-04 13:12:44 +02004
5MODULE = 'com.google.gerrit.GerritGwtUI'
6
David Ostrovsky013af9e2016-09-04 22:05:41 +02007GWT_JVM_ARGS = ['-Xmx512m']
8
9GWT_COMPILER_ARGS = [
10 '-XdisableClassMetadata',
11]
12
13GWT_COMPILER_ARGS_RELEASE_MODE = GWT_COMPILER_ARGS + [
14 '-XdisableCastChecking',
15]
16
17GWT_TRANSITIVE_DEPS = [
18 '//lib/gwt:javax-validation',
19 '//lib/gwt:javax-validation_src',
20 '//lib/ow2:ow2-asm',
21 '//lib/ow2:ow2-asm-analysis',
22 '//lib/ow2:ow2-asm-commons',
23 '//lib/ow2:ow2-asm-tree',
24 '//lib/ow2:ow2-asm-util',
25]
26
27DEPS = GWT_TRANSITIVE_DEPS + [
28 '//gerrit-gwtexpui:CSS',
29 '//lib:gwtjsonrpc',
30 '//lib/gwt:dev',
31 '@jgit_src//file',
32]
33
David Ostrovskyab6c4b42016-09-04 13:12:44 +020034gwt_module(
35 name = 'ui_module',
36 srcs = glob(['src/main/java/**/*.java']),
37 gwt_xml = 'src/main/java/%s.gwt.xml' % MODULE.replace('.', '/'),
David Ostrovsky013af9e2016-09-04 22:05:41 +020038 resources = glob(
39 ['src/main/java/**/*'],
40 exclude = ['src/main/java/**/*.java'] +
41 ['src/main/java/%s.gwt.xml' % MODULE.replace('.', '/')]
42 ),
David Ostrovskyab6c4b42016-09-04 13:12:44 +020043 deps = [
44 '//gerrit-gwtui-common:diffy_logo',
45 '//gerrit-gwtui-common:client',
46 '//gerrit-gwtexpui:CSS',
47 '//lib/codemirror:codemirror',
48 '//lib/gwt:user',
49 ],
50 visibility = ['//visibility:public'],
51)
David Ostrovsky013af9e2016-09-04 22:05:41 +020052
53genrule2(
54 name = 'ui_optdbg',
55 srcs = [
56 ':ui_dbg',
57 ':ui_opt',
58 ],
59 cmd = 'cd $$TMP;' +
60 'unzip -q $$ROOT/$(location :ui_dbg);' +
61 'mv' +
62 ' gerrit_ui/gerrit_ui.nocache.js' +
63 ' gerrit_ui/dbg_gerrit_ui.nocache.js;' +
64 'unzip -qo $$ROOT/$(location :ui_opt);' +
65 'mkdir -p $$(dirname $@);' +
66 'zip -qr $$ROOT/$@ .',
67 out = 'ui_optdbg.zip',
68 visibility = ['//visibility:public'],
69)
70
71gwt_binary(
72 name = 'ui_opt',
73 modules = [MODULE],
74 module_deps = [':ui_module'],
75 deps = DEPS,
76 compiler_args = GWT_COMPILER_ARGS,
77 jvm_args = GWT_JVM_ARGS,
78)
79
80gwt_binary(
81 name = 'ui_dbg',
82 modules = [MODULE],
83 style = 'PRETTY',
84 optimize = "0",
85 module_deps = [':ui_module'],
86 deps = DEPS,
87 compiler_args = GWT_COMPILER_ARGS,
88 jvm_args = GWT_JVM_ARGS,
89)