| David Ostrovsky | 22c45b3 | 2014-02-23 22:22:26 +0100 | [diff] [blame] | 1 | SRCS = glob(['src/main/java/**/*.java']) |
| 2 | RSRC = glob(['src/main/resources/**/*']) |
| 3 | DEPS = [ |
| 4 | '//lib:guava', |
| David Ostrovsky | 22c45b3 | 2014-02-23 22:22:26 +0100 | [diff] [blame] | 5 | '//lib:joda-time', |
| 6 | '//lib:gson', |
| 7 | '//lib:commons-lang', |
| Dave Borowitz | ec6a9cc | 2014-04-25 15:51:23 -0400 | [diff] [blame] | 8 | '//lib:prettify', |
| David Ostrovsky | 22c45b3 | 2014-02-23 22:22:26 +0100 | [diff] [blame] | 9 | '//lib/jgit:jgit', |
| 10 | '//lib/jgit:jgit-servlet', |
| 11 | '//lib/slf4j:slf4j-api', |
| Dave Borowitz | e5e94f9 | 2014-06-26 12:09:58 -0700 | [diff] [blame] | 12 | '//lib/soy:soy', |
| David Ostrovsky | 22c45b3 | 2014-02-23 22:22:26 +0100 | [diff] [blame] | 13 | ] |
| 14 | |
| 15 | DEPS_ALL = DEPS + [ |
| 16 | '//lib/jgit:jgit-archive', |
| 17 | '//lib/guice:guice', |
| 18 | ] |
| 19 | |
| David Ostrovsky | eddfe89 | 2014-05-04 20:59:41 +0200 | [diff] [blame] | 20 | java_library( |
| David Ostrovsky | 22c45b3 | 2014-02-23 22:22:26 +0100 | [diff] [blame] | 21 | name = 'servlet', |
| 22 | srcs = SRCS, |
| 23 | resources = RSRC, |
| 24 | deps = DEPS_ALL, |
| David Ostrovsky | eddfe89 | 2014-05-04 20:59:41 +0200 | [diff] [blame] | 25 | provided_deps = ['//lib:servlet-api_2_5'], |
| David Ostrovsky | 22c45b3 | 2014-02-23 22:22:26 +0100 | [diff] [blame] | 26 | visibility = ['PUBLIC'], |
| 27 | ) |
| 28 | |
| 29 | java_test( |
| 30 | name = 'servlet_tests', |
| 31 | srcs = glob(['src/test/java/**/*.java']), |
| 32 | deps = DEPS_ALL + [ |
| 33 | '//lib/jgit:junit', |
| 34 | '//lib:junit', |
| 35 | # Gitiles is designed to compile against the Servlet API v2.5. |
| 36 | '//lib:servlet-api_2_5', |
| 37 | ':servlet', |
| 38 | ], |
| 39 | visibility = ['//:classpath'], |
| 40 | ) |
| 41 | |
| 42 | genrule( |
| 43 | name = 'static-resources', |
| 44 | cmd = 'mkdir $TMP/+static' |
| 45 | + ';cd $TMP/+static' |
| 46 | + ';cp -r $SRCDIR/src/main/resources/com/google/gitiles/static/* .' |
| 47 | + ';cd $TMP' |
| 48 | + ';zip -qr $OUT *', |
| 49 | srcs = glob(['src/main/resources/com/google/gitiles/static/**/*']), |
| 50 | out = 'static-resources.zip', |
| 51 | visibility = ['PUBLIC'], |
| 52 | ) |
| 53 | |
| 54 | java_sources( |
| 55 | name = 'src', |
| 56 | srcs = SRCS + RSRC, |
| 57 | visibility = ['PUBLIC'], |
| 58 | ) |
| 59 | |
| 60 | java_doc( |
| 61 | name = 'javadoc', |
| 62 | title = 'Gitiles API Documentation', |
| 63 | pkg = 'com.google.gitiles', |
| 64 | paths = ['gitiles-servlet/src/main/java'], |
| Dave Borowitz | 44bcf29 | 2014-11-04 16:34:57 -0800 | [diff] [blame] | 65 | srcs = SRCS, |
| David Ostrovsky | 22c45b3 | 2014-02-23 22:22:26 +0100 | [diff] [blame] | 66 | deps = DEPS + [ |
| 67 | '//lib/guice:guice_library', |
| 68 | '//lib/guice:guice-assistedinject', |
| 69 | '//lib/guice:javax-inject', |
| 70 | '//lib/guice:jsr305', |
| 71 | '//lib/jgit:jgit-archive_library', |
| 72 | '//lib:servlet-api_2_5', |
| 73 | ], |
| 74 | visibility = ['PUBLIC'], |
| 75 | ) |