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', 'mkdir -p {elements,bower_components/webcomponentsjs}', 'unzip -qd elements $(location :gr-app)', 'cp -rp $SRCDIR/* .', 'unzip -p $(location //polygerrit-ui:polygerrit_components) %s>%s' % (WEBJS, WEBJS), 'cd $TMP', 'zip -9qr $OUT .', ]), srcs = glob([ 'favicon.ico', 'index.html', 'styles/**/*.css' ]), out = 'polygerrit_ui.zip', visibility = ['PUBLIC'], ) vulcanize( name = 'gr-app', 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', ], )