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