Files
gerrit/polygerrit-ui/app/BUCK
Dave Borowitz a75837c6b5 Don't cp -L when setting up PolyGerrit tests
cp -rL is not supported on OS X. Following symlinks was unnecessary
anyway, as none of the zip inputs are symlinks to begin with.

Change-Id: Id0cdda3eadc53544a14bafd3aa53d5a8dac4dbd5
2015-12-04 10:49:50 -05:00

85 lines
2.1 KiB
Python

include_defs('//lib/js.defs')
WCT_TEST_PATTERNS = ['test/**']
PY_TEST_PATTERNS = ['polygerrit_wct_tests.py']
APP_SRCS = glob(
['**'],
excludes = [
'BUCK',
'index.html',
] + WCT_TEST_PATTERNS + PY_TEST_PATTERNS)
WEBJS = 'bower_components/webcomponentsjs/webcomponents-lite.js'
# TODO(dborowitz): Putting these rules in this package avoids having to handle
# the app/ prefix like we would have to if this were in the parent directory.
# The only reason for the app subdirectory in the first place was convenience
# when witing server.go; when that goes away, we can just move all the files and
# these rules up one directory.
genrule(
name = 'polygerrit_ui',
cmd = ' && '.join([
'mkdir $TMP/polygerrit_ui',
'cd $TMP/polygerrit_ui',
'cp $(location :processed_index) index.html',
'mkdir -p {elements,bower_components/webcomponentsjs}',
'cp $(location :polygerrit) elements/gr-app.vulcanized.html',
'cp -rp $SRCDIR/* .',
'unzip -p $(location //polygerrit-ui:polygerrit_components) %s>%s' % (WEBJS, WEBJS),
'cd $TMP',
'zip -9qr $OUT .',
]),
srcs = glob([
'favicon.ico',
'styles/**/*.css'
]),
out = 'polygerrit_ui.zip',
visibility = ['PUBLIC'],
)
genrule(
name = 'processed_index',
cmd = 'sed "s/gr-app.html/gr-app.vulcanized.html/g" $SRCS >$OUT',
srcs = ['index.html'],
out = 'index_processed.html',
)
vulcanize(
name = 'polygerrit',
app = 'elements/gr-app.html',
srcs = APP_SRCS,
components = ['//polygerrit-ui:polygerrit_components'],
)
bower_components(
name = 'test_components',
deps = [
'//polygerrit-ui:polygerrit_components',
'//lib/js:iron-test-helpers',
'//lib/js:test-fixture',
],
)
genrule(
name = 'test_resources',
cmd = ' && '.join([
'cd $TMP',
'unzip -q $(location :test_components)',
'cp -r $SRCDIR/* .',
'zip -r $OUT .',
]),
srcs = APP_SRCS + glob(WCT_TEST_PATTERNS),
out = 'test_resources.zip',
)
python_test(
name = 'polygerrit_tests',
srcs = glob(PY_TEST_PATTERNS),
resources = [':test_resources'],
labels = [
'manual',
'web',
],
)