gerrit/gerrit-gwtui/BUCK
David Ostrovsky 7b11d6ad30 Buck: Turn off Codemirror obfuscation in non release build
In I24790e84 I activated Closure Compiler tool chain to minify JS code.
In retrospective, it was wrong, of course, to unconditionally activate
the obfuscation, even in developer mode. As the consequence, devs have
hard time to troubleshoot Codemirror integration problems. Not to
mention, that the minifcation takes tons of time and not needed on dev
build. Also note, that every single language mode file is compiled.

In Ia9964735 I already disabled cast checking only in release mode. Use
the same differentiation and disable Codemirror obfuscation in non
release build.

Test Plan:

1. `buck build gerrit` should include non obfuscated Codemirror code
2. `buck build release` should include obfuscated Codemirror code

Change-Id: I05d925c94a3c0368366e9d3ad109cf84492810fc
2016-04-04 20:30:55 -04:00

69 lines
1.5 KiB
Python

include_defs('//gerrit-gwtui/gwt.defs')
include_defs('//tools/gwt-constants.defs')
DEPS = GWT_TRANSITIVE_DEPS + [
'//gerrit-gwtexpui:CSS',
'//lib:gwtjsonrpc',
'//lib/gwt:dev',
]
gwt_genrule(MODULE, DEPS)
gwt_genrule(MODULE, DEPS, '_r')
gwt_user_agent_permutations(
name = 'ui',
module_name = 'gerrit_ui',
modules = [MODULE],
module_deps = [':ui_module'],
deps = DEPS,
visibility = ['//:'],
)
def gen_ui_module(name, suffix = ""):
gwt_module(
name = name + suffix,
srcs = glob(['src/main/java/**/*.java']),
gwt_xml = 'src/main/java/%s.gwt.xml' % MODULE.replace('.', '/'),
resources = glob(['src/main/java/**/*']),
deps = [
':silk_icons',
'//gerrit-gwtui-common:diffy_logo',
'//gerrit-gwtui-common:client',
'//gerrit-gwtexpui:CSS',
'//lib/codemirror:codemirror' + suffix,
'//lib/gwt:user',
],
visibility = [
'//tools/eclipse:classpath',
'//Documentation:licenses.txt',
'//Documentation:js_licenses.txt',
],
)
gen_ui_module(name = 'ui_module')
gen_ui_module(name = 'ui_module', suffix = '_r')
java_library(
name = 'silk_icons',
deps = [
'//lib:LICENSE-silk_icons',
'//lib:LICENSE-CC-BY3.0',
],
)
java_test(
name = 'ui_tests',
srcs = glob(['src/test/java/**/*.java']),
deps = [
':ui_module',
'//gerrit-common:client',
'//gerrit-extension-api:client',
'//lib:junit',
'//lib/gwt:dev',
'//lib/gwt:user',
],
source_under_test = [':ui_module'],
vm_args = ['-Xmx512m'],
visibility = ['//tools/eclipse:classpath'],
)