| SRCS = glob(['src/main/java/**/*.java']) |
| RSRC = glob(['src/main/resources/**/*']) |
| DEPS = [ |
| '//blame-cache:lib', |
| '//lib:commons-lang', |
| '//lib:gson', |
| '//lib:guava', |
| '//lib:joda-time', |
| '//lib:jsr305', |
| '//lib:commonmark', |
| '//lib:cm-autolink', |
| '//lib:gfm-tables', |
| '//lib:gfm-strikethrough', |
| '//lib:prettify', |
| '//lib/jgit:jgit', |
| '//lib/jgit:jgit-servlet', |
| '//lib/slf4j:slf4j-api', |
| '//lib/soy:soy', |
| ] |
| |
| DEPS_ALL = DEPS + [ |
| '//lib/jgit:jgit-archive', |
| '//lib/guice:guice', |
| ] |
| |
| java_library( |
| name = 'servlet', |
| srcs = SRCS, |
| resources = RSRC, |
| deps = DEPS_ALL, |
| provided_deps = ['//lib:servlet-api_2_5'], |
| visibility = ['PUBLIC'], |
| ) |
| |
| java_test( |
| name = 'servlet_tests', |
| srcs = glob(['src/test/java/**/*.java']), |
| deps = DEPS_ALL + [ |
| ':servlet', |
| # Gitiles is designed to compile against the Servlet API v2.5. |
| '//lib:servlet-api_2_5', |
| '//lib:truth', |
| '//lib/jgit:junit', |
| '//lib/junit:junit', |
| ], |
| visibility = ['//:classpath'], |
| ) |
| |
| java_sources( |
| name = 'src', |
| srcs = SRCS + RSRC, |
| visibility = ['PUBLIC'], |
| ) |
| |
| java_doc( |
| name = 'javadoc', |
| title = 'Gitiles API Documentation', |
| pkgs = ['com.google.gitiles'], |
| paths = ['gitiles-servlet/src/main/java'], |
| srcs = SRCS, |
| deps = DEPS + [ |
| '//lib/guice:guice_library', |
| '//lib/guice:guice-assistedinject', |
| '//lib/guice:javax-inject', |
| '//lib/jgit:jgit-archive_library', |
| '//lib:servlet-api_2_5', |
| ], |
| visibility = ['PUBLIC'], |
| do_it_wrong = True, |
| ) |