| SRCS = glob(['src/main/java/**/*.java']) |
| RSRC = glob(['src/main/resources/**/*']) |
| DEPS = [ |
| '//lib:commons-lang', |
| '//lib:grappa', |
| '//lib:gson', |
| '//lib:guava', |
| '//lib:joda-time', |
| '//lib:jsr305', |
| '//lib:pegdown', |
| '//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'], |
| ) |
| |
| genrule( |
| name = 'static-resources', |
| cmd = 'mkdir $TMP/+static' |
| + ';cd $TMP/+static' |
| + ';cp -r $SRCDIR/src/main/resources/com/google/gitiles/static/* .' |
| + ';cd $TMP' |
| + ';zip -qr $OUT *', |
| srcs = glob(['src/main/resources/com/google/gitiles/static/**/*']), |
| out = 'static-resources.zip', |
| visibility = ['PUBLIC'], |
| ) |
| |
| java_sources( |
| name = 'src', |
| srcs = SRCS + RSRC, |
| visibility = ['PUBLIC'], |
| ) |
| |
| java_doc( |
| name = 'javadoc', |
| title = 'Gitiles API Documentation', |
| pkg = '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'], |
| ) |