SRCS = 'src/main/java/com/google/gerrit/pgm/' INIT_API_SRCS = [SRCS + n for n in [ 'init/AllProjectsConfig.java', 'init/AllProjectsNameOnInitProvider.java', 'util/ConsoleUI.java', 'util/Die.java', 'init/InitFlags.java', 'init/InitStep.java', 'init/InitStep.java', 'init/InstallPlugins.java', 'init/Section.java', ]] java_library( name = 'init-api', srcs = INIT_API_SRCS, deps = [ '//gerrit-common:annotations', '//gerrit-common:server', '//gerrit-reviewdb:server', '//gerrit-server:server', '//lib:guava', '//lib/guice:guice', '//lib/guice:guice-assistedinject', '//lib/jgit:jgit', ], visibility = ['PUBLIC'], ) java_sources( name = 'init-api-src', srcs = INIT_API_SRCS, visibility = ['PUBLIC'], ) INIT_BASE_SRCS = [SRCS + 'BaseInit.java'] + glob( [SRCS + n for n in [ 'init/**/*.java', 'util/**/*.java', ]], excludes = INIT_API_SRCS + [SRCS + n for n in [ 'init/Browser.java', 'util/ErrorLogFile.java', 'util/GarbageCollectionLogFile.java', 'util/LogFileCompressor.java', 'util/RuntimeShutdown.java', ]] ) INIT_BASE_RSRCS = ['src/main/resources/com/google/gerrit/pgm/libraries.config'] java_library2( name = 'init-base', srcs = INIT_BASE_SRCS, resources = INIT_BASE_RSRCS, deps = [ ':init-api', '//gerrit-common:server', '//gerrit-extension-api:api', '//gerrit-lucene:lucene', '//gerrit-reviewdb:server', '//gerrit-server:server', '//gerrit-util-cli:cli', '//lib/commons:dbcp', '//lib/guice:guice', '//lib/guice:guice-assistedinject', '//lib/jgit:jgit', '//lib/mina:sshd', '//lib:args4j', '//lib:guava', '//lib:gwtjsonrpc', '//lib:gwtorm', '//lib/log:api', ], compile_deps = ['//gerrit-launcher:launcher'], visibility = [ '//gerrit-war:', '//gerrit-acceptance-tests/...', ], ) java_library2( name = 'pgm', srcs = glob( ['src/main/java/**/*.java'], excludes = INIT_API_SRCS + INIT_BASE_SRCS ), resources = glob( ['src/main/resources/**/*'], excludes = INIT_BASE_RSRCS), deps = [ ':init-api', ':init-base', '//gerrit-cache-h2:cache-h2', '//gerrit-common:server', '//gerrit-extension-api:api', '//gerrit-gwtexpui:linker_server', '//gerrit-gwtexpui:server', '//gerrit-httpd:httpd', '//gerrit-lucene:lucene', '//gerrit-openid:openid', '//gerrit-reviewdb:server', '//gerrit-server:server', '//gerrit-server/src/main/prolog:common', '//gerrit-solr:solr', '//gerrit-sshd:sshd', '//gerrit-util-cli:cli', '//lib:args4j', '//lib:guava', '//lib:gwtorm', '//lib:h2', '//lib:servlet-api-3_1', '//lib/guice:guice', '//lib/guice:guice-servlet', '//lib/jetty:server', '//lib/jetty:servlet', '//lib/jgit:jgit', '//lib/log:api', '//lib/log:log4j', '//lib/lucene:core', '//lib/prolog:prolog-cafe', ], compile_deps = ['//gerrit-launcher:launcher'], visibility = [ '//:', '//gerrit-acceptance-tests/...', '//tools/eclipse:classpath', '//Documentation:licenses.txt', ], ) java_test( name = 'pgm_tests', srcs = glob(['src/test/java/**/*.java']), deps = [ ':init-api', ':init-base', ':pgm', '//gerrit-server:server', '//lib:junit', '//lib:easymock', '//lib/guice:guice', '//lib/jgit:jgit', '//lib/jgit:junit', ], source_under_test = [':pgm'], )