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