David Ostrovsky | ab6c4b4 | 2016-09-04 13:12:44 +0200 | [diff] [blame] | 1 | load('//tools/bzl:gwt.bzl', 'gwt_module') |
David Ostrovsky | 013af9e | 2016-09-04 22:05:41 +0200 | [diff] [blame] | 2 | load('//tools/bzl:genrule2.bzl', 'genrule2') |
| 3 | load(':gwt.bzl', 'gwt_binary') |
David Ostrovsky | ab6c4b4 | 2016-09-04 13:12:44 +0200 | [diff] [blame] | 4 | |
| 5 | MODULE = 'com.google.gerrit.GerritGwtUI' |
| 6 | |
David Ostrovsky | 013af9e | 2016-09-04 22:05:41 +0200 | [diff] [blame] | 7 | GWT_JVM_ARGS = ['-Xmx512m'] |
| 8 | |
| 9 | GWT_COMPILER_ARGS = [ |
| 10 | '-XdisableClassMetadata', |
| 11 | ] |
| 12 | |
| 13 | GWT_COMPILER_ARGS_RELEASE_MODE = GWT_COMPILER_ARGS + [ |
| 14 | '-XdisableCastChecking', |
| 15 | ] |
| 16 | |
| 17 | GWT_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 | |
| 27 | DEPS = GWT_TRANSITIVE_DEPS + [ |
| 28 | '//gerrit-gwtexpui:CSS', |
| 29 | '//lib:gwtjsonrpc', |
| 30 | '//lib/gwt:dev', |
| 31 | '@jgit_src//file', |
| 32 | ] |
| 33 | |
David Ostrovsky | ab6c4b4 | 2016-09-04 13:12:44 +0200 | [diff] [blame] | 34 | gwt_module( |
| 35 | name = 'ui_module', |
| 36 | srcs = glob(['src/main/java/**/*.java']), |
| 37 | gwt_xml = 'src/main/java/%s.gwt.xml' % MODULE.replace('.', '/'), |
David Ostrovsky | 013af9e | 2016-09-04 22:05:41 +0200 | [diff] [blame] | 38 | resources = glob( |
| 39 | ['src/main/java/**/*'], |
| 40 | exclude = ['src/main/java/**/*.java'] + |
| 41 | ['src/main/java/%s.gwt.xml' % MODULE.replace('.', '/')] |
| 42 | ), |
David Ostrovsky | ab6c4b4 | 2016-09-04 13:12:44 +0200 | [diff] [blame] | 43 | 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 Ostrovsky | 013af9e | 2016-09-04 22:05:41 +0200 | [diff] [blame] | 52 | |
| 53 | genrule2( |
| 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 | |
| 71 | gwt_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 | |
| 80 | gwt_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 | ) |