war(
  name = 'gitiles',
  libs = ['//gitiles-servlet:servlet'],
  context = [
    '//gitiles-servlet:static-resources',
    ':web_xml',
  ],
  visibility = ['PUBLIC'],
)

genrule(
  name = 'web_xml',
  cmd = 'mkdir -p $TMP/WEB-INF'
    + ';cp -r $SRCDIR/src/main/webapp/WEB-INF/web.xml $TMP/WEB-INF'
    + ';cd $TMP'
    + ';zip -qr $OUT *',
  srcs = ['src/main/webapp/WEB-INF/web.xml'],
  out = 'web_xml.zip',
)
