From fdbfcad77dfe0aacb2c9d3cdf2c22984f1c82954 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Tue, 15 Nov 2016 06:35:29 -0800 Subject: [PATCH] Remove Buck based build Bug: Issue 5302 Change-Id: I6e860446ef30ff0ad1c7c49fc0e39d39d921820b --- .bazelproject | 4 - .buckconfig | 37 - .buckversion | 1 - .gitignore | 5 - .watchmanconfig | 9 - BUCK | 31 - Documentation/BUCK | 80 -- Documentation/asciidoc.defs | 113 --- Documentation/config.defs | 22 - Documentation/dev-bazel.txt | 4 + Documentation/dev-buck.txt | 735 ------------------ Documentation/dev-build-plugins.txt | 22 +- Documentation/dev-eclipse.txt | 4 +- Documentation/dev-plugins.txt | 6 +- Documentation/dev-readme.txt | 62 +- Documentation/dev-release.txt | 35 +- Documentation/gen_licenses.py | 178 ----- Documentation/index.txt | 1 - Documentation/intro-project-owner.txt | 2 +- Documentation/license.defs | 29 - Documentation/rest-api-documentation.txt | 4 +- README.md | 4 +- ReleaseNotes/BUCK | 19 - ReleaseNotes/config.defs | 14 - bucklets/gerrit_plugin.bucklet | 21 - bucklets/java_doc.bucklet | 1 - bucklets/java_sources.bucklet | 1 - bucklets/maven_jar.bucklet | 1 - bucklets/maven_package.bucklet | 1 - contrib/build-consistency.go | 108 --- contrib/convertkey/BUCK | 50 -- gerrit-acceptance-framework/BUCK | 92 --- gerrit-acceptance-tests/BUCK | 48 -- .../gerrit/acceptance/api/accounts/BUCK | 7 - .../google/gerrit/acceptance/api/change/BUCK | 7 - .../google/gerrit/acceptance/api/config/BUCK | 7 - .../google/gerrit/acceptance/api/group/BUCK | 23 - .../google/gerrit/acceptance/api/project/BUCK | 7 - .../gerrit/acceptance/api/revision/BUCK | 7 - .../com/google/gerrit/acceptance/edit/BUCK | 10 - .../com/google/gerrit/acceptance/git/BUCK | 27 - .../com/google/gerrit/acceptance/pgm/BUCK | 7 - .../gerrit/acceptance/rest/account/BUCK | 23 - .../google/gerrit/acceptance/rest/change/BUCK | 34 - .../google/gerrit/acceptance/rest/config/BUCK | 7 - .../google/gerrit/acceptance/rest/group/BUCK | 8 - .../gerrit/acceptance/rest/project/BUCK | 37 - .../gerrit/acceptance/server/change/BUCK | 7 - .../gerrit/acceptance/server/event/BUCK | 7 - .../google/gerrit/acceptance/server/mail/BUCK | 10 - .../gerrit/acceptance/server/notedb/BUCK | 7 - .../gerrit/acceptance/server/project/BUCK | 7 - .../com/google/gerrit/acceptance/ssh/BUCK | 8 - gerrit-acceptance-tests/tests.defs | 27 - gerrit-antlr/BUCK | 36 - gerrit-cache-h2/BUCK | 28 - gerrit-common/BUCK | 75 -- gerrit-elasticsearch/BUCK | 51 -- gerrit-extension-api/BUCK | 89 --- gerrit-gpg/BUCK | 56 -- gerrit-gwtdebug/BUCK | 17 - gerrit-gwtexpui/BUCK | 113 --- gerrit-gwtui-common/BUCK | 59 -- gerrit-gwtui/BUCK | 66 -- gerrit-gwtui/gwt.defs | 141 ---- gerrit-httpd/BUCK | 78 -- .../google/gerrit/httpd/raw/BazelBuild.java | 4 +- gerrit-launcher/BUCK | 13 - .../gerrit/launcher/GerritLauncher.java | 3 +- gerrit-lucene/BUCK | 41 - gerrit-main/BUCK | 13 - gerrit-oauth/BUCK | 26 - gerrit-openid/BUCK | 26 - gerrit-patch-commonsnet/BUCK | 11 - gerrit-patch-jgit/BUCK | 65 -- gerrit-pgm/BUCK | 185 ----- gerrit-plugin-api/BUCK | 99 --- gerrit-plugin-gwtui/BUCK | 60 -- gerrit-prettify/BUCK | 47 -- gerrit-reviewdb/BUCK | 38 - gerrit-server/BUCK | 216 ----- gerrit-server/src/main/prolog/BUCK | 8 - gerrit-sshd/BUCK | 59 -- gerrit-util-cli/BUCK | 13 - gerrit-util-http/BUCK | 39 - gerrit-util-ssl/BUCK | 5 - gerrit-war/BUCK | 77 -- lib/BUCK | 319 -------- lib/antlr/BUCK | 48 -- lib/asciidoctor/BUCK | 61 -- lib/auto/BUCK | 9 - lib/auto/auto_value.defs | 21 - lib/bouncycastle/BUCK | 28 - lib/codemirror/BUCK | 140 ---- lib/codemirror/cm.defs | 215 ----- lib/commons/BUCK | 93 --- lib/dropwizard/BUCK | 8 - lib/easymock/BUCK | 31 - lib/elasticsearch/BUCK | 104 --- lib/fonts/BUCK | 13 - lib/greenmail/BUCK | 13 - lib/guice/BUCK | 79 -- lib/gwt/BUCK | 73 -- lib/highlightjs/BUCK | 5 - lib/httpcomponents/BUCK | 63 -- lib/jackson/BUCK | 26 - lib/jetty/BUCK | 95 --- lib/jgit/org.eclipse.jgit.archive/BUCK | 16 - lib/jgit/org.eclipse.jgit.http.server/BUCK | 16 - lib/jgit/org.eclipse.jgit.junit/BUCK | 12 - lib/jgit/org.eclipse.jgit/BUCK | 25 - lib/joda/BUCK | 25 - lib/js.defs | 172 ---- lib/js/BUCK | 427 ---------- lib/log/BUCK | 56 -- lib/lucene/BUCK | 163 ---- lib/mail/BUCK | 13 - lib/maven.defs | 188 ----- lib/mime4j/BUCK | 19 - lib/mina/BUCK | 26 - lib/openid/BUCK | 35 - lib/ow2/BUCK | 39 - lib/powermock/BUCK | 73 -- lib/prolog/BUCK | 64 -- lib/prolog/prolog.defs | 42 - plugins/BUCK | 42 - polygerrit-ui/BUCK | 35 - polygerrit-ui/README.md | 27 +- polygerrit-ui/app/BUCK | 99 --- polygerrit-ui/app/polygerrit_wct_tests.py | 118 --- polygerrit-ui/app/wct_test.sh | 3 +- polygerrit-ui/run-server.sh | 14 +- tools/BUCK | 51 -- tools/build.defs | 80 -- tools/default.defs | 231 ------ tools/download_all.py | 44 -- tools/download_file.py | 3 +- tools/eclipse/BUCK | 37 - tools/eclipse/project.py | 265 ------- tools/git.defs | 26 - tools/gwt-constants.defs | 30 - tools/java_doc.defs | 38 - tools/java_sources.defs | 10 - tools/js/BUCK | 32 - tools/js/bower2buck.py | 217 ------ tools/maven/BUCK | 33 - tools/maven/api.sh | 37 +- tools/maven/mvn.py | 2 +- tools/maven/package.defs | 95 --- tools/maven/repository.defs | 3 - tools/pack_war.py | 55 -- 151 files changed, 71 insertions(+), 8296 deletions(-) delete mode 100644 .buckconfig delete mode 100644 .buckversion delete mode 100644 .watchmanconfig delete mode 100644 BUCK delete mode 100644 Documentation/BUCK delete mode 100644 Documentation/asciidoc.defs delete mode 100644 Documentation/config.defs delete mode 100644 Documentation/dev-buck.txt delete mode 100755 Documentation/gen_licenses.py delete mode 100644 Documentation/license.defs delete mode 100644 ReleaseNotes/BUCK delete mode 100644 ReleaseNotes/config.defs delete mode 100644 bucklets/gerrit_plugin.bucklet delete mode 120000 bucklets/java_doc.bucklet delete mode 120000 bucklets/java_sources.bucklet delete mode 120000 bucklets/maven_jar.bucklet delete mode 120000 bucklets/maven_package.bucklet delete mode 100644 contrib/build-consistency.go delete mode 100644 contrib/convertkey/BUCK delete mode 100644 gerrit-acceptance-framework/BUCK delete mode 100644 gerrit-acceptance-tests/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/accounts/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/change/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/config/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/group/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/project/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/revision/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/edit/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/git/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/pgm/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/account/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/change/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/config/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/group/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/project/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/change/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/event/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/mail/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/notedb/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/project/BUCK delete mode 100644 gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/BUCK delete mode 100644 gerrit-acceptance-tests/tests.defs delete mode 100644 gerrit-antlr/BUCK delete mode 100644 gerrit-cache-h2/BUCK delete mode 100644 gerrit-common/BUCK delete mode 100644 gerrit-elasticsearch/BUCK delete mode 100644 gerrit-extension-api/BUCK delete mode 100644 gerrit-gpg/BUCK delete mode 100644 gerrit-gwtdebug/BUCK delete mode 100644 gerrit-gwtexpui/BUCK delete mode 100644 gerrit-gwtui-common/BUCK delete mode 100644 gerrit-gwtui/BUCK delete mode 100644 gerrit-gwtui/gwt.defs delete mode 100644 gerrit-httpd/BUCK delete mode 100644 gerrit-launcher/BUCK delete mode 100644 gerrit-lucene/BUCK delete mode 100644 gerrit-main/BUCK delete mode 100644 gerrit-oauth/BUCK delete mode 100644 gerrit-openid/BUCK delete mode 100644 gerrit-patch-commonsnet/BUCK delete mode 100644 gerrit-patch-jgit/BUCK delete mode 100644 gerrit-pgm/BUCK delete mode 100644 gerrit-plugin-api/BUCK delete mode 100644 gerrit-plugin-gwtui/BUCK delete mode 100644 gerrit-prettify/BUCK delete mode 100644 gerrit-reviewdb/BUCK delete mode 100644 gerrit-server/BUCK delete mode 100644 gerrit-server/src/main/prolog/BUCK delete mode 100644 gerrit-sshd/BUCK delete mode 100644 gerrit-util-cli/BUCK delete mode 100644 gerrit-util-http/BUCK delete mode 100644 gerrit-util-ssl/BUCK delete mode 100644 gerrit-war/BUCK delete mode 100644 lib/BUCK delete mode 100644 lib/antlr/BUCK delete mode 100644 lib/asciidoctor/BUCK delete mode 100644 lib/auto/BUCK delete mode 100644 lib/auto/auto_value.defs delete mode 100644 lib/bouncycastle/BUCK delete mode 100644 lib/codemirror/BUCK delete mode 100644 lib/codemirror/cm.defs delete mode 100644 lib/commons/BUCK delete mode 100644 lib/dropwizard/BUCK delete mode 100644 lib/easymock/BUCK delete mode 100644 lib/elasticsearch/BUCK delete mode 100644 lib/fonts/BUCK delete mode 100644 lib/greenmail/BUCK delete mode 100644 lib/guice/BUCK delete mode 100644 lib/gwt/BUCK delete mode 100644 lib/highlightjs/BUCK delete mode 100644 lib/httpcomponents/BUCK delete mode 100644 lib/jackson/BUCK delete mode 100644 lib/jetty/BUCK delete mode 100644 lib/jgit/org.eclipse.jgit.archive/BUCK delete mode 100644 lib/jgit/org.eclipse.jgit.http.server/BUCK delete mode 100644 lib/jgit/org.eclipse.jgit.junit/BUCK delete mode 100644 lib/jgit/org.eclipse.jgit/BUCK delete mode 100644 lib/joda/BUCK delete mode 100644 lib/js.defs delete mode 100644 lib/js/BUCK delete mode 100644 lib/log/BUCK delete mode 100644 lib/lucene/BUCK delete mode 100644 lib/mail/BUCK delete mode 100644 lib/maven.defs delete mode 100644 lib/mime4j/BUCK delete mode 100644 lib/mina/BUCK delete mode 100644 lib/openid/BUCK delete mode 100644 lib/ow2/BUCK delete mode 100644 lib/powermock/BUCK delete mode 100644 lib/prolog/BUCK delete mode 100644 lib/prolog/prolog.defs delete mode 100644 plugins/BUCK delete mode 100644 polygerrit-ui/BUCK delete mode 100644 polygerrit-ui/app/BUCK delete mode 100644 polygerrit-ui/app/polygerrit_wct_tests.py delete mode 100644 tools/BUCK delete mode 100644 tools/build.defs delete mode 100644 tools/default.defs delete mode 100755 tools/download_all.py delete mode 100644 tools/eclipse/BUCK delete mode 100755 tools/eclipse/project.py delete mode 100644 tools/git.defs delete mode 100644 tools/gwt-constants.defs delete mode 100644 tools/java_doc.defs delete mode 100644 tools/java_sources.defs delete mode 100644 tools/js/BUCK delete mode 100755 tools/js/bower2buck.py delete mode 100644 tools/maven/BUCK delete mode 100644 tools/maven/package.defs delete mode 100644 tools/maven/repository.defs delete mode 100755 tools/pack_war.py diff --git a/.bazelproject b/.bazelproject index bb2a1a6c9a..41bb27f676 100644 --- a/.bazelproject +++ b/.bazelproject @@ -11,10 +11,6 @@ directories: -./.metadata -./.settings -./.apt_generated - # BUCK excludes; Remove after we have entirely switched to Bazel - -./.buckd - -bucklets - -buck-out targets: //...:all diff --git a/.buckconfig b/.buckconfig deleted file mode 100644 index 11cfe37d27..0000000000 --- a/.buckconfig +++ /dev/null @@ -1,37 +0,0 @@ -[alias] - api = //:api - chrome = //:chrome - docs = //Documentation:searchfree - firefox = //:firefox - gerrit = //:gerrit - gwtgerrit = //:gwtgerrit - headless = //:headless - polygerrit = //:polygerrit - release = //:release - releasenotes = //ReleaseNotes:html - safari = //:safari - soyc = //gerrit-gwtui:ui_soyc - soyc_r = //gerrit-gwtui:ui_soyc_r - withdocs = //:withdocs - -[buildfile] - includes = //tools/default.defs - -[java] - jar_spool_mode = direct_to_jar - safe_annotation_processors = com.google.auto.value.processor.AutoAnnotationProcessor,com.google.auto.value.processor.AutoValueProcessor - src_roots = java, resources, src - source_level = 8 - target_level = 8 - -[project] - allow_symlinks = allow - ignore = .git, eclipse-out, bazel-gerrit, bin - parallel_parsing = true - -[cache] - mode = dir - dir = ~/.gerritcodereview/buck-cache/locally-built-artifacts - -[test] - excluded_labels = manual diff --git a/.buckversion b/.buckversion deleted file mode 100644 index 7eb591fec5..0000000000 --- a/.buckversion +++ /dev/null @@ -1 +0,0 @@ -e27df656657f93f8d57a7aaac69a5ae0e298a292 diff --git a/.gitignore b/.gitignore index 4ce6ab2d5a..f6cd9780ab 100644 --- a/.gitignore +++ b/.gitignore @@ -12,16 +12,11 @@ *.eml *.sublime-* /gerrit-package-plugins -/.buckconfig.local -/.buckjavaargs -/.buckd /bazel-bin /bazel-genfiles /bazel-gerrit /bazel-out /bazel-testlogs -/buck-cache -/buck-out /eclipse-out /extras /infer-out diff --git a/.watchmanconfig b/.watchmanconfig deleted file mode 100644 index 4467aec6b1..0000000000 --- a/.watchmanconfig +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ignore_dirs": [ - "buck-out", - "eclipse-out" - ], - "ignore_vcs": [ - ".git" - ] -} diff --git a/BUCK b/BUCK deleted file mode 100644 index 9657ff3a5c..0000000000 --- a/BUCK +++ /dev/null @@ -1,31 +0,0 @@ -include_defs('//tools/build.defs') - -gerrit_war(name = 'gerrit') -gerrit_war(name = 'gwtgerrit', ui = 'ui_dbg') -gerrit_war(name = 'headless', ui = None) -gerrit_war(name = 'chrome', ui = 'ui_chrome') -gerrit_war(name = 'firefox', ui = 'ui_firefox') -gerrit_war(name = 'safari', ui = 'ui_safari') -gerrit_war(name = 'polygerrit', ui = 'polygerrit') -gerrit_war(name = 'withdocs', docs = True) -gerrit_war(name = 'release', ui = 'ui_optdbg_r', docs = True, context = ['//plugins:core'], visibility = ['//tools/maven:']) - -API_DEPS = [ - '//gerrit-acceptance-framework:acceptance-framework', - '//gerrit-acceptance-framework:acceptance-framework-src', - '//gerrit-acceptance-framework:acceptance-framework-javadoc', - '//gerrit-extension-api:extension-api', - '//gerrit-extension-api:extension-api-src', - '//gerrit-extension-api:extension-api-javadoc', - '//gerrit-plugin-api:plugin-api', - '//gerrit-plugin-api:plugin-api-src', - '//gerrit-plugin-api:plugin-api-javadoc', - '//gerrit-plugin-gwtui:gwtui-api', - '//gerrit-plugin-gwtui:gwtui-api-src', - '//gerrit-plugin-gwtui:gwtui-api-javadoc', -] - -zip_file( - name = 'api', - srcs = API_DEPS, -) diff --git a/Documentation/BUCK b/Documentation/BUCK deleted file mode 100644 index 48ca579194..0000000000 --- a/Documentation/BUCK +++ /dev/null @@ -1,80 +0,0 @@ -include_defs('//Documentation/asciidoc.defs') -include_defs('//Documentation/config.defs') -include_defs('//Documentation/license.defs') -include_defs('//tools/git.defs') - -DOC_DIR = 'Documentation' - -JSUI_JAVA_DEPS = ['//gerrit-gwtui:ui_module'] -JSUI_NON_JAVA_DEPS = ['//polygerrit-ui/app:polygerrit_ui'] -MAIN_JAVA_DEPS = ['//gerrit-pgm:pgm'] -SRCS = glob(['*.txt'], excludes = ['licenses.txt']) - - -genasciidoc( - name = 'html', - out = 'html.zip', - directory = DOC_DIR, - srcs = SRCS + [':licenses.txt'], - attributes = documentation_attributes(git_describe()), - backend = 'html5', - visibility = ['PUBLIC'], -) - -genasciidoc( - name = 'searchfree', - out = 'searchfree.zip', - directory = DOC_DIR, - srcs = SRCS + [':licenses.txt'], - attributes = documentation_attributes(git_describe()), - backend = 'html5', - searchbox = False, - visibility = ['PUBLIC'], -) - -genlicenses( - name = 'licenses.txt', - opts = ['--asciidoc'], - java_deps = JSUI_JAVA_DEPS + MAIN_JAVA_DEPS, - non_java_deps = JSUI_NON_JAVA_DEPS, - out = 'licenses.txt', -) - -# Required by Google for gerrit-review. -genlicenses( - name = 'js_licenses.txt', - opts = ['--partial'], - java_deps = JSUI_JAVA_DEPS, - non_java_deps = JSUI_NON_JAVA_DEPS, - out = 'js_licenses.txt', -) - -python_binary( - name = 'gen_licenses', - main = 'gen_licenses.py', -) - -python_binary( - name = 'replace_macros', - main = 'replace_macros.py', - visibility = ['//ReleaseNotes:'], -) - -genrule( - name = 'index', - cmd = '$(exe //lib/asciidoctor:doc_indexer) ' + - '-o $OUT ' + - '--prefix "%s/" ' % DOC_DIR + - '--in-ext ".txt" ' + - '--out-ext ".html" ' + - '$SRCS ' + - '$(location :licenses.txt)', - srcs = SRCS, - out = 'index.jar', -) - -prebuilt_jar( - name = 'index_lib', - binary_jar = ':index', - visibility = ['PUBLIC'], -) diff --git a/Documentation/asciidoc.defs b/Documentation/asciidoc.defs deleted file mode 100644 index 4b170712a2..0000000000 --- a/Documentation/asciidoc.defs +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright (C) 2013 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -def genasciidoc_htmlonly( - name, - out, - srcs = [], - attributes = [], - backend = None, - searchbox = True, - visibility = []): - EXPN = '.' + name + '_expn' - - asciidoc = [ - '$(exe //lib/asciidoctor:asciidoc)', - '-z', '$OUT', - '--base-dir', '$SRCDIR', - '--tmp', '$TMP', - '--in-ext', '".txt%s"' % EXPN, - '--out-ext', '".html"', - ] - if backend: - asciidoc.extend(['-b', backend]) - for attribute in attributes: - asciidoc.extend(['-a', attribute]) - asciidoc.append('$SRCS') - newsrcs = [] - for src in srcs: - fn = src - # We have two cases: regular source files and generated files. - # Generated files are passed as targets ':foo', and ':' is removed. - # 1. regular files: cmd = '-s foo', srcs = ['foo'] - # 2. generated files: cmd = '-s $(location :foo)', srcs = [] - srcs = [src] - passed_src = fn - if fn.startswith(':') : - fn = src[1:] - srcs = [] - passed_src = '$(location :%s)' % fn - ex = fn + EXPN - - genrule( - name = ex, - cmd = '$(exe //Documentation:replace_macros) --suffix="%s"' % EXPN + - ' -s ' + passed_src + ' -o $OUT' + - (' --searchbox' if searchbox else ' --no-searchbox'), - srcs = srcs, - out = ex, - ) - - newsrcs.append(':%s' % ex) - - genrule( - name = name, - cmd = ' '.join(asciidoc), - srcs = newsrcs, - out = out, - visibility = visibility, - ) - -def genasciidoc( - name, - out, - directory, - srcs = [], - attributes = [], - backend = None, - searchbox = True, - resources = True, - visibility = []): - SUFFIX = '_htmlonly' - - genasciidoc_htmlonly( - name = name + SUFFIX if resources else name, - srcs = srcs, - attributes = attributes, - backend = backend, - searchbox = searchbox, - out = (name + SUFFIX + '.zip') if resources else (name + '.zip'), - ) - - if resources: - genrule( - name = name, - cmd = 'cd $TMP;' + - 'mkdir -p %s/images;' % directory + - 'unzip -q $(location %s) -d %s/;' - % (':' + name + SUFFIX, directory) + - 'for s in $SRCS;do ln -s $s %s/;done;' % directory + - 'mv %s/*.{jpg,png} %s/images;' % (directory, directory) + - 'cp $(location %s) LICENSES.txt;' % ':licenses.txt' + - 'zip -qr $OUT *', - srcs = glob([ - 'images/*.jpg', - 'images/*.png', - ]) + [ - '//gerrit-prettify:prettify.min.css', - '//gerrit-prettify:prettify.min.js', - ], - out = out, - visibility = visibility, - ) diff --git a/Documentation/config.defs b/Documentation/config.defs deleted file mode 100644 index 7f814d3b69..0000000000 --- a/Documentation/config.defs +++ /dev/null @@ -1,22 +0,0 @@ -DOCUMENTATION_DEPS = { - "install-quick.txt": ["config-login-register.txt"], - "install.txt": ["database-setup.txt"], -} - -def documentation_attributes(revision): - return [ - 'toc', - 'newline="\\n"', - 'asterisk="*"', - 'plus="+"', - 'caret="^"', - 'startsb="["', - 'endsb="]"', - 'tilde="~"', - 'last-update-label!', - 'source-highlighter=prettify', - 'stylesheet=DEFAULT', - 'linkcss=true', - 'prettifydir=.', - 'revnumber="%s"' % revision, - ] diff --git a/Documentation/dev-bazel.txt b/Documentation/dev-bazel.txt index e88697c3ee..5d54bbd322 100644 --- a/Documentation/dev-bazel.txt +++ b/Documentation/dev-bazel.txt @@ -32,6 +32,10 @@ PolyGerrit UI: bazel build gerrit ---- +[NOTE] +PolyGerrit UI may require additional tools (such as npm). Please read +the polygerrit-ui/README.md for more info. + The output executable WAR will be placed in: ---- diff --git a/Documentation/dev-buck.txt b/Documentation/dev-buck.txt deleted file mode 100644 index a74f8376c9..0000000000 --- a/Documentation/dev-buck.txt +++ /dev/null @@ -1,735 +0,0 @@ -= Gerrit Code Review - Building with Buck - - -== Installation - -You need to use Java 8 and Node.js for building gerrit. - -There is currently no binary distribution of Buck, so it has to be manually -built and installed. Apache Ant and gcc are required. Currently only Linux -and Mac OS are supported. - -Clone the git and build it: - ----- - git clone https://github.com/facebook/buck - cd buck - git checkout $(cat ../gerrit/.buckversion) - ant ----- - -If you don't have a `bin/` directory in your home directory, create one: - ----- - mkdir ~/bin ----- - -Add the `~/bin` folder to the path: - ----- - PATH=~/bin:$PATH ----- - -Note that the buck executable needs to be available in all shell sessions, -so also make sure it is appended to the path globally. - -Add a symbolic link in `~/bin` to the buck and buckd executables: - ----- - ln -s `pwd`/bin/buck ~/bin/ - ln -s `pwd`/bin/buckd ~/bin/ ----- - -Verify that `buck` is accessible: - ----- - which buck ----- - -To enable autocompletion of buck commands, install the autocompletion -script from `./scripts/buck-completion.bash` in the buck project. Refer -to the script's header comments for installation instructions. - -== Prerequisites - -Buck requires Python version 2.7 to be installed. The Maven download toolchain -requires `curl` to be installed. - -[[eclipse]] -== Eclipse Integration - - -=== Generating the Eclipse Project - -Create the Eclipse project: - ----- - tools/eclipse/project.py ----- - -and then follow the link:dev-eclipse.html#setup[setup instructions]. - -=== Refreshing the Classpath - -If an updated classpath is needed, the Eclipse project can be -refreshed and missing dependency JARs can be downloaded: - ----- - tools/eclipse/project.py ----- - - -=== Attaching Sources - -Source JARs are downloaded by default. This allows Eclipse to show -documentation or dive into the implementation of a library JAR. - -To save time and bandwidth, download of source JARs can be restricted -to only those that are necessary to compile Java source into JavaScript -using the GWT compiler: - ----- - tools/eclipse/project.py --no-src ----- - - -[[build]] -== Building on the Command Line - - -=== Gerrit Development WAR File - -To build the Gerrit web application that includes GWT UI and PolyGerrit UI: - ----- - buck build gerrit ----- - -[NOTE] -PolyGerrit UI may require additional tools (such as npm). Please read -the polygerrit-ui/README.md for more info. - -The output executable WAR will be placed in: - ----- - buck-out/gen/gerrit/gerrit.war ----- - -To build the Gerrit web application that includes only GWT UI: - ----- - buck build gwtgerrit ----- - -The output executable WAR will be placed in: - ----- - buck-out/gen/gwtgerrit/gwtgerrit.war ----- - - -=== Headless Mode - -To build Gerrit in headless mode, i.e. without the GWT Web UI: - ----- - buck build headless ----- - -The output executable WAR will be placed in: - ----- - buck-out/gen/headless/headless.war ----- - -=== Extension and Plugin API JAR Files - -To build the extension, plugin and GWT API JAR files: - ----- - buck build api ----- - -Java binaries, Java sources and Java docs are generated into corresponding -project directories in `buck-out/gen`, here as example for plugin API: - ----- - buck-out/gen/gerrit-plugin-api/plugin-api.jar - buck-out/gen/gerrit-plugin-api/plugin-api-javadoc/plugin-api-javadoc.jar - buck-out/gen/gerrit-plugin-api/plugin-api-src.jar ----- - -Install {extension,plugin,gwt}-api to the local maven repository: - ----- - tools/maven/api.sh install ----- - -Install gerrit.war to the local maven repository: - ----- - tools/maven/api.sh war_install ----- - -=== Plugins - -To build all core plugins: - ----- - buck build plugins:core ----- - -The output JAR files for individual plugins will be placed in: - ----- - buck-out/gen/plugins//.jar ----- - -The JAR files will also be packaged in: - ----- - buck-out/gen/plugins/core/core.zip ----- - -To build a specific plugin: - ----- - buck build plugins/: ----- - -The output JAR file will be be placed in: - ----- - buck-out/gen/plugins//.jar ----- - -Note that when building an individual plugin, the `core.zip` package -is not regenerated. - -Additional plugins with BUCK files can be added to the build -environment by cloning the source repository into the plugins -subdirectory: - ----- - git clone https://gerrit.googlesource.com/plugins/ plugins/ - echo /plugins/ >>.git/info/exclude ----- - -Additional plugin sources will be automatically added to Eclipse the -next time project.py is run: - ----- - tools/eclipse/project.py ----- - - -[[documentation]] -=== Documentation - -To build only the documentation for testing or static hosting: - ----- - buck build docs ----- - -The generated html files will NOT come with the search box, and will be -placed in: - ----- - buck-out/gen/Documentation/searchfree__tmp/Documentation ----- - -The html files will also be bundled into `searchfree.zip` in this location: - ----- - buck-out/gen/Documentation/searchfree/searchfree.zip ----- - -To build the executable WAR with the documentation included: - ----- - buck build withdocs ----- - -The WAR file will be placed in: - ----- - buck-out/gen/withdocs/withdocs.war ----- - -[[soyc]] -=== GWT Compile Report - -The GWT compiler can output a compile report (or "story of your compile"), -describing the size of the JavaScript and which source classes contributed -to the overall download size. - ----- - buck build soyc ----- - -The report will be written as an HTML page to the extras directory, and -can be opened and viewed in any web browser: - ----- - extras/gerrit_ui/soycReport/compile-report/index.html ----- - -Only the "Split Point Report" is created, "Compiler Metrics" are not output. - -[[release]] -=== Gerrit Release WAR File - -To build the release of the Gerrit web application, including documentation and -all core plugins: - ----- - buck build release ----- - -The output release WAR will be placed in: - ----- - buck-out/gen/release/release.war ----- - -[[tests]] -== Running Unit Tests - -To run all tests including acceptance tests (but not flaky tests): - ----- - buck test --exclude flaky ----- - -To exclude flaky and slow tests: - ----- - buck test --exclude flaky slow ----- - -To run only a specific group of acceptance tests: - ----- - buck test --include api ----- - -The following groups of tests are currently supported: - -* acceptance -* api -* edit -* flaky -* git -* pgm -* rest -* server -* ssh -* slow - -To run a specific test group, e.g. the rest-account test group: - ----- - buck test //gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/account:rest-account ----- - -To create test coverage report: - ----- - buck test --code-coverage --code-coverage-format html --no-results-cache ----- - -The HTML report is created in `buck-out/gen/jacoco/code-coverage/index.html`. - -To run the tests against NoteDb backend: - ----- - GERRIT_NOTEDB=READ_WRITE buck test ----- - -To run only tests that do not use SSH: - ----- - GERRIT_USE_SSH=NO buck test ----- - -== Dependencies - -Dependency JARs are normally downloaded automatically, but Buck can inspect -its graph and download any missing JAR files. This is useful to enable -subsequent builds to run without network access: - ----- - tools/download_all.py ----- - -When downloading from behind a proxy (which is common in some corporate -environments), it might be necessary to explicitly specify the proxy that -is then used by `curl`: - ----- - export http_proxy=http://:@: ----- - -Redirection to local mirrors of Maven Central and the Gerrit storage -bucket is supported by defining specific properties in -`local.properties`, a file that is not tracked by Git: - ----- - echo download.GERRIT = http://nexus.my-company.com/ >>local.properties - echo download.MAVEN_CENTRAL = http://nexus.my-company.com/ >>local.properties ----- - -The `local.properties` file may be placed in the root of the gerrit repository -being built, or in `~/.gerritcodereview/`. The file in the root of the gerrit -repository has precedence. - -== Building against unpublished Maven JARs - -To build against unpublished Maven JARs, like gwtorm or PrologCafe, the custom -JARs must be installed in the local Maven repository (`mvn clean install`) and -`maven_jar()` must be updated to point to the `MAVEN_LOCAL` Maven repository for -that artifact: - -[source,python] ----- - maven_jar( - name = 'gwtorm', - id = 'gwtorm:gwtorm:42', - license = 'Apache2.0', - repository = MAVEN_LOCAL, - ) ----- - -== Building against artifacts from custom Maven repositories - -To build against custom Maven repositories, two modes of operations are -supported: with rewrite in local.properties and without. - -Without rewrite the URL of custom Maven repository can be directly passed -to the maven_jar() function: - -[source,python] ----- - GERRIT_FORGE = 'http://gerritforge.com/snapshot' - - maven_jar( - name = 'gitblit', - id = 'com.gitblit:gitblit:1.4.0', - sha1 = '1b130dbf5578ace37507430a4a523f6594bf34fa', - license = 'Apache2.0', - repository = GERRIT_FORGE, - ) ----- - -When the custom URL has to be rewritten, then the same logic as with Gerrit -known Maven repository is used: Repo name must be defined that matches an entry -in local.properties file: - ----- - download.GERRIT_FORGE = http://my.company.mirror/gerrit-forge ----- - -And corresponding BUCK excerpt: - -[source,python] ----- - GERRIT_FORGE = 'GERRIT_FORGE:' - - maven_jar( - name = 'gitblit', - id = 'com.gitblit:gitblit:1.4.0', - sha1 = '1b130dbf5578ace37507430a4a523f6594bf34fa', - license = 'Apache2.0', - repository = GERRIT_FORGE, - ) ----- - -=== Caching Build Results - -Build results can be locally cached, saving rebuild time when -switching between Git branches. Buck's documentation covers -caching in link:http://facebook.github.io/buck/concept/buckconfig.html[buckconfig]. -The trivial case using a local directory is: - ----- - cat >.buckconfig.local < .buckjavaargs <: +bazel build plugins/: ---- The output can be normally found in the following directory: ---- -buck-out/gen/plugins//.jar +bazel-genfiles/plugins//.jar ---- Some plugins describe their build process in `src/main/resources/Documentation/build.md` file. It may worth checking. -== Buck standalone driven +== Bazel standalone driven Only few plugins support that mode for now: ---- cd reviewers -buck build plugin +bazel build reviewers ---- GERRIT diff --git a/Documentation/dev-eclipse.txt b/Documentation/dev-eclipse.txt index 4fa542d456..5ada1e2811 100644 --- a/Documentation/dev-eclipse.txt +++ b/Documentation/dev-eclipse.txt @@ -33,7 +33,7 @@ and In Eclipse, choose 'Import existing project' and select the `gerrit` project from the current working directory. -Expand the `gerrit` project, right-click on the `buck-out` folder, select +Expand the `gerrit` project, right-click on the `eclipse-out` folder, select 'Properties', and then under 'Attributes' check 'Derived'. Note that if you make any changes in the project configuration @@ -55,7 +55,7 @@ settings prefer when formatting source code. == Site Initialization Build once on the command line with -link:dev-buck.html#build[Buck] and then follow +link:dev-bazel.html#build[Bazel] and then follow link:dev-readme.html#init[Site Initialization] in the Developer Setup guide to configure a local site for testing. diff --git a/Documentation/dev-plugins.txt b/Documentation/dev-plugins.txt index c1a4fcabf4..4f3de9c05d 100644 --- a/Documentation/dev-plugins.txt +++ b/Documentation/dev-plugins.txt @@ -132,7 +132,7 @@ file: ---- -For Buck driven plugins, the following line must be included in the BUCK +For Bazel driven plugins, the following line must be included in the BUILD configuration file: [source,python] @@ -1347,7 +1347,7 @@ plugins: ---- -or in the `BUCK` configuration file for Buck driven plugins: +or in the `BUILD` configuration file for Bazel driven plugins: [source,python] ---- @@ -1412,7 +1412,7 @@ driven plugins: ---- -or in the `BUCK` configuration file for Buck driven plugins +or in the `BUILD` configuration file for Bazel driven plugins [source,python] ---- diff --git a/Documentation/dev-readme.txt b/Documentation/dev-readme.txt index 383c7096d2..873b9aca3b 100644 --- a/Documentation/dev-readme.txt +++ b/Documentation/dev-readme.txt @@ -1,6 +1,6 @@ = Gerrit Code Review - Developer Setup -Bazel or Facebook Buck is needed to compile the code, and an SQL database to +Google Bazel is needed to compile the code, and an SQL database to house the review metadata. H2 is recommended for development databases, as it requires no external server process. @@ -21,9 +21,7 @@ cloned. [[compile_project]] == Compiling -Please refer to either <> or -<>. - +Please refer to <>. == Switching between branches @@ -50,32 +48,12 @@ screw up your project. To use the Eclipse IDE for development, please see link:dev-eclipse.html[Eclipse Setup]. -For details on how to configure the Eclipse workspace with Buck, -refer to: link:dev-buck.html#eclipse[Eclipse integration with Buck]. +For details on how to configure the Eclipse workspace with Bazel, +refer to: link:dev-bazel.html#eclipse[Eclipse integration with Bazel]. == Configuring IntelliJ IDEA -=== Build based on Buck - -To use IntelliJ IDEA for development, the easiest way is to follow -Eclipse integration and then open it as Eclipse project in IDEA. -You need the Eclipse plugin activated in IntelliJ IDEA. - -Once you start compiling using both buck and your Gerrit project in -IDEA, you will likely need to mark the below directories as generated -sources roots. You can do so using the IDEA "Project" view. In the -context menu of each one of these, use "Mark Directory As" to mark -them as "Generated Sources Root": - ----- - __auto_value_tests_gen__ - __httpd_gen__ - __server_gen__ ----- - -=== Build based on Bazel - Please refer to <> for detailed instructions. @@ -97,12 +75,6 @@ the terminal. After compiling <>, run Gerrit's 'init' command to create a testing site for development use: -.Build based on Buck ----- - java -jar buck-out/gen/gerrit/gerrit.war init -d ../gerrit_testsite ----- - -.Build based on Bazel ---- $(bazel info output_base)/external/local_jdk/bin/java \ -jar bazel-bin/gerrit.war init -d ../gerrit_testsite @@ -169,10 +141,8 @@ A new review site is created for each test and the Gerrit daemon is started on that site. When the test has finished the Gerrit daemon is shutdown. -For instructions on running the integration tests with Buck, -please refer to: -link:dev-buck.html#tests[Running integration tests with Buck]. -For Bazel, please refer to <>. +For instructions on running the integration tests with Bazel, +please refer to: <>. [[run_daemon]] === Running the Daemon @@ -180,14 +150,6 @@ For Bazel, please refer to <>. The daemon can be directly launched from the build area, without copying to the test site: -.Build based on Buck ----- - java -jar buck-out/gen/gerrit/gerrit.war daemon -d \ - ../gerrit_testsite --console-log - ----- - -.Build based on Bazel ---- $(bazel info output_base)/external/local_jdk/bin/java \ -jar bazel-bin/gerrit.war daemon -d ../gerrit_testsite \ @@ -213,12 +175,6 @@ Python scripts for troubleshooting. Gerrit Inspect can be started by adding '-s' option to the command used to launch the daemon: -.Build based on Buck ----- - java -jar buck-out/gen/gerrit/gerrit.war daemon -d ../gerrit_testsite -s ----- - -.Build based on Bazel ---- $(bazel info output_base)/external/local_jdk/bin/java \ -jar bazel-bin/gerrit.war daemon -d ../gerrit_testsite -s @@ -250,12 +206,6 @@ when using the Inspector. The embedded H2 database can be queried and updated from the command line. If the daemon is not currently running: -.Build based on Buck ----- - java -jar buck-out/gen/gerrit/gerrit.war gsql -d ../gerrit_testsite ----- - -.Build based on Bazel ---- $(bazel info output_base)/external/local_jdk/bin/java \ -jar bazel-bin/gerrit.war gsql -d ../gerrit_testsite -s diff --git a/Documentation/dev-release.txt b/Documentation/dev-release.txt index 91a8af4d6f..2a857b2cb7 100644 --- a/Documentation/dev-release.txt +++ b/Documentation/dev-release.txt @@ -111,8 +111,8 @@ the subproject. * link:dev-release-subproject.html#prepare-release[Prepare the Release] * link:dev-release-subproject.html#publish-release[Publish the Release] -* Update the `id`, `bin_sha1`, and `src_sha1` values in the `maven_jar` -for the Subproject in `/lib/BUCK` to the released version. +* Update the `artifact`, `sha1`, and `src_sha1` values in the `maven_jar` +for the Subproject in `WORKSPACE` to the released version. [[update-versions]] === Update Versions and Create Release Tag @@ -147,9 +147,8 @@ Tag the plugins: * Build the Gerrit WAR, API JARs and documentation + ---- - buck clean - buck build --no-cache release docs - ./tools/maven/api.sh install + bazel build release Documentation:searchfree + ./tools/maven/api.sh install ---- * Sanity check WAR @@ -157,11 +156,10 @@ Tag the plugins: * Verify plugin versions + -Sometimes `buck` doesn't rebuild plugins after they are tagged, and the -versions don't reflect the tag. Verify the versions: +Verify the versions: + ---- - java -jar ./buck-out/gen/release/release.war init --list-plugins + java -jar bazel-bin/release.war init --list-plugins ---- [[publish-gerrit]] @@ -174,30 +172,24 @@ versions don't reflect the tag. Verify the versions: link:dev-release-deploy-config.html#deploy-configuration-setting-maven-central[ configuration] for deploying to Maven Central -* Make sure that the version is updated in the `VERSION` file and in +* Make sure that the version is updated in the `version.bzl` file and in the `pom.xml` files as described in the link:#update-versions[Update Versions and Create Release Tag] section. * Push the WAR to Maven Central: + ---- - ./tools/maven/api.sh war_deploy + ./tools/maven/api.sh war_deploy ---- * Push the plugin artifacts to Maven Central: + ---- - ./tools/maven/api.sh deploy ----- -+ -If no artifacts are uploaded, clean the `buck-out` folder and retry: -+ ----- - buck clean ; rm -rf buck-out + ./tools/maven/api.sh deploy ---- * To where the artifacts are uploaded depends on the `GERRIT_VERSION` in -the `VERSION` file: +the `version.bzl` file: ** SNAPSHOT versions are directly uploaded into the Sonatype snapshots repository and no further action is needed: @@ -318,7 +310,7 @@ Push the new Release Tag on the plugins: ==== Upload the Documentation * Extract the documentation files from the zip file generated from -`buck build docs`: `buck-out/gen/Documentation/searchfree/searchfree.zip`. +`bazel build searchfree`: `bazel-bin/Documentation/searchfree.zip`. * Upload the files manually via web browser to the appropriate folder in the @@ -368,7 +360,7 @@ including some or all of the following in the email: + The SHA1 and MD5 can be taken from the artifact page on Sonatype. The SHA256 can be generated with -`openssl sha -sha256 buck-out/gen/release/release.war` or an equivalent +`openssl sha -sha256 bazel-bin/release.war` or an equivalent command. * Update the new discussion group announcement to be sticky @@ -388,8 +380,7 @@ All new development that is done in the `master` branch will be included in the next Gerrit release. The Gerrit version should be set to the snapshot version for the next release. -Use the `version` tool to set the version in the `VERSION` file: -: +Use the `version` tool to set the version in the `version.bzl` file: ---- ./tools/version.py 2.11-SNAPSHOT diff --git a/Documentation/gen_licenses.py b/Documentation/gen_licenses.py deleted file mode 100755 index 15f470c026..0000000000 --- a/Documentation/gen_licenses.py +++ /dev/null @@ -1,178 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2013 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# TODO(sop): Be more detailed: version, link to Maven Central - -from __future__ import print_function - -import argparse -from collections import defaultdict, deque -import json -from os import chdir, path -from shutil import copyfileobj -from subprocess import Popen, PIPE -from sys import stdout, stderr - -parser = argparse.ArgumentParser() -parser.add_argument('--asciidoc', action='store_true') -parser.add_argument('--partial', action='store_true') -parser.add_argument('targets', nargs='+') -args = parser.parse_args() - -KNOWN_PROVIDED_DEPS = [ - '//lib/bouncycastle:bcpg', - '//lib/bouncycastle:bcpkix', - '//lib/bouncycastle:bcprov', -] - -for target in args.targets: - if not target.startswith('//'): - print('Target must be absolute: %s' % target, file=stderr) - -def parse_graph(): - graph = defaultdict(list) - while not path.isfile('.buckconfig'): - chdir('..') - query = ' + '.join('deps(%s)' % t for t in args.targets) - p = Popen([ - 'buck', 'query', query, - '--output-attributes=buck.direct_dependencies'], stdout=PIPE) - obj = json.load(p.stdout) - for target, attrs in obj.iteritems(): - for dep in attrs['buck.direct_dependencies']: - - if target in KNOWN_PROVIDED_DEPS: - continue - - if (args.partial - and dep == '//gerrit-gwtexpui:CSS' - and target == '//gerrit-gwtui:ui_module'): - continue - - graph[target].append(dep) - r = p.wait() - if r != 0: - exit(r) - return graph - -graph = parse_graph() -licenses = defaultdict(set) - -do_not_distribute = False -queue = deque(args.targets) -while queue: - target = queue.popleft() - for dep in graph[target]: - if not dep.startswith('//lib:LICENSE-'): - continue - if 'DO_NOT_DISTRIBUTE' in dep: - do_not_distribute = True - licenses[dep].add(target) - queue.extend(graph[target]) - -if do_not_distribute: - print('DO_NOT_DISTRIBUTE license found', file=stderr) - for target in args.targets: - print('...via %s:' % target) - Popen(['buck', 'query', - 'allpaths(%s, //lib:LICENSE-DO_NOT_DISTRIBUTE)' % target], - stdout=stderr).communicate() - exit(1) - -used = sorted(licenses.keys()) - -if args.asciidoc: - print("""\ -= Gerrit Code Review - Licenses - -Gerrit open source software is licensed under the <>. Executable distributions also include other software -components that are provided under additional licenses. - -[[cryptography]] -== Cryptography Notice - -This distribution includes cryptographic software. The country -in which you currently reside may have restrictions on the import, -possession, use, and/or re-export to another country, of encryption -software. BEFORE using any encryption software, please check -your country's laws, regulations and policies concerning the -import, possession, or use, and re-export of encryption software, -to see if this is permitted. See the -link:http://www.wassenaar.org/[Wassenaar Arrangement] -for more information. - -The U.S. Government Department of Commerce, Bureau of Industry -and Security (BIS), has classified this software as Export -Commodity Control Number (ECCN) 5D002.C.1, which includes -information security software using or performing cryptographic -functions with asymmetric algorithms. The form and manner of -this distribution makes it eligible for export under the License -Exception ENC Technology Software Unrestricted (TSU) exception -(see the BIS Export Administration Regulations, Section 740.13) -for both object code and source code. - -Gerrit includes an SSH daemon (Apache SSHD), to support authenticated -uploads of changes directly from `git push` command line clients. - -Gerrit includes an SSH client (JSch), to support authenticated -replication of changes to remote systems, such as for automatic -updates of mirror servers, or realtime backups. - -For either feature to function, Gerrit requires the -link:http://java.sun.com/javase/technologies/security/[Java Cryptography extensions] -and/or the -link:http://www.bouncycastle.org/java.html[Bouncy Castle Crypto API] -to be installed by the end-user. - -== Licenses -""") - -for n in used: - libs = sorted(licenses[n]) - name = n[len('//lib:LICENSE-'):] - if args.asciidoc: - print() - print('[[%s]]' % name.replace('.', '_')) - print("=== " + name) - print() - else: - print() - print(name) - print() - print('----') - for d in libs: - if d.startswith('//lib:') or d.startswith('//lib/'): - p = d[len('//lib:'):] - else: - p = d[d.index(':')+1:].lower() - if '__' in p: - p = p[:p.index('__')] - print('* ' + p) - if args.asciidoc: - print() - print('[[%s_license]]' % name.replace('.', '_')) - print('----') - with open(n[2:].replace(':', '/')) as fd: - copyfileobj(fd, stdout) - print() - print('----') - -if args.asciidoc: - print(""" -GERRIT ------- -Part of link:index.html[Gerrit Code Review] -""") diff --git a/Documentation/index.txt b/Documentation/index.txt index c913aef77f..0471ed846d 100644 --- a/Documentation/index.txt +++ b/Documentation/index.txt @@ -61,7 +61,6 @@ == Developer . Getting Started .. link:dev-readme.html[Developer Setup] -.. link:dev-buck.html[Building with Buck] .. link:dev-bazel.html[Building with Bazel] .. link:dev-eclipse.html[Eclipse Setup] .. link:dev-intellij.html[IntelliJ Setup] diff --git a/Documentation/intro-project-owner.txt b/Documentation/intro-project-owner.txt index 03eeeb7937..6056e573c6 100644 --- a/Documentation/intro-project-owner.txt +++ b/Documentation/intro-project-owner.txt @@ -596,7 +596,7 @@ The project-specific download commands must be configured in the + ---- [plugin "project-download-commands"] - Build = git fetch ${url} ${ref} && git checkout FETCH_HEAD && buck build ${project} + Build = git fetch ${url} ${ref} && git checkout FETCH_HEAD && bazel build ${project} Update = git fetch ${url} ${ref} && git checkout FETCH_HEAD && git submodule update ---- + diff --git a/Documentation/license.defs b/Documentation/license.defs deleted file mode 100644 index 42dd3eb60c..0000000000 --- a/Documentation/license.defs +++ /dev/null @@ -1,29 +0,0 @@ -def genlicenses( - name, - out, - opts = [], - java_deps = [], - non_java_deps = [], - visibility = []): - cmd = ['$(exe :gen_licenses)'] - cmd.extend(opts) - cmd.append('>$OUT') - cmd.extend(java_deps) - cmd.extend(non_java_deps) - - # Must use $(classpath) for Java deps, since transitive dependencies are not - # first-order dependencies of the output jar, so changes would not cause - # invalidation of the build cache key for the genrule. - cmd.extend('; true $(classpath %s)' % d for d in java_deps) - - # Must use $(location) for non-Java deps, since $(classpath) will fail with an - # error. This is ok, because transitive dependencies are included in the - # output artifacts for everything _except_ Java libraries. - cmd.extend('; true $(location %s)' % d for d in non_java_deps) - - genrule( - name = name, - out = out, - cmd = ' '.join(cmd), - visibility = visibility, - ) diff --git a/Documentation/rest-api-documentation.txt b/Documentation/rest-api-documentation.txt index 4c9db2b40f..0a7ff16a8c 100644 --- a/Documentation/rest-api-documentation.txt +++ b/Documentation/rest-api-documentation.txt @@ -6,9 +6,9 @@ link:rest-api.html[REST API]. Please note that this feature is only usable with documentation built-in. You'll need to -`buck build withdocs` +`bazel build withdocs` or -`buck build release` +`bazel build release` to test this feature. [[documentation-endpoints]] diff --git a/README.md b/README.md index e0ffd53325..78c8477a66 100644 --- a/README.md +++ b/README.md @@ -50,10 +50,10 @@ Gerrit is provided under the Apache License 2.0. ## Build -Install [Buck](http://facebook.github.io/buck/setup/install.html) and run the following: +Install [Bazel](https://bazel.build/versions/master/docs/install.html) and run the following: git clone --recursive https://gerrit.googlesource.com/gerrit - cd gerrit && buck build release + cd gerrit && bazel build release ## Install binary packages (Deb/Rpm) diff --git a/ReleaseNotes/BUCK b/ReleaseNotes/BUCK deleted file mode 100644 index 0f478084d4..0000000000 --- a/ReleaseNotes/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -include_defs('//Documentation/asciidoc.defs') -include_defs('//ReleaseNotes/config.defs') - -DIR = 'ReleaseNotes' - -SRCS = glob(['*.txt']) - - -genasciidoc( - name = 'html', - out = 'html.zip', - directory = DIR, - srcs = SRCS, - attributes = release_notes_attributes(), - backend = 'html5', - searchbox = False, - resources = False, - visibility = ['PUBLIC'], -) diff --git a/ReleaseNotes/config.defs b/ReleaseNotes/config.defs deleted file mode 100644 index 86b7603440..0000000000 --- a/ReleaseNotes/config.defs +++ /dev/null @@ -1,14 +0,0 @@ -def release_notes_attributes(): - return [ - 'toc', - 'newline="\\n"', - 'asterisk="*"', - 'plus="+"', - 'caret="^"', - 'startsb="["', - 'endsb="]"', - 'tilde="~"', - 'last-update-label!', - 'stylesheet=DEFAULT', - 'linkcss=true', - ] diff --git a/bucklets/gerrit_plugin.bucklet b/bucklets/gerrit_plugin.bucklet deleted file mode 100644 index 367fe71c5a..0000000000 --- a/bucklets/gerrit_plugin.bucklet +++ /dev/null @@ -1,21 +0,0 @@ -# -# Dummy to make the co-existence of core and standalone plugins possible. -# Intentionaly left empty as this doesn't suppose to have any side effects -# in tree build, i. e.: -# -# cookbook-plugin/BUCK include this line: -# include_defs('//bucklets/gerrit_plugin.bucklet') -# -# When executing from the Gerrit tree: -# buck build plugins/cookbook-plugin -# -# this line has no effect. -# -# When compiling from standalone cookbook-plugin, bucklets directory points -# to cloned bucklets library that includes real gerrit_plugin.bucklet code. - -GERRIT_GWT_API = ['//gerrit-plugin-gwtui:gwtui-api'] -GERRIT_PLUGIN_API = ['//gerrit-plugin-api:lib'] -GERRIT_TESTS = ['//gerrit-acceptance-framework:lib'] - -STANDALONE_MODE = False diff --git a/bucklets/java_doc.bucklet b/bucklets/java_doc.bucklet deleted file mode 120000 index cc8b6dba8e..0000000000 --- a/bucklets/java_doc.bucklet +++ /dev/null @@ -1 +0,0 @@ -../tools/java_doc.defs \ No newline at end of file diff --git a/bucklets/java_sources.bucklet b/bucklets/java_sources.bucklet deleted file mode 120000 index 8a1a5dddfb..0000000000 --- a/bucklets/java_sources.bucklet +++ /dev/null @@ -1 +0,0 @@ -../tools/java_sources.defs \ No newline at end of file diff --git a/bucklets/maven_jar.bucklet b/bucklets/maven_jar.bucklet deleted file mode 120000 index 130a74772b..0000000000 --- a/bucklets/maven_jar.bucklet +++ /dev/null @@ -1 +0,0 @@ -../lib/maven.defs \ No newline at end of file diff --git a/bucklets/maven_package.bucklet b/bucklets/maven_package.bucklet deleted file mode 120000 index b5f5ea8afb..0000000000 --- a/bucklets/maven_package.bucklet +++ /dev/null @@ -1 +0,0 @@ -../tools/maven/package.defs \ No newline at end of file diff --git a/contrib/build-consistency.go b/contrib/build-consistency.go deleted file mode 100644 index db63a274dd..0000000000 --- a/contrib/build-consistency.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (C) 2016 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "fmt" - "io/ioutil" - "log" - "os" - "path/filepath" - "regexp" - "strings" -) - -var ( - // Define regex to find a comment in the build files - commentRE = regexp.MustCompile("#.*") - // Define regexes to extract the lib name and sha1 - mvnRE = regexp.MustCompile("maven_jar([^)]*)") - sha1RE = regexp.MustCompile("sha1=[\"'](?P[^,]*)[\"']") - bSha1RE = regexp.MustCompile("bin_sha1=[\"'](?P[^,]*)[\"']") - libNameRE = regexp.MustCompile("name=[\"'](?P[^,]*)[\"']") -) - -func sanitize(s string) string { - // Strip out comments - s = commentRE.ReplaceAllString(s, "") - // Remove newlines and blanks - s = strings.Replace(s, "\n", "", -1) - s = strings.Replace(s, " ", "", -1) - // WORKSPACE syntax disallows the dash char in artifact name and we use an underscore - // So we make this a consistent underscore in all files - s = strings.Replace(s, "-", "_", -1) - return s -} - -func main() { - // Load bazel WORKSPACE file - bzlDat, err := ioutil.ReadFile("WORKSPACE") - if err != nil { - log.Fatal(err) - } - bzlStr := sanitize(string(bzlDat)) - - // Walk all files nested under lib. Find, load and sanitize BUCK files - bckStrs := []string{} - err = filepath.Walk("lib/", func(path string, f os.FileInfo, err error) error { - bckFile := filepath.Join(path, "BUCK") - if _, err := os.Stat(bckFile); err == nil { - bckDat, err := ioutil.ReadFile(bckFile) - if err != nil { - return err - } - bckStrs = append(bckStrs, sanitize(string(bckDat))) - } - return nil - }) - if err != nil { - log.Fatal(err) - } - bckStr := strings.Join(bckStrs, "") - - // Find all bazel dependencies - // bzlVersions maps from a lib name to the referenced sha1 - bzlVersions := make(map[string]string) - for _, mvn := range mvnRE.FindAllString(bzlStr, -1) { - sha1s := sha1RE.FindStringSubmatch(mvn) - names := libNameRE.FindStringSubmatch(mvn) - if len(sha1s) > 1 && len(names) > 1 { - bzlVersions[names[1]] = sha1RE.FindStringSubmatch(mvn)[1] - } else { - fmt.Printf("Can't parse lib sha1/name of target %s\n", mvn) - } - } - - // Find all buck dependencies and check if we have the correct bazel dependency on file - for _, mvn := range mvnRE.FindAllString(bckStr, -1) { - sha1s := bSha1RE.FindStringSubmatch(mvn) - if len(sha1s) < 2 { - // Buck knows two dep version representations: just a SHA1 or a bin_sha1 and src_sha1 - // We try to extract the bin_sha1 first. If that fails, we use the sha1 - sha1s = sha1RE.FindStringSubmatch(mvn) - } - names := libNameRE.FindStringSubmatch(mvn) - if len(sha1s) > 1 && len(names) > 1 { - if _, ok := bzlVersions[names[1]]; !ok { - // TODO(hiesel) This produces too many false positives. - //fmt.Printf("Don't have lib %s in bazel\n", names[1]) - } else if bzlVersions[names[1]] != sha1s[1] { - fmt.Printf("SHA1 of lib %s does not match: buck has %s while bazel has %s\n", names[1], sha1s[1], bzlVersions[names[1]]) - } - } else { - fmt.Printf("Can't parse lib sha1/name on target %s\n", mvn) - } - } -} diff --git a/contrib/convertkey/BUCK b/contrib/convertkey/BUCK deleted file mode 100644 index 40ad9c45ac..0000000000 --- a/contrib/convertkey/BUCK +++ /dev/null @@ -1,50 +0,0 @@ -include_defs('//lib/maven.defs') - -genrule( - name = 'bcprov__unsign', - cmd = ' && '.join([ - 'unzip -qd $TMP $(location //lib/bouncycastle:bcprov)', - 'cd $TMP', - 'zip -Drq $OUT . -x META-INF/\*.RSA META-INF/\*.DSA META-INF/\*.SF META-INF/\*.LIST', - ]), - out = 'bcprov-unsigned.jar', -) - -prebuilt_jar( - name = 'bcprov', - binary_jar = ':bcprov__unsign', -) - -genrule( - name = 'bcpkix__unsign', - cmd = ' && '.join([ - 'unzip -qd $TMP $(location //lib/bouncycastle:bcpkix)', - 'cd $TMP', - 'zip -Drq $OUT . -x META-INF/\*.RSA META-INF/\*.DSA META-INF/\*.SF META-INF/\*.LIST', - ]), - out = 'bcpkix-unsigned.jar', -) - -prebuilt_jar( - name = 'bcpkix', - binary_jar = ':bcpkix__unsign', -) - -java_library( - name = 'convertkey__lib', - srcs = glob(['src/main/java/**/*.java']), - deps = [ - ':bcprov', - ':bcpkix', - '//lib:jsch', - '//lib/log:nop', - '//lib/mina:sshd', - ], -) - -java_binary( - name = 'convertkey', - deps = [':convertkey__lib'], - main_class = 'com.googlesource.gerrit.convertkey.ConvertKey', -) - diff --git a/gerrit-acceptance-framework/BUCK b/gerrit-acceptance-framework/BUCK deleted file mode 100644 index dca71e6273..0000000000 --- a/gerrit-acceptance-framework/BUCK +++ /dev/null @@ -1,92 +0,0 @@ -SRCS = glob(['src/test/java/com/google/gerrit/acceptance/*.java']) - -PROVIDED = [ - '//gerrit-common:annotations', - '//gerrit-common:server', - '//gerrit-extension-api:api', - '//gerrit-httpd:httpd', - '//gerrit-lucene:lucene', - '//gerrit-pgm:init', - '//gerrit-reviewdb:server', - '//gerrit-server:server', - '//lib:gson', - '//lib:jsch', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/mina:sshd', - '//lib:servlet-api-3_1', -] - -java_binary( - name = 'acceptance-framework', - merge_manifests = False, - manifest_file = ':manifest', - deps = [':lib'], - visibility = ['PUBLIC'], -) - -genrule( - name = 'manifest', - cmd = 'echo "Manifest-Version: 1.0" >$OUT;' + - 'echo "Implementation-Title: Gerrit Acceptance Test Framework" >>$OUT;' + - 'echo "Implementation-Vendor: Gerrit Code Review Project" >>$OUT', - out = 'manifest.txt', -) - -java_library( - name = 'lib', - srcs = SRCS, - exported_deps = [ - '//gerrit-antlr:query_exception', - '//gerrit-gpg:gpg', - '//gerrit-launcher:launcher', - '//gerrit-openid:openid', - '//gerrit-pgm:daemon', - '//gerrit-pgm:http-jetty', - '//gerrit-pgm:util-nodep', - '//gerrit-server/src/main/prolog:common', - '//gerrit-server:testutil', - '//lib/auto:auto-value', - '//lib/httpcomponents:fluent-hc', - '//lib/httpcomponents:httpclient', - '//lib/httpcomponents:httpcore', - '//lib/jetty:servlet', - '//lib/jgit/org.eclipse.jgit.junit:junit', - '//lib/log:impl_log4j', - '//lib/log:log4j', - '//lib:truth', - ], - provided_deps = PROVIDED + [ - '//lib/greenmail:greenmail', - '//lib:gwtorm', - '//lib/guice:guice', - '//lib/guice:guice-assistedinject', - '//lib/guice:guice-servlet', - '//lib/mail:mail', - ], - visibility = ['PUBLIC'], -) - -java_sources( - name = 'acceptance-framework-src', - srcs = SRCS, - visibility = ['PUBLIC'], -) - -java_doc( - name = 'acceptance-framework-javadoc', - title = 'Gerrit Acceptance Test Framework Documentation', - pkgs = [' com.google.gerrit.acceptance'], - source_jar = ':acceptance-framework-src', - srcs = SRCS, - deps = PROVIDED + [ - ':lib', - '//lib:guava', - '//lib/guice:guice-assistedinject', - '//lib/guice:guice_library', - '//lib/guice:guice-servlet', - '//lib/guice:javax-inject', - '//lib:gwtorm_client', - '//lib:junit', - ], - visibility = ['PUBLIC'], -) diff --git a/gerrit-acceptance-tests/BUCK b/gerrit-acceptance-tests/BUCK deleted file mode 100644 index 82d268d3f9..0000000000 --- a/gerrit-acceptance-tests/BUCK +++ /dev/null @@ -1,48 +0,0 @@ -java_library( - name = 'lib', - srcs = glob(['src/test/java/com/google/gerrit/acceptance/*.java']), - exported_deps = [ - '//gerrit-acceptance-framework:lib', - '//gerrit-common:annotations', - '//gerrit-common:server', - '//gerrit-extension-api:api', - '//gerrit-gpg:testutil', - '//gerrit-launcher:launcher', - '//gerrit-lucene:lucene', - '//gerrit-httpd:httpd', - '//gerrit-pgm:init', - '//gerrit-pgm:pgm', - '//gerrit-pgm:util', - '//gerrit-reviewdb:server', - '//gerrit-server:server', - '//gerrit-server:testutil', - '//gerrit-server/src/main/prolog:common', - '//gerrit-sshd:sshd', - '//gerrit-test-util:test_util', - - '//lib:args4j', - '//lib:gson', - '//lib:gwtjsonrpc', - '//lib:gwtorm', - '//lib:h2', - '//lib:jsch', - '//lib:servlet-api-3_1', - - '//lib/bouncycastle:bcpg', - '//lib/bouncycastle:bcprov', - '//lib/commons:compress', - '//lib/greenmail:greenmail', - '//lib/guice:guice', - '//lib/guice:guice-assistedinject', - '//lib/guice:guice-servlet', - '//lib/log:api', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/mail:mail', - '//lib/mina:sshd', - ], - visibility = [ - '//gerrit-plugin-api/...', - '//tools/eclipse:classpath', - '//gerrit-acceptance-tests/...', - ], -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/accounts/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/accounts/BUCK deleted file mode 100644 index 4e3c880029..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/accounts/BUCK +++ /dev/null @@ -1,7 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'api_account', - srcs = glob(['*IT.java']), - labels = ['api'], -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/change/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/change/BUCK deleted file mode 100644 index e8963bef11..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/change/BUCK +++ /dev/null @@ -1,7 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'api_change', - srcs = glob(['*IT.java']), - labels = ['api'], -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/config/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/config/BUCK deleted file mode 100644 index 3b3d362aa2..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/config/BUCK +++ /dev/null @@ -1,7 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'api_config', - srcs = glob(['*IT.java']), - labels = ['api'], -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/group/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/group/BUCK deleted file mode 100644 index cea23dd0b9..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/group/BUCK +++ /dev/null @@ -1,23 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'api_group', - srcs = glob(['*IT.java']), - deps = [ - ':util', - '//gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/account:util', - ], - labels = ['api'], -) - -java_library( - name = 'util', - srcs = ['GroupAssert.java'], - deps = [ - '//gerrit-extension-api:api', - '//gerrit-reviewdb:server', - '//gerrit-server:server', - '//lib:gwtorm', - '//lib:truth', - ], -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/project/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/project/BUCK deleted file mode 100644 index 0b293f3f7b..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/project/BUCK +++ /dev/null @@ -1,7 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'api_project', - srcs = glob(['*IT.java']), - labels = ['api'], -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/revision/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/revision/BUCK deleted file mode 100644 index 76ae637a0e..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/revision/BUCK +++ /dev/null @@ -1,7 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'api_revision', - srcs = glob(['*IT.java']), - labels = ['api'], -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/edit/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/edit/BUCK deleted file mode 100644 index 313144ae28..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/edit/BUCK +++ /dev/null @@ -1,10 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'edit', - srcs = ['ChangeEditIT.java'], - deps = [ - '//lib/joda:joda-time', - ], - labels = ['edit'], -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/git/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/git/BUCK deleted file mode 100644 index 42ece25ab6..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/git/BUCK +++ /dev/null @@ -1,27 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'git', - srcs = glob(['*IT.java']), - deps = [ - ':submodule_util', - ':push_for_review', - '//gerrit-extension-api:api', - ], - labels = ['git'], -) - -java_library( - name = 'push_for_review', - srcs = ['AbstractPushForReview.java'], - deps = [ - '//gerrit-acceptance-tests:lib', - '//lib/joda:joda-time', - ], -) - -java_library( - name = 'submodule_util', - srcs = ['AbstractSubmoduleSubscription.java',], - deps = ['//gerrit-acceptance-tests:lib',] -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/pgm/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/pgm/BUCK deleted file mode 100644 index 35229919f3..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/pgm/BUCK +++ /dev/null @@ -1,7 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'pgm', - srcs = glob(['*IT.java']), - labels = ['pgm'], -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/account/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/account/BUCK deleted file mode 100644 index 76c918b1b0..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/account/BUCK +++ /dev/null @@ -1,23 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'rest_account', - srcs = glob(['*IT.java']), - deps = [':util'], - labels = ['rest'], -) - -java_library( - name = 'util', - srcs = [ - 'AccountAssert.java', - 'CapabilityInfo.java', - ], - deps = [ - '//gerrit-acceptance-tests:lib', - '//gerrit-reviewdb:server', - '//lib:gwtorm', - '//lib:junit', - ], - visibility = ['//gerrit-acceptance-tests/...'], -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/change/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/change/BUCK deleted file mode 100644 index 654ce29f45..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/change/BUCK +++ /dev/null @@ -1,34 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -SUBMIT_UTIL_SRCS = glob(['AbstractSubmit*.java']) -SUBMIT_TESTS = glob(['Submit*IT.java']) -OTHER_TESTS = glob(['*IT.java'], excludes = SUBMIT_TESTS) - -acceptance_tests( - group = 'rest_change_other', - srcs = OTHER_TESTS, - deps = [ - ':submit_util', - '//gerrit-server:server', - '//lib/guice:guice', - '//lib/joda:joda-time', - ], - labels = ['rest'], -) - -acceptance_tests( - group = 'rest_change_submit', - srcs = SUBMIT_TESTS, - deps = [ - ':submit_util', - ], - labels = ['rest'], -) - -java_library( - name = 'submit_util', - srcs = SUBMIT_UTIL_SRCS, - deps = [ - '//gerrit-acceptance-tests:lib', - ], -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/config/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/config/BUCK deleted file mode 100644 index d65b84af39..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/config/BUCK +++ /dev/null @@ -1,7 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'rest_config', - srcs = glob(['*IT.java']), - labels = ['rest'] -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/group/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/group/BUCK deleted file mode 100644 index 194714843a..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/group/BUCK +++ /dev/null @@ -1,8 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'rest_group', - srcs = glob(['*IT.java']), - labels = ['rest'] -) - diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/project/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/project/BUCK deleted file mode 100644 index 2d3e2da58d..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/project/BUCK +++ /dev/null @@ -1,37 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'rest_project', - srcs = glob(['*IT.java']), - deps = [ - ':project', - ':refassert', - ], - labels = ['rest'], -) - -java_library( - name = 'refassert', - srcs = [ - 'RefAssert.java', - ], - deps = [ - '//lib:truth', - '//gerrit-extension-api:api', - '//gerrit-server:server', - ], -) - -java_library( - name = 'project', - srcs = [ - 'ProjectAssert.java', - ], - deps = [ - '//gerrit-extension-api:api', - '//gerrit-reviewdb:server', - '//gerrit-server:server', - '//lib:gwtorm', - '//lib:truth', - ], -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/change/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/change/BUCK deleted file mode 100644 index 53844479e7..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/change/BUCK +++ /dev/null @@ -1,7 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'server_change', - srcs = glob(['*IT.java']), - labels = ['server'], -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/event/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/event/BUCK deleted file mode 100644 index 4fbc977f8f..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/event/BUCK +++ /dev/null @@ -1,7 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'server_event', - srcs = glob(['*IT.java']), - labels = ['server'], -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/mail/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/mail/BUCK deleted file mode 100644 index c64215499e..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/mail/BUCK +++ /dev/null @@ -1,10 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'server_mail', - srcs = glob(['*IT.java']), - labels = ['server'], - deps = [ - '//lib/joda:joda-time', - ], -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/notedb/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/notedb/BUCK deleted file mode 100644 index d9976e5b23..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/notedb/BUCK +++ /dev/null @@ -1,7 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'server_notedb', - srcs = glob(['*IT.java']), - labels = ['notedb', 'server'], -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/project/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/project/BUCK deleted file mode 100644 index 013115d374..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/server/project/BUCK +++ /dev/null @@ -1,7 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'server_project', - srcs = glob(['*IT.java']), - labels = ['server'], -) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/BUCK b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/BUCK deleted file mode 100644 index 0729b68955..0000000000 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/BUCK +++ /dev/null @@ -1,8 +0,0 @@ -include_defs('//gerrit-acceptance-tests/tests.defs') - -acceptance_tests( - group = 'ssh', - srcs = glob(['*IT.java']), - deps = ['//lib/commons:compress'], - labels = ['ssh'], -) diff --git a/gerrit-acceptance-tests/tests.defs b/gerrit-acceptance-tests/tests.defs deleted file mode 100644 index 648bd63f49..0000000000 --- a/gerrit-acceptance-tests/tests.defs +++ /dev/null @@ -1,27 +0,0 @@ -BOUNCYCASTLE = [ - '//lib/bouncycastle:bcpkix', - '//lib/bouncycastle:bcpg', -] - -def acceptance_tests( - group, - srcs, - deps = [], - labels = [], - vm_args = ['-Xmx256m']): - from os import path - if path.exists('/dev/urandom'): - vm_args = vm_args + ['-Djava.security.egd=file:/dev/./urandom'] - - java_test( - name = group, - srcs = srcs, - deps = deps + BOUNCYCASTLE + [ - '//gerrit-acceptance-tests:lib' - ], - labels = labels + [ - 'acceptance', - 'slow', - ], - vm_args = vm_args, - ) diff --git a/gerrit-antlr/BUCK b/gerrit-antlr/BUCK deleted file mode 100644 index e858a720d2..0000000000 --- a/gerrit-antlr/BUCK +++ /dev/null @@ -1,36 +0,0 @@ -PARSER_DEPS = [ - ':query_exception', - '//lib/antlr:java_runtime', -] - -java_library( - name = 'query_exception', - srcs = ['src/main/java/com/google/gerrit/server/query/QueryParseException.java'], - visibility = ['PUBLIC'], -) - -genantlr( - name = 'query_antlr', - srcs = ['src/main/antlr3/com/google/gerrit/server/query/Query.g'], - out = 'query_antlr.src.zip', -) - -java_library( - name = 'lib', - srcs = [':query_antlr'], - deps = PARSER_DEPS, -) - -# Hack necessary to expose ANTLR generated code as JAR to Eclipse. -genrule( - name = 'query_link', - cmd = 'ln -s $(location :lib) $OUT', - out = 'query_parser.jar', -) - -prebuilt_jar( - name = 'query_parser', - binary_jar = ':query_link', - deps = PARSER_DEPS, - visibility = ['PUBLIC'], -) diff --git a/gerrit-cache-h2/BUCK b/gerrit-cache-h2/BUCK deleted file mode 100644 index 0bc1cb1226..0000000000 --- a/gerrit-cache-h2/BUCK +++ /dev/null @@ -1,28 +0,0 @@ -java_library( - name = 'cache-h2', - srcs = glob(['src/main/java/**/*.java']), - deps = [ - '//gerrit-common:server', - '//gerrit-extension-api:api', - '//gerrit-server:server', - '//lib:guava', - '//lib:h2', - '//lib/guice:guice', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/log:api', - ], - visibility = ['PUBLIC'], -) - -java_test( - name = 'tests', - srcs = glob(['src/test/java/**/*.java']), - deps = [ - ':cache-h2', - '//gerrit-server:server', - '//lib:guava', - '//lib:h2', - '//lib/guice:guice', - '//lib:junit', - ], -) diff --git a/gerrit-common/BUCK b/gerrit-common/BUCK deleted file mode 100644 index b2ae8b03cf..0000000000 --- a/gerrit-common/BUCK +++ /dev/null @@ -1,75 +0,0 @@ -SRC = 'src/main/java/com/google/gerrit/' - -ANNOTATIONS = [ - SRC + x for x in [ - 'common/Nullable.java', - 'common/audit/Audit.java', - 'common/auth/SignInRequired.java', - ] -] - -java_library( - name = 'annotations', - srcs = ANNOTATIONS, - visibility = ['PUBLIC'], -) - -gwt_module( - name = 'client', - srcs = glob([SRC + 'common/**/*.java']), - gwt_xml = SRC + 'Common.gwt.xml', - exported_deps = [ - '//gerrit-extension-api:api', - '//gerrit-prettify:client', - '//lib:guava', - '//lib:gwtorm_client', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/joda:joda-time', - '//lib/log:api', - ], - provided_deps = ['//lib:servlet-api-3_1'], - visibility = ['PUBLIC'], -) - -java_library( - name = 'server', - srcs = glob([SRC + 'common/**/*.java'], excludes = ANNOTATIONS), - deps = [ - ':annotations', - '//gerrit-extension-api:api', - '//gerrit-patch-jgit:server', - '//gerrit-prettify:server', - '//gerrit-reviewdb:server', - '//lib:guava', - '//lib:gwtjsonrpc', - '//lib:gwtorm', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/joda:joda-time', - '//lib/log:api', - ], - provided_deps = ['//lib:servlet-api-3_1'], - visibility = ['PUBLIC'], -) - -TEST = 'src/test/java/com/google/gerrit/common/' -AUTO_VALUE_TEST_SRCS = [TEST + 'AutoValueTest.java'] - -java_test( - name = 'client_tests', - srcs = glob(['src/test/java/**/*.java'], excludes = AUTO_VALUE_TEST_SRCS), - deps = [ - ':client', - '//lib:guava', - '//lib:junit', - '//lib:truth', - ], -) - -java_test( - name = 'auto_value_tests', - srcs = AUTO_VALUE_TEST_SRCS, - deps = [ - '//lib:truth', - '//lib/auto:auto-value', - ], -) diff --git a/gerrit-elasticsearch/BUCK b/gerrit-elasticsearch/BUCK deleted file mode 100644 index 32ebb3a29f..0000000000 --- a/gerrit-elasticsearch/BUCK +++ /dev/null @@ -1,51 +0,0 @@ -java_library( - name = 'elasticsearch', - srcs = glob(['src/main/java/**/*.java']), - deps = [ - '//gerrit-antlr:query_exception', - '//gerrit-extension-api:api', - '//gerrit-reviewdb:client', - '//gerrit-reviewdb:server', - '//gerrit-server:server', - '//lib:gson', - '//lib:guava', - '//lib:gwtorm', - '//lib:protobuf', - '//lib/commons:codec', - '//lib/commons:lang', - '//lib/elasticsearch:elasticsearch', - '//lib/elasticsearch:jest', - '//lib/elasticsearch:jest-common', - '//lib/guice:guice', - '//lib/guice:guice-assistedinject', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/joda:joda-time', - '//lib/log:api', - '//lib/lucene:lucene-analyzers-common', - '//lib/lucene:lucene-core', - ], - visibility = ['PUBLIC'], -) - -java_test( - name = 'elasticsearch_tests', - labels = ['elastic', 'flaky'], - srcs = glob(['src/test/java/**/*.java']), - deps = [ - ':elasticsearch', - '//gerrit-extension-api:api', - '//gerrit-reviewdb:client', - '//gerrit-reviewdb:server', - '//gerrit-server:server', - '//gerrit-server:testutil', - '//gerrit-server:query_tests', - '//lib:gson', - '//lib:guava', - '//lib:junit', - '//lib:truth', - '//lib/elasticsearch:elasticsearch', - '//lib/guice:guice', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/jgit/org.eclipse.jgit.junit:junit', - ], -) diff --git a/gerrit-extension-api/BUCK b/gerrit-extension-api/BUCK deleted file mode 100644 index 19c1781854..0000000000 --- a/gerrit-extension-api/BUCK +++ /dev/null @@ -1,89 +0,0 @@ -include_defs('//lib/JGIT_VERSION') -include_defs('//lib/GUAVA_VERSION') - -SRC = 'src/main/java/com/google/gerrit/extensions/' -SRCS = glob([SRC + '**/*.java']) - -EXT_API_SRCS = glob([SRC + 'client/*.java']) - -gwt_module( - name = 'client', - srcs = EXT_API_SRCS, - gwt_xml = SRC + 'Extensions.gwt.xml', - visibility = ['PUBLIC'], -) - -java_library( - name = 'client-lib', - srcs = EXT_API_SRCS, - resources = EXT_API_SRCS + glob([SRC + 'Extensions.gwt.xml']), - visibility = ['PUBLIC'], -) - -java_binary( - name = 'extension-api', - deps = [':lib'], - visibility = ['PUBLIC'], -) - -java_library( - name = 'lib', - exported_deps = [ - ':api', - '//lib:guava', - '//lib/guice:guice', - '//lib/guice:guice-assistedinject', - '//lib/guice:guice-servlet', - '//lib:servlet-api-3_1', - ], - visibility = ['PUBLIC'], -) - -java_library( - name = 'api', - srcs = glob([SRC + '**/*.java']), - deps = [ - '//gerrit-common:annotations', - ], - provided_deps = [ - '//lib:guava', - '//lib/guice:guice', - '//lib/guice:guice-assistedinject', - ], - visibility = ['PUBLIC'], -) - -java_sources( - name = 'extension-api-src', - srcs = SRCS, - visibility = ['PUBLIC'], -) - -java_test( - name = 'api_tests', - srcs = glob(['src/test/java/**/*Test.java']), - deps = [ - ':api', - '//gerrit-test-util:test_util', - '//lib:truth', - '//lib/guice:guice', - ], -) - -java_doc( - name = 'extension-api-javadoc', - title = 'Gerrit Review Extension API Documentation', - pkgs = ['com.google.gerrit.extensions'], - source_jar = ':extension-api-src', - srcs = SRCS, - deps = [ - '//lib:guava', - '//lib/guice:javax-inject', - '//lib/guice:guice_library', - '//lib/guice:guice-assistedinject', - '//lib/jgit/org.eclipse.jgit:jgit', - '//gerrit-common:annotations', - ], - visibility = ['PUBLIC'], - external_docs = [JGIT_DOC_URL, GUAVA_DOC_URL], -) diff --git a/gerrit-gpg/BUCK b/gerrit-gpg/BUCK deleted file mode 100644 index fe93bf8338..0000000000 --- a/gerrit-gpg/BUCK +++ /dev/null @@ -1,56 +0,0 @@ -DEPS = [ - '//gerrit-common:server', - '//gerrit-extension-api:api', - '//gerrit-reviewdb:server', - '//gerrit-server:server', - '//lib:guava', - '//lib:gwtorm', - '//lib/guice:guice', - '//lib/guice:guice-assistedinject', - '//lib/guice:guice-servlet', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/log:api', -] - -java_library( - name = 'gpg', - srcs = glob(['src/main/java/**/*.java']), - provided_deps = DEPS + [ - '//lib/bouncycastle:bcpg', - '//lib/bouncycastle:bcprov', - ], - visibility = ['PUBLIC'], -) - -TESTUTIL_SRCS = glob(['src/test/**/testutil/**/*.java']) - -java_library( - name = 'testutil', - srcs = TESTUTIL_SRCS, - deps = DEPS + [ - ':gpg', - '//lib/bouncycastle:bcpg', - '//lib/bouncycastle:bcprov', - ], - visibility = ['PUBLIC'], -) - -java_test( - name = 'gpg_tests', - srcs = glob( - ['src/test/java/**/*.java'], - excludes = TESTUTIL_SRCS, - ), - deps = DEPS + [ - ':gpg', - ':testutil', - '//gerrit-cache-h2:cache-h2', - '//gerrit-lucene:lucene', - '//gerrit-server:testutil', - '//lib:truth', - '//lib/bouncycastle:bcpg', - '//lib/bouncycastle:bcprov', - '//lib/jgit/org.eclipse.jgit.junit:junit', - ], - visibility = ['//tools/eclipse:classpath'], -) diff --git a/gerrit-gwtdebug/BUCK b/gerrit-gwtdebug/BUCK deleted file mode 100644 index 36709160c5..0000000000 --- a/gerrit-gwtdebug/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -java_library( - name = 'gwtdebug', - srcs = glob(['src/main/java/**/*.java']), - deps = [ - '//gerrit-pgm:daemon', - '//gerrit-pgm:pgm', - '//gerrit-pgm:util', - '//gerrit-util-cli:cli', - '//lib/gwt:dev', - '//lib/jetty:server', - '//lib/jetty:servlet', - '//lib/jetty:servlets', - '//lib/log:api', - '//lib/log:log4j', - ], - visibility = ['//tools/eclipse:classpath'], -) diff --git a/gerrit-gwtexpui/BUCK b/gerrit-gwtexpui/BUCK deleted file mode 100644 index 23db13f809..0000000000 --- a/gerrit-gwtexpui/BUCK +++ /dev/null @@ -1,113 +0,0 @@ -SRC = 'src/main/java/com/google/gwtexpui/' - -gwt_module( - name = 'Clippy', - srcs = glob([SRC + 'clippy/client/*.java']), - gwt_xml = SRC + 'clippy/Clippy.gwt.xml', - resources = [ - SRC + 'clippy/client/clippy.css', - SRC + 'clippy/client/clippy.swf', - SRC + 'clippy/client/page_white_copy.png', - SRC + 'clippy/client/CopyableLabelText.properties', - ], - provided_deps = ['//lib/gwt:user'], - deps = [ - ':SafeHtml', - ':UserAgent', - '//lib:LICENSE-clippy', - '//lib:LICENSE-silk_icons', - ], - visibility = ['PUBLIC'], -) - -java_library( - name = 'CSS', - srcs = glob([SRC + 'css/rebind/*.java']), - resources = [SRC + 'css/CSS.gwt.xml'], - provided_deps = ['//lib/gwt:dev'], - visibility = ['PUBLIC'], -) - -gwt_module( - name = 'GlobalKey', - srcs = glob([SRC + 'globalkey/client/*.java']), - gwt_xml = SRC + 'globalkey/GlobalKey.gwt.xml', - resources = [ - SRC + 'globalkey/client/KeyConstants.properties', - SRC + 'globalkey/client/key.css', - ], - provided_deps = ['//lib/gwt:user'], - deps = [ - ':SafeHtml', - ':UserAgent', - ], - visibility = ['PUBLIC'], -) - -java_library( - name = 'linker_server', - srcs = glob([SRC + 'linker/server/*.java']), - provided_deps = ['//lib:servlet-api-3_1'], - visibility = ['PUBLIC'], -) - -gwt_module( - name = 'Progress', - srcs = glob([SRC + 'progress/client/*.java']), - gwt_xml = SRC + 'progress/Progress.gwt.xml', - resources = [SRC + 'progress/client/progress.css'], - provided_deps = ['//lib/gwt:user'], - visibility = ['PUBLIC'], -) - -gwt_module( - name = 'SafeHtml', - srcs = glob([SRC + 'safehtml/client/*.java']), - gwt_xml = SRC + 'safehtml/SafeHtml.gwt.xml', - resources = [SRC + 'safehtml/client/safehtml.css'], - provided_deps = ['//lib/gwt:user'], - visibility = ['PUBLIC'], -) - -java_test( - name = 'SafeHtml_tests', - srcs = glob([ - 'src/test/java/com/google/gwtexpui/safehtml/client/**/*.java', - ]), - deps = [ - ':SafeHtml', - '//lib:truth', - '//lib/gwt:user', - '//lib/gwt:dev', - ], -) - -gwt_module( - name = 'UserAgent', - srcs = glob([SRC + 'user/client/*.java']), - gwt_xml = SRC + 'user/User.gwt.xml', - resources = [SRC + 'user/client/tooltip.css'], - provided_deps = ['//lib/gwt:user'], - visibility = ['PUBLIC'], -) - -java_library( - name = 'server', - srcs = glob([SRC + 'server/*.java']), - provided_deps = ['//lib:servlet-api-3_1'], - visibility = ['PUBLIC'], -) - -java_library( - name = 'client-src-lib', - srcs = [], - resources = glob( - [SRC + n for n in [ - 'clippy/**/*', - 'globalkey/**/*', - 'safehtml/**/*', - 'user/**/*', - ]] - ), - visibility = ['PUBLIC'], -) diff --git a/gerrit-gwtui-common/BUCK b/gerrit-gwtui-common/BUCK deleted file mode 100644 index 729b7e783a..0000000000 --- a/gerrit-gwtui-common/BUCK +++ /dev/null @@ -1,59 +0,0 @@ -EXPORTED_DEPS = [ - '//gerrit-common:client', - '//gerrit-gwtexpui:Clippy', - '//gerrit-gwtexpui:GlobalKey', - '//gerrit-gwtexpui:Progress', - '//gerrit-gwtexpui:SafeHtml', - '//gerrit-gwtexpui:UserAgent', -] -DEPS = ['//lib/gwt:user'] -SRC = 'src/main/java/com/google/gerrit/' - -gwt_module( - name = 'client', - srcs = glob([SRC + 'client/**/*.java']), - gwt_xml = SRC + 'GerritGwtUICommon.gwt.xml', - resources = glob(['src/main/**/*']), - exported_deps = EXPORTED_DEPS, - provided_deps = DEPS, - visibility = ['PUBLIC'], -) - -java_library( - name = 'client-lib', - srcs = glob(['src/main/**/*.java']), - resources = glob(['src/main/**/*']), - exported_deps = EXPORTED_DEPS, - provided_deps = DEPS, - visibility = ['PUBLIC'], -) - -java_library( - name = 'client-src-lib', - srcs = [], - resources = glob(['src/main/**/*']), - visibility = ['PUBLIC'], -) - -java_library( - name = 'diffy_logo', - resources = glob(['src/main/resources/com/google/gerrit/client/diffy*.png']), - deps = [ - '//lib:LICENSE-diffy', - '//lib:LICENSE-CC-BY3.0-unported', - ], - visibility = ['PUBLIC'], -) - -java_test( - name = 'client_tests', - srcs = glob(['src/test/java/**/*.java']), - deps = [ - ':client', - '//lib:junit', - '//lib/gwt:user', - '//lib/jgit/org.eclipse.jgit:jgit', - ], - vm_args = ['-Xmx512m'], - visibility = ['//tools/eclipse:classpath'], -) diff --git a/gerrit-gwtui/BUCK b/gerrit-gwtui/BUCK deleted file mode 100644 index 63d52b09dc..0000000000 --- a/gerrit-gwtui/BUCK +++ /dev/null @@ -1,66 +0,0 @@ -include_defs('//gerrit-gwtui/gwt.defs') -include_defs('//tools/gwt-constants.defs') - -DEPS = GWT_TRANSITIVE_DEPS + [ - '//gerrit-gwtexpui:CSS', - '//lib:gwtjsonrpc', - '//lib/gwt:dev', -] - -gwt_genrule(MODULE, DEPS) -gwt_genrule(MODULE, DEPS, '_r') - -gwt_user_agent_permutations( - name = 'ui', - module_name = 'gerrit_ui', - modules = [MODULE], - module_deps = [':ui_module'], - deps = DEPS, - visibility = ['//:'], -) - -def gen_ui_module(name, suffix = ""): - gwt_module( - name = name + suffix, - srcs = glob(['src/main/java/**/*.java']), - gwt_xml = 'src/main/java/%s.gwt.xml' % MODULE.replace('.', '/'), - resources = glob(['src/main/java/**/*']), - deps = [ - ':silk_icons', - '//gerrit-gwtui-common:diffy_logo', - '//gerrit-gwtui-common:client', - '//gerrit-gwtexpui:CSS', - '//lib/codemirror:codemirror' + suffix, - '//lib/gwt:user', - ], - visibility = [ - '//tools/eclipse:classpath', - '//Documentation:licenses.txt', - '//Documentation:js_licenses.txt', - ], - ) - -gen_ui_module(name = 'ui_module') -gen_ui_module(name = 'ui_module', suffix = '_r') - -java_library( - name = 'silk_icons', - deps = [ - '//lib:LICENSE-silk_icons', - ], -) - -java_test( - name = 'ui_tests', - srcs = glob(['src/test/java/**/*.java']), - deps = [ - ':ui_module', - '//gerrit-common:client', - '//gerrit-extension-api:client', - '//lib:junit', - '//lib/gwt:dev', - '//lib/gwt:user', - ], - vm_args = ['-Xmx512m'], - visibility = ['//tools/eclipse:classpath'], -) diff --git a/gerrit-gwtui/gwt.defs b/gerrit-gwtui/gwt.defs deleted file mode 100644 index 85553f2986..0000000000 --- a/gerrit-gwtui/gwt.defs +++ /dev/null @@ -1,141 +0,0 @@ -# Copyright (C) 2013 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -from multiprocessing import cpu_count - -BROWSERS = [ - 'chrome', - 'firefox', - 'gecko1_8', - 'safari', - 'msie', 'ie8', 'ie9', 'ie10', - 'edge', -] -ALIASES = { - 'chrome': 'safari', - 'firefox': 'gecko1_8', - 'msie': 'ie10', - 'edge': 'gecko1_8', -} -MODULE = 'com.google.gerrit.GerritGwtUI' -CPU_COUNT = cpu_count() - -def gwt_genrule(module, deps, suffix = ""): - dbg = 'ui_dbg' + suffix - opt = 'ui_opt' + suffix - soyc = 'ui_soyc' + suffix - module_dep = ':ui_module' + suffix - args = GWT_COMPILER_ARGS_RELEASE_MODE if suffix == "_r" else GWT_COMPILER_ARGS - - genrule( - name = 'ui_optdbg' + suffix, - cmd = 'cd $TMP;' + - 'unzip -q $(location :%s);' % dbg + - 'mv' + - ' gerrit_ui/gerrit_ui.nocache.js' + - ' gerrit_ui/dbg_gerrit_ui.nocache.js;' + - 'unzip -qo $(location :%s);' % opt + - 'mkdir -p \$(dirname $OUT);' + - 'zip -qr $OUT .', - out = 'ui_optdbg' + suffix + '.zip', - visibility = ['PUBLIC'], - ) - - gwt_binary( - name = opt, - modules = [module], - module_deps = [module_dep], - deps = deps + ([':' + dbg] if CPU_COUNT < 8 else []), - local_workers = CPU_COUNT, - strict = True, - experimental_args = args, - vm_args = GWT_JVM_ARGS, - ) - - gwt_binary( - name = dbg, - modules = [module], - style = 'PRETTY', - optimize = 0, - module_deps = [module_dep], - deps = deps, - local_workers = CPU_COUNT, - strict = True, - experimental_args = args, - vm_args = GWT_JVM_ARGS, - visibility = ['PUBLIC'], - ) - - gwt_binary( - name = soyc, - modules = [module], - module_deps = [module_dep], - deps = deps + [':' + dbg], - local_workers = CPU_COUNT, - strict = True, - experimental_args = args + ['-compileReport'], - vm_args = GWT_JVM_ARGS, - ) - -def gwt_user_agent_permutations( - name, - module_name, - modules, - style = 'PRETTY', - optimize = 0, - draft_compile = True, - module_deps = [], - deps = [], - browsers = BROWSERS, - visibility = []): - for ua in browsers: - impl = ua - if ua in ALIASES: - impl = ALIASES[ua] - xml = ''.join([ - "" % module_name, - "" % modules[0], - "" % impl, - "", - "", - ]) - gwt = '%s_%s.gwt.xml' % (modules[0].replace('.', '/'), ua) - gwt_name = '%s_%s' % (name, ua) - jar = '%s.gwtxml.jar' % (gwt_name) - - genrule( - name = '%s_gwtxml_gen' % gwt_name, - cmd = 'cd $TMP;' + - ('mkdir -p \$(dirname %s);' % gwt) + - ('echo "%s">%s;' % (xml, gwt)) + - 'zip -qr $OUT .', - out = jar, - ) - prebuilt_jar( - name = '%s_gwtxml_lib' % gwt_name, - binary_jar = ':%s_gwtxml_gen' % gwt_name, - ) - gwt_binary( - name = gwt_name, - modules = [modules[0] + '_' + ua], - style = style, - optimize = optimize, - draft_compile = draft_compile, - module_deps = module_deps + [':%s_gwtxml_lib' % gwt_name], - deps = deps, - local_workers = CPU_COUNT, - strict = True, - experimental_args = GWT_COMPILER_ARGS, - vm_args = GWT_JVM_ARGS, - visibility = visibility, - ) diff --git a/gerrit-httpd/BUCK b/gerrit-httpd/BUCK deleted file mode 100644 index 0b0499c52a..0000000000 --- a/gerrit-httpd/BUCK +++ /dev/null @@ -1,78 +0,0 @@ -SRCS = glob( - ['src/main/java/**/*.java'], -) -RESOURCES = glob(['src/main/resources/**/*']) - -java_library( - name = 'httpd', - srcs = SRCS, - resources = RESOURCES, - deps = [ - '//gerrit-antlr:query_exception', - '//gerrit-common:annotations', - '//gerrit-common:server', - '//gerrit-extension-api:api', - '//gerrit-gwtexpui:linker_server', - '//gerrit-gwtexpui:server', - '//gerrit-launcher:launcher', - '//gerrit-patch-jgit:server', - '//gerrit-prettify:server', - '//gerrit-reviewdb:server', - '//gerrit-server:server', - '//gerrit-util-cli:cli', - '//gerrit-util-http:http', - '//lib:args4j', - '//lib:gson', - '//lib:guava', - '//lib:gwtjsonrpc', - '//lib:gwtorm', - '//lib:jsch', - '//lib:mime-util', - '//lib/auto:auto-value', - '//lib/commons:codec', - '//lib/guice:guice', - '//lib/guice:guice-assistedinject', - '//lib/guice:guice-servlet', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/jgit/org.eclipse.jgit.http.server:jgit-servlet', - '//lib/log:api', - '//lib/lucene:lucene-core-and-backward-codecs', - ], - provided_deps = ['//lib:servlet-api-3_1'], - visibility = ['PUBLIC'], -) - -java_sources( - name = 'httpd-src', - srcs = SRCS + RESOURCES, - visibility = ['PUBLIC'], -) - -java_test( - name = 'httpd_tests', - srcs = glob(['src/test/java/**/*.java']), - deps = [ - ':httpd', - '//gerrit-common:server', - '//gerrit-extension-api:api', - '//gerrit-reviewdb:server', - '//gerrit-server:server', - '//gerrit-util-http:http', - '//gerrit-util-http:testutil', - '//lib:jimfs', - '//lib:junit', - '//lib:gson', - '//lib:gwtorm', - '//lib:guava', - '//lib:servlet-api-3_1', - '//lib:truth', - '//lib/easymock:easymock', - '//lib/guice:guice', - '//lib/guice:guice-servlet', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/jgit/org.eclipse.jgit.junit:junit', - '//lib/joda:joda-time', - ], - # TODO(sop) Remove after Buck supports Eclipse - visibility = ['//tools/eclipse:classpath'], -) diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/BazelBuild.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/BazelBuild.java index 594d209eb2..966a2fbe5c 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/BazelBuild.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/BazelBuild.java @@ -29,8 +29,8 @@ public class BazelBuild extends BuildSystem { protected ProcessBuilder newBuildProcess(Label label) throws IOException { Properties properties = loadBuildProperties( sourceRoot.resolve(".primary_build_tool")); - String buck = firstNonNull(properties.getProperty("bazel"), "bazel"); - ProcessBuilder proc = new ProcessBuilder(buck, "build", label.fullName()); + String bazel = firstNonNull(properties.getProperty("bazel"), "bazel"); + ProcessBuilder proc = new ProcessBuilder(bazel, "build", label.fullName()); if (properties.containsKey("PATH")) { proc.environment().put("PATH", properties.getProperty("PATH")); } diff --git a/gerrit-launcher/BUCK b/gerrit-launcher/BUCK deleted file mode 100644 index 5be25fa43f..0000000000 --- a/gerrit-launcher/BUCK +++ /dev/null @@ -1,13 +0,0 @@ -# NOTE: GerritLauncher must be a single, self-contained class. Do not add any -# additional srcs or deps to this rule. -java_library( - name = 'launcher', - srcs = ['src/main/java/com/google/gerrit/launcher/GerritLauncher.java'], - visibility = [ - '//gerrit-acceptance-framework/...', - '//gerrit-acceptance-tests/...', - '//gerrit-httpd:', - '//gerrit-main:main_lib', - '//gerrit-pgm:', - ], -) diff --git a/gerrit-launcher/src/main/java/com/google/gerrit/launcher/GerritLauncher.java b/gerrit-launcher/src/main/java/com/google/gerrit/launcher/GerritLauncher.java index a865ffa06a..5d023c0e4c 100644 --- a/gerrit-launcher/src/main/java/com/google/gerrit/launcher/GerritLauncher.java +++ b/gerrit-launcher/src/main/java/com/google/gerrit/launcher/GerritLauncher.java @@ -710,8 +710,7 @@ public final class GerritLauncher { // Pop up to the top-level source folder by looking for .buckconfig. Path dir = Paths.get(u.getPath()); - while (!Files.isRegularFile(dir.resolve(".buckconfig")) - && !Files.isRegularFile(dir.resolve("WORKSPACE"))) { + while (!Files.isRegularFile(dir.resolve("WORKSPACE"))) { Path parent = dir.getParent(); if (parent == null) { throw new FileNotFoundException("Cannot find source root from " + u); diff --git a/gerrit-lucene/BUCK b/gerrit-lucene/BUCK deleted file mode 100644 index 771a02171a..0000000000 --- a/gerrit-lucene/BUCK +++ /dev/null @@ -1,41 +0,0 @@ -QUERY_BUILDER = [ - 'src/main/java/com/google/gerrit/lucene/QueryBuilder.java', -] - -java_library( - name = 'query_builder', - srcs = QUERY_BUILDER, - deps = [ - '//gerrit-antlr:query_exception', - '//gerrit-reviewdb:server', - '//gerrit-server:server', - '//lib:gwtorm', - '//lib:guava', - '//lib/lucene:lucene-core-and-backward-codecs', - ], - visibility = ['PUBLIC'], -) - -java_library( - name = 'lucene', - srcs = glob(['src/main/java/**/*.java'], excludes = QUERY_BUILDER), - deps = [ - ':query_builder', - '//gerrit-antlr:query_exception', - '//gerrit-common:annotations', - '//gerrit-common:server', - '//gerrit-extension-api:api', - '//gerrit-reviewdb:server', - '//gerrit-server:server', - '//lib:guava', - '//lib:gwtorm', - '//lib/guice:guice', - '//lib/guice:guice-assistedinject', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/log:api', - '//lib/lucene:lucene-analyzers-common', - '//lib/lucene:lucene-core-and-backward-codecs', - '//lib/lucene:lucene-misc', - ], - visibility = ['PUBLIC'], -) diff --git a/gerrit-main/BUCK b/gerrit-main/BUCK deleted file mode 100644 index da39eec062..0000000000 --- a/gerrit-main/BUCK +++ /dev/null @@ -1,13 +0,0 @@ -java_binary( - name = 'main_bin', - main_class = 'Main', - deps = [':main_lib'], - visibility = ['PUBLIC'], -) - -java_library( - name = 'main_lib', - srcs = ['src/main/java/Main.java'], - deps = ['//gerrit-launcher:launcher'], - visibility = ['//tools/eclipse:classpath'], -) diff --git a/gerrit-oauth/BUCK b/gerrit-oauth/BUCK deleted file mode 100644 index fa5a8e2cb1..0000000000 --- a/gerrit-oauth/BUCK +++ /dev/null @@ -1,26 +0,0 @@ -SRCS = glob( - ['src/main/java/**/*.java'], -) -RESOURCES = glob(['src/main/resources/**/*']) - -java_library( - name = 'oauth', - srcs = SRCS, - resources = RESOURCES, - deps = [ - '//gerrit-common:annotations', - '//gerrit-extension-api:api', - '//gerrit-httpd:httpd', - '//gerrit-reviewdb:server', - '//gerrit-server:server', - '//lib:gson', - '//lib:guava', - '//lib:gwtorm', - '//lib/commons:codec', - '//lib/guice:guice', - '//lib/guice:guice-servlet', - '//lib/log:api', - ], - provided_deps = ['//lib:servlet-api-3_1'], - visibility = ['PUBLIC'], -) diff --git a/gerrit-openid/BUCK b/gerrit-openid/BUCK deleted file mode 100644 index 5eace7b6dd..0000000000 --- a/gerrit-openid/BUCK +++ /dev/null @@ -1,26 +0,0 @@ -java_library( - name = 'openid', - srcs = glob(['src/main/java/**/*.java']), - resources = glob(['src/main/resources/**/*']), - deps = [ - '//lib/openid:consumer', - ], - provided_deps = [ - '//gerrit-common:annotations', - '//gerrit-common:server', - '//gerrit-extension-api:api', - '//gerrit-gwtexpui:server', - '//gerrit-httpd:httpd', - '//gerrit-reviewdb:server', - '//gerrit-server:server', - '//lib:guava', - '//lib:gwtorm', - '//lib:servlet-api-3_1', - '//lib/commons:codec', - '//lib/guice:guice', - '//lib/guice:guice-servlet', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/log:api', - ], - visibility = ['PUBLIC'], -) diff --git a/gerrit-patch-commonsnet/BUCK b/gerrit-patch-commonsnet/BUCK deleted file mode 100644 index 53b382f8ea..0000000000 --- a/gerrit-patch-commonsnet/BUCK +++ /dev/null @@ -1,11 +0,0 @@ -java_library( - name = 'commons-net', - srcs = glob(['src/main/java/org/apache/commons/net/**/*.java']), - deps = [ - '//gerrit-util-ssl:ssl', - '//lib/commons:codec', - '//lib/commons:net', - '//lib/log:api', - ], - visibility = ['PUBLIC'], -) diff --git a/gerrit-patch-jgit/BUCK b/gerrit-patch-jgit/BUCK deleted file mode 100644 index 4a4929e58f..0000000000 --- a/gerrit-patch-jgit/BUCK +++ /dev/null @@ -1,65 +0,0 @@ -SRC = 'src/main/java/org/eclipse/jgit/' - -gwt_module( - name = 'client', - srcs = [ - SRC + 'diff/Edit_JsonSerializer.java', - SRC + 'diff/ReplaceEdit.java', - ], - gwt_xml = SRC + 'JGit.gwt.xml', - deps = [ - '//lib:gwtjsonrpc', - ':Edit', - ], - provided_deps = ['//lib/gwt:user'], - visibility = ['PUBLIC'], -) - -gwt_module( - name = 'Edit', - srcs = [':jgit_edit_src'], - deps = [':edit_src'], - visibility = ['PUBLIC'], -) - -prebuilt_jar( - name = 'edit_src', - binary_jar = ':jgit_edit_src', -) - -genrule( - name = 'jgit_edit_src', - cmd = 'unzip -qd $TMP $(location //lib/jgit/org.eclipse.jgit:jgit_src) ' + - 'org/eclipse/jgit/diff/Edit.java;' + - 'cd $TMP;' + - 'zip -Dq $OUT org/eclipse/jgit/diff/Edit.java', - out = 'edit-sources.jar', -) - -java_library( - name = 'server', - srcs = [ - SRC + x for x in [ - 'diff/EditDeserializer.java', - 'diff/ReplaceEdit.java', - 'internal/storage/file/WindowCacheStatAccessor.java', - 'lib/ObjectIdSerialization.java', - ] - ], - deps = [ - '//lib:gson', - '//lib/jgit/org.eclipse.jgit:jgit', - ], - visibility = ['PUBLIC'], -) - -java_test( - name = 'jgit_patch_tests', - srcs = glob(['src/test/java/**/*.java']), - deps = [ - ':server', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib:junit', - ], - visibility = ['//tools/eclipse:classpath'], -) diff --git a/gerrit-pgm/BUCK b/gerrit-pgm/BUCK deleted file mode 100644 index a9c568daa5..0000000000 --- a/gerrit-pgm/BUCK +++ /dev/null @@ -1,185 +0,0 @@ -SRCS = 'src/main/java/com/google/gerrit/pgm/' -RSRCS = 'src/main/resources/com/google/gerrit/pgm/' - -INIT_API_SRCS = glob([SRCS + 'init/api/*.java']) - -BASE_JETTY_DEPS = [ - '//gerrit-common:server', - '//gerrit-extension-api:api', - '//gerrit-gwtexpui:linker_server', - '//gerrit-gwtexpui:server', - '//gerrit-httpd:httpd', - '//gerrit-server:server', - '//gerrit-sshd:sshd', - '//lib:guava', - '//lib/guice:guice', - '//lib/guice:guice-assistedinject', - '//lib/guice:guice-servlet', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/joda:joda-time', - '//lib/log:api', - '//lib/log:log4j', -] - -DEPS = BASE_JETTY_DEPS + [ - '//gerrit-reviewdb:server', - '//lib/log:jsonevent-layout', -] - -java_library( - name = 'init-api', - srcs = INIT_API_SRCS, - deps = DEPS + ['//gerrit-common:annotations'], - visibility = ['PUBLIC'], -) - -java_sources( - name = 'init-api-src', - srcs = INIT_API_SRCS, - visibility = ['PUBLIC'], -) - -java_library( - name = 'init', - srcs = glob([SRCS + 'init/**/*.java']), - resources = glob([RSRCS + 'init/*']), - deps = DEPS + [ - ':init-api', - ':util', - '//gerrit-common:annotations', - '//gerrit-elasticsearch:elasticsearch', - '//gerrit-lucene:lucene', - '//lib:args4j', - '//lib:derby', - '//lib:gwtjsonrpc', - '//lib:gwtorm', - '//lib:h2', - '//lib/commons:validator', - '//lib/mina:sshd', - ], - provided_deps = ['//gerrit-launcher:launcher'], - visibility = [ - '//gerrit-acceptance-framework/...', - '//gerrit-acceptance-tests/...', - '//gerrit-war:', - ], -) - -REST_UTIL_DEPS = [ - '//gerrit-cache-h2:cache-h2', - '//gerrit-elasticsearch:elasticsearch', - '//gerrit-util-cli:cli', - '//lib:args4j', - '//lib:gwtorm', - '//lib/commons:dbcp', -] - -java_library( - name = 'util', - deps = DEPS + REST_UTIL_DEPS, - exported_deps = [':util-nodep'], - visibility = [ - '//gerrit-acceptance-tests/...', - '//gerrit-gwtdebug:gwtdebug', - '//gerrit-war:', - ], -) - -java_library( - name = 'util-nodep', - srcs = glob([SRCS + 'util/*.java']), - provided_deps = DEPS + REST_UTIL_DEPS, - visibility = ['//gerrit-acceptance-framework/...'], -) - -JETTY_DEPS = [ - '//lib/jetty:jmx', - '//lib/jetty:server', - '//lib/jetty:servlet', -] - -java_library( - name = 'http', - deps = DEPS + JETTY_DEPS, - exported_deps = [':http-jetty'], - visibility = ['//gerrit-war:'], -) - -java_library( - name = 'http-jetty', - srcs = glob([SRCS + 'http/jetty/*.java']), - provided_deps = JETTY_DEPS + BASE_JETTY_DEPS + [ - '//gerrit-launcher:launcher', - '//gerrit-reviewdb:client', - '//lib:servlet-api-3_1', - ], - visibility = ['//gerrit-acceptance-framework/...'], -) - -REST_PGM_DEPS = [ - ':http', - ':init', - ':init-api', - ':util', - '//gerrit-cache-h2:cache-h2', - '//gerrit-elasticsearch:elasticsearch', - '//gerrit-gpg:gpg', - '//gerrit-lucene:lucene', - '//gerrit-oauth:oauth', - '//gerrit-openid:openid', - '//lib:args4j', - '//lib:gwtorm', - '//lib:protobuf', - '//lib:servlet-api-3_1', - '//lib/prolog:cafeteria', - '//lib/prolog:compiler', - '//lib/prolog:runtime', -] - -java_library( - name = 'pgm', - resources = glob([RSRCS + '*']), - deps = DEPS + REST_PGM_DEPS + [ - ':daemon', - ], - visibility = [ - '//:', - '//gerrit-acceptance-tests/...', - '//gerrit-gwtdebug:gwtdebug', - '//tools/eclipse:classpath', - '//Documentation:licenses.txt', - ], -) - -# no transitive deps, used for gerrit-acceptance-framework -java_library( - name = 'daemon', - srcs = glob([SRCS + '*.java', SRCS + 'rules/*.java']), - resources = glob([RSRCS + '*']), - deps = ['//lib/auto:auto-value'], - provided_deps = DEPS + REST_PGM_DEPS + [ - '//gerrit-launcher:launcher', - ], - visibility = [ - '//gerrit-acceptance-framework/...', - '//gerrit-gwtdebug:gwtdebug', - ], -) - -java_test( - name = 'pgm_tests', - srcs = glob(['src/test/java/**/*.java']), - deps = [ - ':init', - ':init-api', - ':pgm', - '//gerrit-common:server', - '//gerrit-server:server', - '//lib:guava', - '//lib:junit', - '//lib/easymock:easymock', - '//lib/guice:guice', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/jgit/org.eclipse.jgit.junit:junit', - ], -) diff --git a/gerrit-plugin-api/BUCK b/gerrit-plugin-api/BUCK deleted file mode 100644 index fc17d0d91c..0000000000 --- a/gerrit-plugin-api/BUCK +++ /dev/null @@ -1,99 +0,0 @@ -SRCS = [ - 'gerrit-server/src/main/java/', - 'gerrit-httpd/src/main/java/', - 'gerrit-sshd/src/main/java/', -] - -PLUGIN_API = [ - '//gerrit-httpd:httpd', - '//gerrit-pgm:init-api', - '//gerrit-server:server', - '//gerrit-sshd:sshd', -] - -java_binary( - name = 'plugin-api', - merge_manifests = False, - manifest_file = ':manifest', - deps = [':lib'], - visibility = ['PUBLIC'], -) - -genrule( - name = 'manifest', - cmd = 'echo "Manifest-Version: 1.0" >$OUT;' + - 'echo "Implementation-Title: Gerrit Plugin API" >>$OUT;' + - 'echo "Implementation-Vendor: Gerrit Code Review Project" >>$OUT', - out = 'manifest.txt', -) - -java_library( - name = 'lib', - exported_deps = PLUGIN_API + [ - '//gerrit-antlr:query_exception', - '//gerrit-antlr:query_parser', - '//gerrit-common:annotations', - '//gerrit-common:server', - '//gerrit-extension-api:api', - '//gerrit-gwtexpui:server', - '//gerrit-reviewdb:server', - '//lib:args4j', - '//lib:blame-cache', - '//lib:gson', - '//lib:guava', - '//lib:gwtorm', - '//lib:icu4j', - '//lib:jsch', - '//lib:jsr305', - '//lib:mime-util', - '//lib:protobuf', - '//lib:servlet-api-3_1', - '//lib:soy', - '//lib:velocity', - '//lib/commons:lang', - '//lib/dropwizard:dropwizard-core', - '//lib/guice:guice', - '//lib/guice:guice-assistedinject', - '//lib/guice:javax-inject', - '//lib/guice:multibindings', - '//lib/guice:guice-servlet', - "//lib/httpcomponents:httpclient", - "//lib/httpcomponents:httpcore", - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/jgit/org.eclipse.jgit.http.server:jgit-servlet', - '//lib/joda:joda-time', - '//lib/log:api', - '//lib/log:log4j', - '//lib/mina:sshd', - '//lib/ow2:ow2-asm', - '//lib/ow2:ow2-asm-analysis', - '//lib/ow2:ow2-asm-commons', - '//lib/ow2:ow2-asm-util', - '//lib/prolog:compiler', - '//lib/prolog:runtime', - ], - visibility = ['PUBLIC'], -) - -java_binary( - name = 'plugin-api-src', - deps = [ - '//gerrit-extension-api:extension-api-src', - ] + [d + '-src' for d in PLUGIN_API], - visibility = ['PUBLIC'], -) - -java_doc( - name = 'plugin-api-javadoc', - title = 'Gerrit Review Plugin API Documentation', - pkgs = ['com.google.gerrit'], - source_jar = ':plugin-api-src', - srcs = glob([n + '**/*.java' for n in SRCS]), - deps = [ - ':plugin-api', - '//lib/bouncycastle:bcprov', - '//lib/bouncycastle:bcpg', - '//lib/bouncycastle:bcpkix', - ], - visibility = ['PUBLIC'], -) diff --git a/gerrit-plugin-gwtui/BUCK b/gerrit-plugin-gwtui/BUCK deleted file mode 100644 index 575ebfcb0d..0000000000 --- a/gerrit-plugin-gwtui/BUCK +++ /dev/null @@ -1,60 +0,0 @@ -SRCS = glob(['src/main/java/com/google/gerrit/**/*.java']) -DEPS = ['//lib/gwt:user'] - -java_binary( - name = 'gwtui-api', - deps = [ - ':gwtui-api-lib', - '//gerrit-gwtui-common:client-lib', - ], - visibility = ['PUBLIC'], -) - -java_library( - name = 'gwtui-api-lib', - srcs = SRCS, - resources = glob(['src/main/**/*']), - exported_deps = ['//gerrit-gwtui-common:client-lib'], - provided_deps = DEPS + ['//lib/gwt:dev'], - visibility = ['PUBLIC'], -) - -java_binary( - name = 'gwtui-api-src', - deps = [ - ':gwtui-api-src-lib', - '//gerrit-gwtexpui:client-src-lib', - '//gerrit-gwtui-common:client-src-lib', - ], - visibility = ['PUBLIC'], -) - -java_library( - name = 'gwtui-api-src-lib', - srcs = [], - resources = glob(['src/main/**/*']), - visibility = ['PUBLIC'], -) - -java_doc( - name = 'gwtui-api-javadoc', - title = 'Gerrit Review GWT Extension API Documentation', - pkgs = [ - 'com.google.gerrit', - 'com.google.gwtexpui.clippy', - 'com.google.gwtexpui.globalkey', - 'com.google.gwtexpui.safehtml', - 'com.google.gwtexpui.user', - ], - source_jar = ':gwtui-api-src', - srcs = SRCS, - deps = DEPS + [ - '//lib:gwtjsonrpc', - '//lib:gwtorm_client', - '//lib/gwt:dev', - '//gerrit-gwtui-common:client-lib', - '//gerrit-common:client', - '//gerrit-reviewdb:client', - ], - visibility = ['PUBLIC'], -) diff --git a/gerrit-prettify/BUCK b/gerrit-prettify/BUCK deleted file mode 100644 index bf2e02afd5..0000000000 --- a/gerrit-prettify/BUCK +++ /dev/null @@ -1,47 +0,0 @@ -SRC = 'src/main/java/com/google/gerrit/prettify/' - -gwt_module( - name = 'client', - srcs = glob([ - SRC + 'common/**/*.java', - ]), - gwt_xml = SRC + 'PrettyFormatter.gwt.xml', - deps = [ - '//gerrit-gwtexpui:SafeHtml', - ], - exported_deps = [ - '//gerrit-extension-api:client', - '//gerrit-patch-jgit:client', - '//gerrit-patch-jgit:Edit', - '//gerrit-reviewdb:client', - '//lib:gwtjsonrpc', - '//lib:gwtjsonrpc_src', - ], - provided_deps = ['//lib/gwt:user'], - visibility = ['PUBLIC'], -) - -java_library( - name = 'server', - srcs = glob([SRC + 'common/**/*.java']), - deps = [ - '//gerrit-patch-jgit:server', - '//gerrit-reviewdb:server', - '//lib:guava', - '//lib:gwtjsonrpc', - '//lib/jgit/org.eclipse.jgit:jgit', - ], - visibility = ['PUBLIC'], -) - -export_file( - name = 'prettify.min.js', - src = 'src/main/resources/com/google/gerrit/prettify/client/prettify.js', - visibility = ['//Documentation:'], -) - -export_file( - name = 'prettify.min.css', - src = 'src/main/resources/com/google/gerrit/prettify/client/prettify.css', - visibility = ['//Documentation:'], -) diff --git a/gerrit-reviewdb/BUCK b/gerrit-reviewdb/BUCK deleted file mode 100644 index 532ce8019e..0000000000 --- a/gerrit-reviewdb/BUCK +++ /dev/null @@ -1,38 +0,0 @@ -SRC = 'src/main/java/com/google/gerrit/reviewdb/' -TESTS = 'src/test/java/com/google/gerrit/reviewdb/' - -gwt_module( - name = 'client', - srcs = glob([SRC + 'client/**/*.java']), - gwt_xml = SRC + 'ReviewDB.gwt.xml', - deps = [ - '//gerrit-extension-api:client', - '//lib:gwtorm_client', - '//lib:gwtorm_client_src' - ], - visibility = ['PUBLIC'], -) - -java_library( - name = 'server', - srcs = glob([SRC + '**/*.java']), - resources = glob(['src/main/resources/**/*']), - deps = [ - '//gerrit-extension-api:api', - '//lib:guava', - '//lib:gwtorm', - ], - visibility = ['PUBLIC'], -) - -java_test( - name = 'client_tests', - srcs = glob([TESTS + 'client/**/*.java']), - deps = [ - ':client', - '//gerrit-server:testutil', - '//lib:gwtorm', - '//lib:truth', - ], - visibility = ['//tools/eclipse:classpath'], -) diff --git a/gerrit-server/BUCK b/gerrit-server/BUCK deleted file mode 100644 index 6fc7c4b82a..0000000000 --- a/gerrit-server/BUCK +++ /dev/null @@ -1,216 +0,0 @@ -CONSTANTS_SRC = [ - 'src/main/java/com/google/gerrit/server/documentation/Constants.java', -] - -SRCS = glob( - ['src/main/java/**/*.java'], - excludes = CONSTANTS_SRC, -) -RESOURCES = glob(['src/main/resources/**/*']) - -java_library( - name = 'constants', - srcs = CONSTANTS_SRC, - visibility = ['PUBLIC'], -) - -# TODO(sop) break up gerrit-server java_library(), its too big -java_library( - name = 'server', - srcs = SRCS, - resources = RESOURCES, - deps = [ - ':constants', - '//gerrit-antlr:query_exception', - '//gerrit-antlr:query_parser', - '//gerrit-common:annotations', - '//gerrit-common:server', - '//gerrit-extension-api:api', - '//gerrit-patch-commonsnet:commons-net', - '//gerrit-patch-jgit:server', - '//gerrit-prettify:server', - '//gerrit-reviewdb:server', - '//gerrit-util-cli:cli', - '//gerrit-util-ssl:ssl', - '//lib:args4j', - '//lib:automaton', - '//lib:blame-cache', - '//lib:grappa', - '//lib:gson', - '//lib:guava', - '//lib:guava-retrying', - '//lib:gwtjsonrpc', - '//lib:gwtorm', - '//lib:jsch', - '//lib:juniversalchardet', - '//lib:mime-util', - '//lib:pegdown', - '//lib:protobuf', - '//lib:soy', - '//lib:tukaani-xz', - '//lib:velocity', - '//lib/antlr:java_runtime', - '//lib/auto:auto-value', - '//lib/commons:codec', - '//lib/commons:compress', - '//lib/commons:dbcp', - '//lib/commons:lang', - '//lib/commons:net', - '//lib/commons:validator', - '//lib/dropwizard:dropwizard-core', - '//lib/guice:guice', - '//lib/guice:guice-assistedinject', - '//lib/guice:guice-servlet', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/jgit/org.eclipse.jgit.archive:jgit-archive', - '//lib/joda:joda-time', - '//lib/jsoup:jsoup', - '//lib/log:api', - '//lib/log:jsonevent-layout', - '//lib/log:log4j', - '//lib/lucene:lucene-analyzers-common', - '//lib/lucene:lucene-core-and-backward-codecs', - '//lib/lucene:lucene-queryparser', - '//lib/mime4j:core', - '//lib/mime4j:dom', - '//lib/ow2:ow2-asm', - '//lib/ow2:ow2-asm-tree', - '//lib/ow2:ow2-asm-util', - '//lib/prolog:runtime', - ], - provided_deps = [ - '//lib:servlet-api-3_1', - ], - visibility = ['PUBLIC'], -) - -java_sources( - name = 'server-src', - srcs = SRCS + RESOURCES, - visibility = ['PUBLIC'], -) - -TESTUTIL_DEPS = [ - ':server', - '//gerrit-common:server', - '//gerrit-cache-h2:cache-h2', - '//gerrit-elasticsearch:elasticsearch', - '//gerrit-extension-api:api', - '//gerrit-gpg:gpg', - '//gerrit-lucene:lucene', - '//gerrit-reviewdb:server', - '//lib:gwtorm', - '//lib:h2', - '//lib:truth', - '//lib/guice:guice', - '//lib/guice:guice-servlet', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/jgit/org.eclipse.jgit.junit:junit', - '//lib/joda:joda-time', - '//lib/log:api', - '//lib/log:impl_log4j', - '//lib/log:log4j', -] - -TESTUTIL = glob([ - 'src/test/java/com/google/gerrit/testutil/**/*.java', - 'src/test/java/com/google/gerrit/server/project/Util.java', - ]) -java_library( - name = 'testutil', - srcs = TESTUTIL, - deps = [ - '//lib/auto:auto-value', - ], - provided_deps = TESTUTIL_DEPS, - exported_deps = [ - '//lib/easymock:easymock', - '//lib/powermock:powermock-api-easymock', - '//lib/powermock:powermock-api-support', - '//lib/powermock:powermock-core', - '//lib/powermock:powermock-module-junit4', - '//lib/powermock:powermock-module-junit4-common', - ], - visibility = ['PUBLIC'], -) - -PROLOG_TEST_CASE = [ - 'src/test/java/com/google/gerrit/rules/PrologTestCase.java', -] -PROLOG_TESTS = glob( - ['src/test/java/com/google/gerrit/rules/**/*.java'], - excludes = PROLOG_TEST_CASE, -) - -java_library( - name = 'prolog_test_case', - srcs = PROLOG_TEST_CASE, - deps = [ - ':server', - ':testutil', - '//gerrit-common:server', - '//gerrit-extension-api:api', - '//lib:guava', - '//lib:junit', - '//lib:truth', - '//lib/guice:guice', - '//lib/prolog:runtime', - ], -) - -java_test( - name = 'prolog_tests', - srcs = PROLOG_TESTS, - resources = glob(['src/test/resources/com/google/gerrit/rules/**/*']), - deps = TESTUTIL_DEPS + [ - ':prolog_test_case', - ':testutil', - '//gerrit-server/src/main/prolog:common', - '//lib/prolog:runtime', - ], -) - -QUERY_TESTS = glob( - ['src/test/java/com/google/gerrit/server/query/**/*.java'], -) - -java_test( - name = 'query_tests', - srcs = QUERY_TESTS, - deps = TESTUTIL_DEPS + [ - ':testutil', - '//gerrit-antlr:query_exception', - '//gerrit-antlr:query_parser', - '//gerrit-common:annotations', - '//gerrit-server/src/main/prolog:common', - '//lib/antlr:java_runtime', - ], - visibility = ['PUBLIC'], -) - -java_test( - name = 'server_tests', - labels = ['server'], - srcs = glob( - ['src/test/java/**/*.java'], - excludes = TESTUTIL + PROLOG_TESTS + PROLOG_TEST_CASE + QUERY_TESTS - ), - resources = glob(['src/test/resources/com/google/gerrit/server/mail/*']), - deps = TESTUTIL_DEPS + [ - ':testutil', - '//gerrit-antlr:query_exception', - '//gerrit-common:annotations', - '//gerrit-patch-jgit:server', - '//gerrit-server/src/main/prolog:common', - '//lib:args4j', - '//lib:grappa', - '//lib:gson', - '//lib:guava', - '//lib:guava-retrying', - '//lib:protobuf', - '//lib/dropwizard:dropwizard-core', - '//lib/guice:guice-assistedinject', - '//lib/prolog:runtime', - ], - visibility = ['//tools/eclipse:classpath'], -) diff --git a/gerrit-server/src/main/prolog/BUCK b/gerrit-server/src/main/prolog/BUCK deleted file mode 100644 index 09a6553558..0000000000 --- a/gerrit-server/src/main/prolog/BUCK +++ /dev/null @@ -1,8 +0,0 @@ -include_defs('//lib/prolog/prolog.defs') - -prolog_cafe_library( - name = 'common', - srcs = ['gerrit_common.pl'], - deps = ['//gerrit-server:server'], - visibility = ['PUBLIC'], -) diff --git a/gerrit-sshd/BUCK b/gerrit-sshd/BUCK deleted file mode 100644 index fcb844fa58..0000000000 --- a/gerrit-sshd/BUCK +++ /dev/null @@ -1,59 +0,0 @@ -SRCS = glob(['src/main/java/**/*.java']) - -java_library( - name = 'sshd', - srcs = SRCS, - deps = [ - '//gerrit-extension-api:api', - '//gerrit-cache-h2:cache-h2', - '//gerrit-common:annotations', - '//gerrit-common:server', - '//gerrit-lucene:lucene', - '//gerrit-patch-jgit:server', - '//gerrit-reviewdb:server', - '//gerrit-server:server', - '//gerrit-util-cli:cli', - '//lib:args4j', - '//lib:gson', - '//lib:guava', - '//lib:gwtorm', - '//lib:jsch', - '//lib/auto:auto-value', - '//lib/commons:codec', - '//lib/dropwizard:dropwizard-core', - '//lib/guice:guice', - '//lib/guice:guice-assistedinject', - '//lib/guice:guice-servlet', # SSH should not depend on servlet - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/jgit/org.eclipse.jgit.archive:jgit-archive', - '//lib/log:api', - '//lib/log:log4j', - '//lib/mina:core', - '//lib/mina:sshd', - ], - provided_deps = [ - '//lib/bouncycastle:bcprov', - '//lib:servlet-api-3_1', - ], - visibility = ['PUBLIC'], -) - -java_sources( - name = 'sshd-src', - srcs = SRCS, - visibility = ['PUBLIC'], -) - -java_test( - name = 'sshd_tests', - srcs = glob( - ['src/test/java/**/*.java'], - ), - deps = [ - ':sshd', - '//gerrit-extension-api:api', - '//gerrit-server:server', - '//lib:truth', - '//lib/mina:sshd', - ], -) diff --git a/gerrit-util-cli/BUCK b/gerrit-util-cli/BUCK deleted file mode 100644 index 8cdc2dcf57..0000000000 --- a/gerrit-util-cli/BUCK +++ /dev/null @@ -1,13 +0,0 @@ -java_library( - name = 'cli', - srcs = glob(['src/main/java/**/*.java']), - deps = [ - '//gerrit-common:annotations', - '//gerrit-common:server', - '//lib:args4j', - '//lib:guava', - '//lib/guice:guice', - '//lib/guice:guice-assistedinject', - ], - visibility = ['PUBLIC'], -) diff --git a/gerrit-util-http/BUCK b/gerrit-util-http/BUCK deleted file mode 100644 index 79ef836a11..0000000000 --- a/gerrit-util-http/BUCK +++ /dev/null @@ -1,39 +0,0 @@ -java_library( - name = 'http', - srcs = glob(['src/main/java/**/*.java']), - provided_deps = ['//lib:servlet-api-3_1'], - visibility = ['PUBLIC'], -) - -TESTUTIL_SRCS = glob(['src/test/**/testutil/**/*.java']) - -java_library( - name = 'testutil', - srcs = TESTUTIL_SRCS, - deps = [ - '//gerrit-extension-api:api', - '//lib:guava', - '//lib:servlet-api-3_1', - '//lib/httpcomponents:httpclient', - '//lib/jgit/org.eclipse.jgit:jgit', - ], - visibility = ['PUBLIC'], -) - -java_test( - name = 'http_tests', - srcs = glob( - ['src/test/java/**/*.java'], - excludes = TESTUTIL_SRCS, - ), - deps = [ - ':http', - ':testutil', - '//lib:junit', - '//lib:servlet-api-3_1', - '//lib:truth', - '//lib/easymock:easymock', - ], - # TODO(sop) Remove after Buck supports Eclipse - visibility = ['//tools/eclipse:classpath'], -) diff --git a/gerrit-util-ssl/BUCK b/gerrit-util-ssl/BUCK deleted file mode 100644 index 068f34ca85..0000000000 --- a/gerrit-util-ssl/BUCK +++ /dev/null @@ -1,5 +0,0 @@ -java_library( - name = 'ssl', - srcs = glob(['src/main/java/**/*.java']), - visibility = ['PUBLIC'], -) diff --git a/gerrit-war/BUCK b/gerrit-war/BUCK deleted file mode 100644 index 5dd1b046db..0000000000 --- a/gerrit-war/BUCK +++ /dev/null @@ -1,77 +0,0 @@ -include_defs('//tools/git.defs') - -java_library( - name = 'init', - srcs = glob(['src/main/java/**/*.java']), - deps = [ - '//gerrit-cache-h2:cache-h2', - '//gerrit-elasticsearch:elasticsearch', - '//gerrit-extension-api:api', - '//gerrit-gpg:gpg', - '//gerrit-httpd:httpd', - '//gerrit-lucene:lucene', - '//gerrit-oauth:oauth', - '//gerrit-openid:openid', - '//gerrit-pgm:http', - '//gerrit-pgm:init', - '//gerrit-pgm:init-api', - '//gerrit-pgm:util', - '//gerrit-reviewdb:server', - '//gerrit-server:server', - '//gerrit-server/src/main/prolog:common', - '//gerrit-sshd:sshd', - '//lib:guava', - '//lib:gwtorm', - '//lib/guice:guice', - '//lib/guice:guice-servlet', - '//lib/jgit/org.eclipse.jgit:jgit', - '//lib/log:api', - ], - provided_deps = ['//lib:servlet-api-3_1'], - visibility = [ - '//:', - '//gerrit-gwtdebug:gwtdebug', - '//tools/eclipse:classpath', - ], -) - -genrule( - name = 'webapp_assets', - cmd = 'cd src/main/webapp; zip -qr $OUT .', - srcs = glob(['src/main/webapp/**/*']), - out = 'webapp_assets.zip', - visibility = ['//:'], -) - -genrule( - name = 'log4j-config__jar', - cmd = 'jar cf $OUT -C src/main/resources .', - srcs = ['src/main/resources/log4j.properties'], - out = 'log4j-config.jar', -) - -prebuilt_jar( - name = 'log4j-config', - binary_jar = ':log4j-config__jar', - visibility = [ - '//:', - '//tools/eclipse:classpath', - ], -) - -prebuilt_jar( - name = 'version', - binary_jar = ':gen_version', - visibility = ['//:'], -) - -genrule( - name = 'gen_version', - cmd = ';'.join([ - 'cd $TMP', - 'mkdir -p com/google/gerrit/common', - 'echo "%s" >com/google/gerrit/common/Version' % git_describe(), - 'zip -9Dqr $OUT .', - ]), - out = 'version.jar', -) diff --git a/lib/BUCK b/lib/BUCK deleted file mode 100644 index 6d26f9e741..0000000000 --- a/lib/BUCK +++ /dev/null @@ -1,319 +0,0 @@ -include_defs('//lib/maven.defs') -include_defs('//lib/GUAVA_VERSION') - -define_license(name = 'antlr') -define_license(name = 'Apache1.1') -define_license(name = 'Apache2.0') -define_license(name = 'args4j') -define_license(name = 'asciidoctor') -define_license(name = 'automaton') -define_license(name = 'bouncycastle') -define_license(name = 'CC-BY3.0-unported') -define_license(name = 'clippy') -define_license(name = 'codemirror-minified') -define_license(name = 'codemirror-original') -define_license(name = 'diffy') -define_license(name = 'es6-promise') -define_license(name = 'fetch') -define_license(name = 'h2') -define_license(name = 'highlightjs') -define_license(name = 'icu4j') -define_license(name = 'jgit') -define_license(name = 'jsch') -define_license(name = 'jsoup') -define_license(name = 'MPL1.1') -define_license(name = 'moment') -define_license(name = 'OFL1.1') -define_license(name = 'ow2') -define_license(name = 'page.js') -define_license(name = 'polymer') -define_license(name = 'postgresql') -define_license(name = 'prologcafe') -define_license(name = 'promise-polyfill') -define_license(name = 'protobuf') -define_license(name = 'PublicDomain') -define_license(name = 'silk_icons') -define_license(name = 'slf4j') -define_license(name = 'xz') - -define_license(name = 'DO_NOT_DISTRIBUTE') - -maven_jar( - name = 'gwtorm_client', - id = 'com.google.gerrit:gwtorm:1.17', - bin_sha1 = "97bdc872f00388910c9af70771f07bbb32f1b949", - src_sha1 = "889e35d7295b1af49161a28daaea9905ffa76a63", - license = 'Apache2.0', -) - -java_library( - name = 'gwtorm', - exported_deps = [':gwtorm_client'], - deps = [':protobuf'], - visibility = ['PUBLIC'], -) - -maven_jar( - name = 'gwtjsonrpc', - id = 'com.google.gerrit:gwtjsonrpc:1.11', - bin_sha1 = '0990e7eec9eec3a15661edcf9232acbac4aeacec', - src_sha1 = 'a682afc46284fb58197a173cb5818770a1e7834a', - license = 'Apache2.0', -) - -maven_jar( - name = 'gson', - id = 'com.google.code.gson:gson:2.7', - sha1 = '751f548c85fa49f330cecbb1875893f971b33c4e', - license = 'Apache2.0', -) - -maven_jar( - name = 'guava', - id = 'com.google.guava:guava:' + GUAVA_VERSION, - sha1 = GUAVA_BIN_SHA1, - license = 'Apache2.0', -) - -maven_jar( - name = 'guava-retrying', - id = 'com.github.rholder:guava-retrying:2.0.0', - sha1 = '974bc0a04a11cc4806f7c20a34703bd23c34e7f4', - license = 'Apache2.0', - deps = [':jsr305'], -) - -maven_jar( - name = 'jsr305', - id = 'com.google.code.findbugs:jsr305:3.0.1', - sha1 = 'f7be08ec23c21485b9b5a1cf1654c2ec8c58168d', - license = 'Apache2.0', - attach_source = False, - # Whitelist lib targets that have jsr305 as a dependency. Generally speaking - # Gerrit core should not depend on these annotations, and instead use - # equivalent annotations in com.google.gerrit.common. - visibility = [ - '//gerrit-plugin-api:lib', - '//lib:guava-retrying', - '//lib:soy', - ], -) - -maven_jar( - name = 'velocity', - id = 'org.apache.velocity:velocity:1.7', - sha1 = '2ceb567b8f3f21118ecdec129fe1271dbc09aa7a', - license = 'Apache2.0', - deps = [ - '//lib/commons:collections', - '//lib/commons:lang', - '//lib/commons:oro', - ], - exclude = ['META-INF/LICENSE', 'META-INF/NOTICE'], -) - -maven_jar( - name = 'jsch', - id = 'com.jcraft:jsch:0.1.54', - sha1 = 'da3584329a263616e277e15462b387addd1b208d', - license = 'jsch', -) - -maven_jar( - name = 'servlet-api-3_1', - id = 'org.apache.tomcat:tomcat-servlet-api:8.0.24', - sha1 = '5d9e2e895e3111622720157d0aa540066d5fce3a', - license = 'Apache2.0', - exclude = ['META-INF/NOTICE', 'META-INF/LICENSE'], -) - -maven_jar( - name = 'args4j', - id = 'args4j:args4j:2.0.26', - sha1 = '01ebb18ebb3b379a74207d5af4ea7c8338ebd78b', - license = 'args4j', -) - -maven_jar( - name = 'mime-util', - id = 'eu.medsea.mimeutil:mime-util:2.1.3', - sha1 = '0c9cfae15c74f62491d4f28def0dff1dabe52a47', - license = 'Apache2.0', - exclude = ['LICENSE.txt', 'README.txt'], - attach_source = False, -) - -maven_jar( - name = 'juniversalchardet', - id = 'com.googlecode.juniversalchardet:juniversalchardet:1.0.3', - sha1 = 'cd49678784c46aa8789c060538e0154013bb421b', - license = 'MPL1.1', -) - -maven_jar( - name = 'automaton', - id = 'dk.brics.automaton:automaton:1.11-8', - sha1 = '6ebfa65eb431ff4b715a23be7a750cbc4cc96d0f', - license = 'automaton', -) - -maven_jar( - name = 'pegdown', - id = 'org.pegdown:pegdown:1.4.2', - sha1 = 'd96db502ed832df867ff5d918f05b51ba3879ea7', - license = 'Apache2.0', - deps = [':grappa'], -) - -maven_jar( - name = 'grappa', - id = 'com.github.parboiled1:grappa:1.0.4', - sha1 = 'ad4b44b9c305dad7aa1e680d4b5c8eec9c4fd6f5', - license = 'Apache2.0', - deps = [ - ':jitescript', - '//lib/ow2:ow2-asm', - '//lib/ow2:ow2-asm-analysis', - '//lib/ow2:ow2-asm-tree', - '//lib/ow2:ow2-asm-util', - ], -) - -maven_jar( - name = 'jitescript', - id = 'me.qmx.jitescript:jitescript:0.4.0', - sha1 = '2e35862b0435c1b027a21f3d6eecbe50e6e08d54', - license = 'Apache2.0', - visibility = ['//lib:grappa'], -) - -maven_jar( - name = 'derby', - id = 'org.apache.derby:derby:10.11.1.1', - sha1 = 'df4b50061e8e4c348ce243b921f53ee63ba9bbe1', - license = 'Apache2.0', - attach_source = False, -) - -maven_jar( - name = 'h2', - id = 'com.h2database:h2:1.3.176', - sha1 = 'fd369423346b2f1525c413e33f8cf95b09c92cbd', - license = 'h2', -) - -maven_jar( - name = 'postgresql', - id = 'org.postgresql:postgresql:9.4.1211.jre7', - sha1 = '56b01e9e667f408818a6ef06a89598dbab80687d', - license = 'postgresql', - attach_source = False, -) - -maven_jar( - name = 'protobuf', - # Must match version in gwtorm/pom.xml. - id = 'com.google.protobuf:protobuf-java:2.5.0', - bin_sha1 = 'a10732c76bfacdbd633a7eb0f7968b1059a65dfa', - src_sha1 = '7a27a7fc815e481b367ead5df19b4a71ace4a419', - license = 'protobuf', -) - -# Test-only dependencies below. - -maven_jar( - name = 'jimfs', - id = 'com.google.jimfs:jimfs:1.1', - sha1 = '8fbd0579dc68aba6186935cc1bee21d2f3e7ec1c', - license = 'DO_NOT_DISTRIBUTE', - deps = [':guava'], -) - -maven_jar( - name = 'junit', - id = 'junit:junit:4.11', - sha1 = '4e031bb61df09069aeb2bffb4019e7a5034a4ee0', - license = 'DO_NOT_DISTRIBUTE', - exported_deps = [':hamcrest-core'], -) - -maven_jar( - name = 'hamcrest-core', - id = 'org.hamcrest:hamcrest-core:1.3', - sha1 = '42a25dc3219429f0e5d060061f71acb49bf010a0', - license = 'DO_NOT_DISTRIBUTE', - visibility = ['//lib:junit'], -) - -maven_jar( - name = 'truth', - id = 'com.google.truth:truth:0.30', - sha1 = '9d591b5a66eda81f0b88cf1c748ab8853d99b18b', - license = 'DO_NOT_DISTRIBUTE', - exported_deps = [ - ':guava', - ':junit', - ], -) - -maven_jar( - name = 'tukaani-xz', - id = 'org.tukaani:xz:1.4', - sha1 = '18a9a2ce6abf32ea1b5fd31dae5210ad93f4e5e3', - license = 'xz', - attach_source = False, - visibility = ['//gerrit-server:server'], -) - -maven_jar( - name = 'javassist', - id = 'org.javassist:javassist:3.20.0-GA', - sha1 = 'a9cbcdfb7e9f86fbc74d3afae65f2248bfbf82a0', - license = 'DO_NOT_DISTRIBUTE', -) - -maven_jar( - name = 'blame-cache', - id = 'com/google/gitiles:blame-cache:0.1-9', - sha1 = '51d35e6f8bbc2412265066cea9653dd758c95826', - license = 'Apache2.0', - repository = GERRIT, -) - -# Keep this version of Soy synchronized with the version used in Gitiles. -maven_jar( - name = 'soy', - id = 'com.google.template:soy:2016-08-09', - sha1 = '43d33651e95480d515fe26c10a662faafe3ad1e4', - license = 'Apache2.0', - deps = [ - ':args4j', - ':guava', - ':gson', - ':icu4j', - ':jsr305', - ':protobuf', - '//lib/guice:guice', - '//lib/guice:guice-assistedinject', - '//lib/guice:multibindings', - '//lib/guice:javax-inject', - '//lib/ow2:ow2-asm', - '//lib/ow2:ow2-asm-analysis', - '//lib/ow2:ow2-asm-commons', - '//lib/ow2:ow2-asm-util', - ], -) - -maven_jar( - name = 'icu4j', - id = 'com.ibm.icu:icu4j:57.1', - sha1 = '198ea005f41219f038f4291f0b0e9f3259730e92', - license = 'icu4j', -) - -maven_jar( - name = 'errorprone', - id = 'com.google.errorprone:error_prone_ant:2.0.15', - sha1 = '607e3866e2ee25b74708c2898f84eac2f5452d2f', - license = 'Apache2.0', -) diff --git a/lib/antlr/BUCK b/lib/antlr/BUCK deleted file mode 100644 index edf153c635..0000000000 --- a/lib/antlr/BUCK +++ /dev/null @@ -1,48 +0,0 @@ -include_defs('//lib/maven.defs') - -VERSION = '3.5.2' - -maven_jar( - name = 'java_runtime', - id = 'org.antlr:antlr-runtime:' + VERSION, - sha1 = 'cd9cd41361c155f3af0f653009dcecb08d8b4afd', - license = 'antlr', -) - -java_binary( - name = 'antlr-tool', - main_class = 'org.antlr.Tool', - deps = [':tool'], - visibility = ['PUBLIC'], -) - -maven_jar( - name = 'stringtemplate', - id = 'org.antlr:stringtemplate:4.0.2', - sha1 = 'e28e09e2d44d60506a7bcb004d6c23ff35c6ac08', - license = 'antlr', - attach_source = False, - visibility = [], -) - -maven_jar( - name = 'tool', - id = 'org.antlr:antlr:' + VERSION, - sha1 = 'c4a65c950bfc3e7d04309c515b2177c00baf7764', - license = 'antlr', - deps = [ - ':java_runtime', - ':stringtemplate', - ':antlr27', - ], - visibility = [], -) - -maven_jar( - name = 'antlr27', - id = 'antlr:antlr:2.7.7', - sha1 = '83cd2cd674a217ade95a4bb83a8a14f351f48bd0', - license = 'antlr', - attach_source = False, - visibility = [], -) diff --git a/lib/asciidoctor/BUCK b/lib/asciidoctor/BUCK deleted file mode 100644 index 5b4cd6b4ec..0000000000 --- a/lib/asciidoctor/BUCK +++ /dev/null @@ -1,61 +0,0 @@ -include_defs('//lib/maven.defs') - -java_binary( - name = 'asciidoc', - main_class = 'AsciiDoctor', - deps = [':asciidoc_lib'], - visibility = ['PUBLIC'], -) - -java_library( - name = 'asciidoc_lib', - srcs = ['java/AsciiDoctor.java'], - deps = [ - ':asciidoctor', - ':jruby', - '//lib:args4j', - '//lib:guava', - '//lib/log:api', - '//lib/log:nop', - ], - visibility = ['//tools/eclipse:classpath'], -) - -java_binary( - name = 'doc_indexer', - main_class = 'DocIndexer', - deps = [':doc_indexer_lib'], - visibility = ['PUBLIC'], -) - -java_library( - name = 'doc_indexer_lib', - srcs = ['java/DocIndexer.java'], - deps = [ - ':asciidoc_lib', - '//gerrit-server:constants', - '//lib:args4j', - '//lib:guava', - '//lib/lucene:lucene-analyzers-common', - '//lib/lucene:lucene-core-and-backward-codecs', - ], - visibility = ['//tools/eclipse:classpath'], -) - -maven_jar( - name = 'asciidoctor', - id = 'org.asciidoctor:asciidoctorj:1.5.4.1', - sha1 = 'f7ddfb2bbed2f8da3f9ad0d1a5514f04b4274a5a', - license = 'asciidoctor', - visibility = [], - attach_source = False, -) - -maven_jar( - name = 'jruby', - id = 'org.jruby:jruby-complete:9.1.5.0', - sha1 = '00d0003e99da3c4d830b12c099691ce910c84e39', - license = 'DO_NOT_DISTRIBUTE', - visibility = [], - attach_source = False, -) diff --git a/lib/auto/BUCK b/lib/auto/BUCK deleted file mode 100644 index c186f87213..0000000000 --- a/lib/auto/BUCK +++ /dev/null @@ -1,9 +0,0 @@ -include_defs('//lib/maven.defs') - -maven_jar( - name = 'auto-value', - id = 'com.google.auto.value:auto-value:1.4-rc1', - sha1 = '9347939002003a7a3c3af48271fc2c18734528a4', - license = 'Apache2.0', - visibility = ['PUBLIC'], -) diff --git a/lib/auto/auto_value.defs b/lib/auto/auto_value.defs deleted file mode 100644 index 440574726a..0000000000 --- a/lib/auto/auto_value.defs +++ /dev/null @@ -1,21 +0,0 @@ -# NOTE: Do not use this file in your build rules; automatically supported by -# our implementation of java_library. - -AUTO_VALUE_DEP = '//lib/auto:auto-value' - -# Annotation processor classpath requires transitive dependencies. -# TODO(dborowitz): Clean this up when buck issue is closed and there is a -# better supported interface: -# https://github.com/facebook/buck/issues/85 -AUTO_VALUE_PROCESSOR_DEPS = [ - '//lib:velocity', - '//lib/auto:auto-value', - '//lib/commons:collections', - '//lib/commons:lang', - '//lib/commons:oro', -] - -AUTO_VALUE_PROCESSORS = [ - 'com.google.auto.value.processor.AutoAnnotationProcessor', - 'com.google.auto.value.processor.AutoValueProcessor', -] diff --git a/lib/bouncycastle/BUCK b/lib/bouncycastle/BUCK deleted file mode 100644 index f7271b4e17..0000000000 --- a/lib/bouncycastle/BUCK +++ /dev/null @@ -1,28 +0,0 @@ -include_defs('//lib/maven.defs') - -# This version must match the version that also appears in -# gerrit-pgm/src/main/resources/com/google/gerrit/pgm/init/libraries.config -VERSION = '1.56' - -maven_jar( - name = 'bcprov', - id = 'org.bouncycastle:bcprov-jdk15on:' + VERSION, - sha1 = 'a153c6f9744a3e9dd6feab5e210e1c9861362ec7', - license = 'DO_NOT_DISTRIBUTE', #'bouncycastle' -) - -maven_jar( - name = 'bcpg', - id = 'org.bouncycastle:bcpg-jdk15on:' + VERSION, - sha1 = '9c3f2e7072c8cc1152079b5c25291a9f462631f1', - license = 'DO_NOT_DISTRIBUTE', #'bouncycastle' - deps = [':bcprov'], -) - -maven_jar( - name = 'bcpkix', - id = 'org.bouncycastle:bcpkix-jdk15on:' + VERSION, - sha1 = '4648af70268b6fdb24674fb1fd7c1fcc73db1231', - license = 'DO_NOT_DISTRIBUTE', #'bouncycastle' - deps = [':bcprov'], -) diff --git a/lib/codemirror/BUCK b/lib/codemirror/BUCK deleted file mode 100644 index 040690f72a..0000000000 --- a/lib/codemirror/BUCK +++ /dev/null @@ -1,140 +0,0 @@ -include_defs('//lib/maven.defs') -include_defs('//lib/codemirror/cm.defs') - -VERSION = '5.22.0' -TOP = 'META-INF/resources/webjars/codemirror/%s' % VERSION -TOP_MINIFIED = 'META-INF/resources/webjars/codemirror-minified/%s' % VERSION - -maven_jar( - name = 'codemirror-minified', - id = 'org.webjars.npm:codemirror-minified:' + VERSION, - sha1 = '3e8767c9293614968176fcf66cb873d6eb8b3051', - attach_source = False, - license = 'codemirror-minified', - visibility = [], -) - -maven_jar( - name = 'codemirror-original', - id = 'org.webjars.npm:codemirror:' + VERSION, - sha1 = '879c49085a44f062554a4e4a9ac248b7083d37cf', - attach_source = False, - license = 'codemirror-original', - visibility = [], -) - -DIFF_MATCH_PATCH_TOP = ('META-INF/resources/webjars/google-diff-match-patch/%s' - % DIFF_MATCH_PATCH_VERSION) - -maven_jar( - name = 'diff-match-patch', - id = 'org.webjars:google-diff-match-patch:' + DIFF_MATCH_PATCH_VERSION, - sha1 = '0cf1782dbcb8359d95070da9176059a5a9d37709', - license = 'Apache2.0', - attach_source = False, -) - -for archive, suffix, top in [('codemirror-original', '', TOP), ('codemirror-minified', '_r', TOP_MINIFIED)]: - # Main JavaScript and addons - genrule( - name = 'cm' + suffix, - cmd = ';'.join([ - "echo '/** @license' >$OUT", - 'unzip -p $(location :%s) %s/LICENSE >>$OUT' % (archive, top), - "echo '*/' >>$OUT", - ] + - ['unzip -p $(location :%s) %s/%s >>$OUT' % (archive, top, n) for n in CM_JS] + - ['unzip -p $(location :%s) %s/addon/%s >>$OUT' % (archive, top, n) - for n in CM_ADDONS] - ), - out = 'cm%s.js' % suffix, - ) - - # Main CSS - genrule( - name = 'css' + suffix, - cmd = ';'.join([ - "echo '/** @license' >$OUT", - 'unzip -p $(location :%s) %s/LICENSE >>$OUT' % (archive, top), - "echo '*/' >>$OUT", - ] + - ['unzip -p $(location :%s) %s/%s >>$OUT' % (archive, top, n) - for n in CM_CSS] - ), - out = 'cm%s.css' % suffix, - ) - - # Modes - for n in CM_MODES: - genrule ( - name = 'mode_%s%s' % (n, suffix), - cmd = ';'.join([ - "echo '/** @license' >$OUT", - 'unzip -p $(location :%s) %s/LICENSE >>$OUT' % (archive, top), - "echo '*/' >>$OUT", - 'unzip -p $(location :%s) %s/mode/%s/%s.js >>$OUT' % (archive, top, n, n), - ] - ), - out = 'mode_%s%s.js' % (n, suffix), - ) - - # Themes - for n in CM_THEMES: - genrule( - name = 'theme_%s%s' % (n, suffix), - cmd = ';'.join([ - "echo '/** @license' >$OUT", - 'unzip -p $(location :%s) %s/LICENSE >>$OUT' % (archive, top), - "echo '*/' >>$OUT", - 'unzip -p $(location :%s) %s/theme/%s.css >>$OUT' % (archive, top, n) - ] - ), - out = 'theme_%s%s.css' % (n, suffix), - ) - - # Merge Addon bundled with diff-match-patch - genrule( - name = 'addon_merge_with_diff_match_patch%s' % suffix, - cmd = ';'.join([ - "echo '/** @license' >$OUT", - 'unzip -p $(location :%s) %s/LICENSE >>$OUT' % (archive, top), - "echo '*/\n' >>$OUT", - "echo '// The google-diff-match-patch library is from https://repo1.maven.org/maven2/org/webjars/google-diff-match-patch/%s/google-diff-match-patch-%s.jar\n' >> $OUT" % (DIFF_MATCH_PATCH_VERSION, DIFF_MATCH_PATCH_VERSION), - "echo '/** @license' >>$OUT", - 'cat $(location //lib:LICENSE-Apache2.0) >>$OUT', - "echo '*/' >>$OUT", - 'unzip -p $(location :diff-match-patch) %s/diff_match_patch.js >>$OUT' % DIFF_MATCH_PATCH_TOP, - "echo ';' >> $OUT", - 'unzip -p $(location :%s) %s/addon/merge/merge.js >>$OUT' % (archive, top) - ] - ), - out = 'addon_merge_with_diff_match_patch%s.js' % suffix, - ) - - # Jar packaging - genrule( - name = 'jar' + suffix, - cmd = ';'.join([ - 'cd $TMP', - 'mkdir -p net/codemirror/{addon,lib,mode,theme}', - 'cp $(location :css%s) net/codemirror/lib/cm.css' % suffix, - 'cp $(location :cm%s) net/codemirror/lib/cm.js' % suffix] - + ['cp $(location :mode_%s%s) net/codemirror/mode/%s.js' % (n, suffix, n) - for n in CM_MODES] - + ['cp $(location :theme_%s%s) net/codemirror/theme/%s.css' % (n, suffix, n) - for n in CM_THEMES] - + ['cp $(location :addon_merge_with_diff_match_patch%s) net/codemirror/addon/merge_bundled.js' % suffix] - + ['zip -qr $OUT net/codemirror/{addon,lib,mode,theme}']), - out = 'codemirror%s.jar' % suffix, - ) - - prebuilt_jar( - name = 'codemirror' + suffix, - binary_jar = ':jar%s' % suffix, - deps = [ - ':jar' + suffix, - '//lib:LICENSE-' + archive, - ], - visibility = ['PUBLIC'], - ) - diff --git a/lib/codemirror/cm.defs b/lib/codemirror/cm.defs deleted file mode 100644 index bfb4f7ac86..0000000000 --- a/lib/codemirror/cm.defs +++ /dev/null @@ -1,215 +0,0 @@ -CM_CSS = [ - 'lib/codemirror.css', - 'addon/dialog/dialog.css', - 'addon/merge/merge.css', - 'addon/scroll/simplescrollbars.css', - 'addon/search/matchesonscrollbar.css', - 'addon/lint/lint.css', -] - -CM_JS = [ - 'lib/codemirror.js', - 'mode/meta.js', - 'keymap/emacs.js', - 'keymap/sublime.js', - 'keymap/vim.js', -] - -CM_ADDONS = [ - 'dialog/dialog.js', - 'edit/closebrackets.js', - 'edit/matchbrackets.js', - 'edit/trailingspace.js', - 'scroll/annotatescrollbar.js', - 'scroll/simplescrollbars.js', - 'search/jump-to-line.js', - 'search/matchesonscrollbar.js', - 'search/searchcursor.js', - 'search/search.js', - 'selection/mark-selection.js', - 'mode/multiplex.js', - 'mode/overlay.js', - 'mode/simple.js', - 'lint/lint.js', -] - -# Available themes must be enumerated here, -# in gerrit-extension-api/src/main/java/com/google/gerrit/extensions/common/Theme.java, -# in gerrit-gwtui/src/main/java/net/codemirror/theme/Themes.java -CM_THEMES = [ - '3024-day', - '3024-night', - 'abcdef', - 'ambiance', - 'base16-dark', - 'base16-light', - 'bespin', - 'blackboard', - 'cobalt', - 'colorforth', - 'dracula', - 'duotone-dark', - 'duotone-light', - 'eclipse', - 'elegant', - 'erlang-dark', - 'hopscotch', - 'icecoder', - 'isotope', - 'lesser-dark', - 'liquibyte', - 'material', - 'mbo', - 'mdn-like', - 'midnight', - 'monokai', - 'neat', - 'neo', - 'night', - 'paraiso-dark', - 'paraiso-light', - 'pastel-on-dark', - 'railscasts', - 'rubyblue', - 'seti', - 'solarized', - 'the-matrix', - 'tomorrow-night-bright', - 'tomorrow-night-eighties', - 'ttcn', - 'twilight', - 'vibrant-ink', - 'xq-dark', - 'xq-light', - 'yeti', - 'zenburn', -] - -# Available modes must be enumerated here, -# in gerrit-gwtui/src/main/java/net/codemirror/mode/Modes.java, -# gerrit-gwtui/src/main/java/net/codemirror/mode/ModeInfo.java, -# and in CodeMirror's own mode/meta.js script. -CM_MODES = [ - 'apl', - 'asciiarmor', - 'asn.1', - 'asterisk', - 'brainfuck', - 'clike', - 'clojure', - 'cmake', - 'cobol', - 'coffeescript', - 'commonlisp', - 'crystal', - 'css', - 'cypher', - 'd', - 'dart', - 'diff', - 'django', - 'dockerfile', - 'dtd', - 'dylan', - 'ebnf', - 'ecl', - 'eiffel', - 'elm', - 'erlang', - 'factor', - 'fcl', - 'forth', - 'fortran', - 'gas', - 'gfm', - 'gherkin', - 'go', - 'groovy', - 'haml', - 'handlebars', - 'haskell-literate', - 'haskell', - 'haxe', - 'htmlembedded', - 'htmlmixed', - 'http', - 'idl', - 'javascript', - 'jinja2', - 'jsx', - 'julia', - 'livescript', - 'lua', - 'markdown', - 'mathematica', - 'mbox', - 'mirc', - 'mllike', - 'modelica', - 'mscgen', - 'mumps', - 'nginx', - 'nsis', - 'ntriples', - 'octave', - 'oz', - 'pascal', - 'pegjs', - 'perl', - 'php', - 'pig', - 'powershell', - 'properties', - 'protobuf', - 'pug', - 'puppet', - 'python', - 'q', - 'r', - 'rpm', - 'rst', - 'ruby', - 'rust', - 'sas', - 'sass', - 'scheme', - 'shell', - 'sieve', - 'slim', - 'smalltalk', - 'smarty', - 'solr', - 'soy', - 'sparql', - 'spreadsheet', - 'sql', - 'stex', - 'stylus', - 'swift', - 'tcl', - 'textile', - 'tiddlywiki', - 'tiki', - 'toml', - 'tornado', - 'troff', - 'ttcn-cfg', - 'ttcn', - 'turtle', - 'twig', - 'vb', - 'vbscript', - 'velocity', - 'verilog', - 'vhdl', - 'vue', - 'webidl', - 'xml', - 'xquery', - 'yacas', - 'yaml-frontmatter', - 'yaml', - 'z80', -] - -DIFF_MATCH_PATCH_VERSION = "20121119-1" diff --git a/lib/commons/BUCK b/lib/commons/BUCK deleted file mode 100644 index 5c2e9b2001..0000000000 --- a/lib/commons/BUCK +++ /dev/null @@ -1,93 +0,0 @@ -include_defs('//lib/maven.defs') - -maven_jar( - name = 'codec', - id = 'commons-codec:commons-codec:1.4', - sha1 = '4216af16d38465bbab0f3dff8efa14204f7a399a', - license = 'Apache2.0', - exclude = ['META-INF/LICENSE.txt', 'META-INF/NOTICE.txt'], -) - -maven_jar( - name = 'collections', - id = 'commons-collections:commons-collections:3.2.2', - sha1 = '8ad72fe39fa8c91eaaf12aadb21e0c3661fe26d5', - license = 'Apache2.0', - exclude = ['META-INF/LICENSE.txt', 'META-INF/NOTICE.txt'], - attach_source = False, -) - -maven_jar( - name = 'compress', - id = 'org.apache.commons:commons-compress:1.12', - sha1 = '84caa68576e345eb5e7ae61a0e5a9229eb100d7b', - license = 'Apache2.0', - exclude = ['META-INF/LICENSE.txt', 'META-INF/NOTICE.txt'], -) - -maven_jar( - name = 'dbcp', - id = 'commons-dbcp:commons-dbcp:1.4', - sha1 = '30be73c965cc990b153a100aaaaafcf239f82d39', - license = 'Apache2.0', - deps = [':pool'], - exclude = [ - 'META-INF/LICENSE.txt', - 'META-INF/NOTICE.txt', - 'testpool.jocl' - ], -) - -maven_jar( - name = 'lang', - id = 'commons-lang:commons-lang:2.6', - sha1 = '0ce1edb914c94ebc388f086c6827e8bdeec71ac2', - license = 'Apache2.0', - exclude = ['META-INF/LICENSE.txt', 'META-INF/NOTICE.txt'], -) - -maven_jar( - name = 'lang3', - id = 'org.apache.commons:commons-lang3:3.3.2', - sha1 = '90a3822c38ec8c996e84c16a3477ef632cbc87a3', - license = 'Apache2.0', -) - -maven_jar( - name = 'net', - id = 'commons-net:commons-net:3.5', - sha1 = '342fc284019f590e1308056990fdb24a08f06318', - license = 'Apache2.0', - exclude = ['META-INF/LICENSE.txt', 'META-INF/NOTICE.txt'], -) - -maven_jar( - name = 'pool', - id = 'commons-pool:commons-pool:1.5.5', - sha1 = '7d8ffbdc47aa0c5a8afe5dc2aaf512f369f1d19b', - license = 'Apache2.0', - attach_source = False, - exclude = ['META-INF/LICENSE.txt', 'META-INF/NOTICE.txt'], -) - -maven_jar( - name = 'oro', - id = 'oro:oro:2.0.8', - sha1 = '5592374f834645c4ae250f4c9fbb314c9369d698', - license = 'Apache1.1', - attach_source = False, - exclude = ['META-INF/LICENSE'], -) - -# When updating the version of commons-validator, also update the -# list of supported TLDs in: -# gerrit-server/src/test/resources/com/google/gerrit/server/mail/tlds-alpha-by-domain.txt -# from: -# http://data.iana.org/TLD/tlds-alpha-by-domain.txt -maven_jar( - name = 'validator', - id = 'commons-validator:commons-validator:1.5.1', - sha1 = '86d05a46e8f064b300657f751b5a98c62807e2a0', - license = 'Apache2.0', -) - diff --git a/lib/dropwizard/BUCK b/lib/dropwizard/BUCK deleted file mode 100644 index de73e13e9a..0000000000 --- a/lib/dropwizard/BUCK +++ /dev/null @@ -1,8 +0,0 @@ -include_defs('//lib/maven.defs') - -maven_jar( - name = 'dropwizard-core', - id = 'io.dropwizard.metrics:metrics-core:3.1.2', - sha1 = '224f03afd2521c6c94632f566beb1bb5ee32cf07', - license = 'Apache2.0', -) diff --git a/lib/easymock/BUCK b/lib/easymock/BUCK deleted file mode 100644 index cabd62ee26..0000000000 --- a/lib/easymock/BUCK +++ /dev/null @@ -1,31 +0,0 @@ -include_defs('//lib/maven.defs') - -maven_jar( - name = 'easymock', - id = 'org.easymock:easymock:3.1', # When bumping the version - # number, make sure to also move powermock to a compatible version - sha1 = '3e127311a86fc2e8f550ef8ee4abe094bbcf7e7e', - license = 'DO_NOT_DISTRIBUTE', - deps = [ - ':cglib-3_2', - ':objenesis', - ], -) - -maven_jar( - name = 'cglib-3_2', - id = 'cglib:cglib-nodep:3.2.0', - sha1 = 'cf1ca207c15b04ace918270b6cb3f5601160cdfd', - license = 'DO_NOT_DISTRIBUTE', - attach_source = False, -) - -maven_jar( - name = 'objenesis', - id = 'org.objenesis:objenesis:1.3', - sha1 = 'dc13ae4faca6df981fc7aeb5a522d9db446d5d50', - license = 'DO_NOT_DISTRIBUTE', - visibility = ['//lib/powermock:powermock-reflect'], - attach_source = False, -) - diff --git a/lib/elasticsearch/BUCK b/lib/elasticsearch/BUCK deleted file mode 100644 index 373f4d2d40..0000000000 --- a/lib/elasticsearch/BUCK +++ /dev/null @@ -1,104 +0,0 @@ -include_defs('//lib/maven.defs') - -# Java client library for Elasticsearch. -maven_jar( - name = 'elasticsearch', - id = 'org.elasticsearch:elasticsearch:2.4.0', - sha1 = 'aeb9704a76fa8654c348f38fcbb993a952a7ab07', - attach_source = True, - repository = MAVEN_CENTRAL, - license = 'Apache2.0', - deps = [ - ':jna', - ':hppc', - ':jsr166e', - ':netty', - ':t-digest', - ':compress-lzf', - '//lib/joda:joda-time', - '//lib/lucene:lucene-codecs', - '//lib/lucene:lucene-highlighter', - '//lib/lucene:lucene-join', - '//lib/lucene:lucene-memory', - '//lib/lucene:lucene-sandbox', - '//lib/lucene:lucene-suggest', - '//lib/lucene:lucene-queries', - '//lib/lucene:lucene-spatial', - '//lib/jackson:jackson-core', - '//lib/jackson:jackson-dataformat-cbor', - '//lib/jackson:jackson-dataformat-smile', - ] -) - -# Java REST client for Elasticsearch. -VERSION = '2.0.3' - -maven_jar( - name = 'jest-common', - id = 'io.searchbox:jest-common:' + VERSION, - sha1 = 'f304c66894aaf2f6c17a886bc826f09c7a161cf9', - license = 'Apache2.0', -) - -maven_jar( - name = 'jest', - id = 'io.searchbox:jest:' + VERSION, - sha1 = 'b8f9ed1423489b361804e47f640515ea9f1fa08d', - license = 'Apache2.0', - deps = [ - ':elasticsearch', - ':jest-common', - '//lib/commons:lang3', - '//lib/httpcomponents:httpasyncclient', - '//lib/httpcomponents:httpclient', - '//lib/httpcomponents:httpcore-nio', - '//lib/httpcomponents:httpcore-niossl', - ], -) - -maven_jar( - name = 'compress-lzf', - id = 'com.ning:compress-lzf:1.0.2', - sha1 = '62896e6fca184c79cc01a14d143f3ae2b4f4b4ae', - license = 'Apache2.0', - visibility = ['//lib/elasticsearch:elasticsearch'], -) - -maven_jar( - name = 'hppc', - id = 'com.carrotsearch:hppc:0.7.1', - sha1 = '8b5057f74ea378c0150a1860874a3ebdcb713767', - license = 'Apache2.0', - visibility = ['//lib/elasticsearch:elasticsearch'], -) - -maven_jar( - name = 'jsr166e', - id = 'com.twitter:jsr166e:1.1.0', - sha1 = '233098147123ee5ddcd39ffc57ff648be4b7e5b2', - license = 'Apache2.0', - visibility = ['//lib/elasticsearch:elasticsearch'], -) - -maven_jar( - name = 'netty', - id = 'io.netty:netty:3.10.0.Final', - sha1 = 'ad61cd1bba067e6634ddd3e160edf0727391ac30', - license = 'Apache2.0', - visibility = ['//lib/elasticsearch:elasticsearch'], -) - -maven_jar( - name = 't-digest', - id = 'com.tdunning:t-digest:3.0', - sha1 = '84ccf145ac2215e6bfa63baa3101c0af41017cfc', - license = 'Apache2.0', - visibility = ['//lib/elasticsearch:elasticsearch'], -) - -maven_jar( - name = 'jna', - id = 'net.java.dev.jna:jna:4.1.0', - sha1 = '1c12d070e602efd8021891cdd7fd18bc129372d4', - license = 'Apache2.0', -) diff --git a/lib/fonts/BUCK b/lib/fonts/BUCK deleted file mode 100644 index 7b64cf2f12..0000000000 --- a/lib/fonts/BUCK +++ /dev/null @@ -1,13 +0,0 @@ -# Source Code Pro. Version 2.010 Roman / 1.030 Italics -# https://github.com/adobe-fonts/source-code-pro/releases/tag/2.010R-ro%2F1.030R-it -genrule( - name = 'sourcecodepro', - cmd = 'zip -rq $OUT .', - srcs = [ - 'SourceCodePro-Regular.woff', - 'SourceCodePro-Regular.woff2' - ], - out = 'sourcecodepro.zip', - license = 'OFL1.1', - visibility = ['PUBLIC'], -) diff --git a/lib/greenmail/BUCK b/lib/greenmail/BUCK deleted file mode 100644 index 6fdf806343..0000000000 --- a/lib/greenmail/BUCK +++ /dev/null @@ -1,13 +0,0 @@ -include_defs('//lib/maven.defs') - -VERSION = '1.5.2' - -maven_jar( - name = 'greenmail', - id = 'com.icegreen:greenmail:' + VERSION, - sha1 = '6b4862a09f8642da58c109117b24ccc19a4a6d39', - license = 'Apache2.0', - exclude_java_sources = True, - visibility = ['PUBLIC'], -) - diff --git a/lib/guice/BUCK b/lib/guice/BUCK deleted file mode 100644 index 8022ac80ea..0000000000 --- a/lib/guice/BUCK +++ /dev/null @@ -1,79 +0,0 @@ -include_defs('//lib/maven.defs') - -VERSION = '4.1.0' -EXCLUDE = [ - 'META-INF/DEPENDENCIES', - 'META-INF/LICENSE', - 'META-INF/NOTICE', -] - -java_library( - name = 'guice', - exported_deps = [ - ':guice_library', - ':javax-inject', - ':multibindings', - ], - visibility = ['PUBLIC'], -) - -maven_jar( - name = 'guice_library', - id = 'com.google.inject:guice:' + VERSION, - sha1 = 'eeb69005da379a10071aa4948c48d89250febb07', - license = 'Apache2.0', - deps = [':aopalliance'], - exclude_java_sources = True, - exclude = EXCLUDE + [ - 'META-INF/maven/com.google.guava/guava/pom.properties', - 'META-INF/maven/com.google.guava/guava/pom.xml', - ], - visibility = ['PUBLIC'], -) - -maven_jar( - name = 'guice-assistedinject', - id = 'com.google.inject.extensions:guice-assistedinject:' + VERSION, - sha1 = 'af799dd7e23e6fe8c988da12314582072b07edcb', - license = 'Apache2.0', - deps = [':guice'], - exclude = EXCLUDE, -) - -maven_jar( - name = 'guice-servlet', - id = 'com.google.inject.extensions:guice-servlet:' + VERSION, - sha1 = '90ac2db772d9b85e2b05417b74f7464bcc061dcb', - license = 'Apache2.0', - deps = [':guice'], - exclude = EXCLUDE, -) - -maven_jar( - name = 'aopalliance', - id = 'aopalliance:aopalliance:1.0', - sha1 = '0235ba8b489512805ac13a8f9ea77a1ca5ebe3e8', - license = 'PublicDomain', - visibility = ['//lib/guice:guice'], -) - -maven_jar( - name = 'javax-inject', - id = 'javax.inject:javax.inject:1', - sha1 = '6975da39a7040257bd51d21a231b76c915872d38', - license = 'Apache2.0', - visibility = ['PUBLIC'], -) - -maven_jar( - name = 'multibindings', - id = 'com.google.inject.extensions:guice-multibindings:' + VERSION, - sha1 = '3b27257997ac51b0f8d19676f1ea170427e86d51', - exclude_java_sources = True, - exclude = EXCLUDE + [ - 'META-INF/maven/com.google.guava/guava/pom.properties', - 'META-INF/maven/com.google.guava/guava/pom.xml', - ], - license = 'Apache2.0', - visibility = ['PUBLIC'] -) diff --git a/lib/gwt/BUCK b/lib/gwt/BUCK deleted file mode 100644 index 6e8b8d1137..0000000000 --- a/lib/gwt/BUCK +++ /dev/null @@ -1,73 +0,0 @@ -include_defs('//lib/maven.defs') - -VERSION = '2.8.0' - -maven_jar( - name = 'user', - id = 'com.google.gwt:gwt-user:' + VERSION, - sha1 = '518579870499e15531f454f35dca0772d7fa31f7', - license = 'Apache2.0', - attach_source = False, -) - -maven_jar( - name = 'dev', - id = 'com.google.gwt:gwt-dev:' + VERSION, - sha1 = 'f160a61272c5ebe805cd2d3d3256ed3ecf14893f', - license = 'Apache2.0', - attach_source = False, -) - -maven_jar( - name = 'javax-validation', - id = 'javax.validation:validation-api:1.0.0.GA', - bin_sha1 = 'b6bd7f9d78f6fdaa3c37dae18a4bd298915f328e', - src_sha1 = '7a561191db2203550fbfa40d534d4997624cd369', - license = 'Apache2.0', - visibility = ['PUBLIC'], -) - -maven_jar( - name = 'jsinterop-annotations', - id = 'com.google.jsinterop:jsinterop-annotations:1.0.0', - bin_sha1 = '23c3a3c060ffe4817e67673cc8294e154b0a4a95', - src_sha1 = '5d7c478efbfccc191430d7c118d7bd2635e43750', - license = 'Apache2.0', - visibility = ['PUBLIC'], -) - -maven_jar( - name = 'ant', - id = 'ant:ant:1.6.5', - bin_sha1 = '7d18faf23df1a5c3a43613952e0e8a182664564b', - src_sha1 = '9e0a847494563f35f9b02846a1c1eb4aa2ee5a9a', - license = 'Apache2.0', - visibility = ['PUBLIC'], -) - -maven_jar( - name = 'colt', - id = 'colt:colt:1.2.0', - attach_source = False, - bin_sha1 = '0abc984f3adc760684d49e0f11ddf167ba516d4f', - license = 'DO_NOT_DISTRIBUTE', - visibility = ['PUBLIC'], -) - -maven_jar( - name = 'tapestry', - id = 'tapestry:tapestry:4.0.2', - attach_source = False, - bin_sha1 = 'e855a807425d522e958cbce8697f21e9d679b1f7', - license = 'Apache2.0', - visibility = ['PUBLIC'], -) - -maven_jar( - name = 'w3c-css-sac', - id = 'org.w3c.css:sac:1.3', - attach_source = False, - bin_sha1 = 'cdb2dcb4e22b83d6b32b93095f644c3462739e82', - license = 'DO_NOT_DISTRIBUTE', - visibility = ['PUBLIC'], -) diff --git a/lib/highlightjs/BUCK b/lib/highlightjs/BUCK deleted file mode 100644 index 9940136990..0000000000 --- a/lib/highlightjs/BUCK +++ /dev/null @@ -1,5 +0,0 @@ -export_file( - name = 'highlightjs', - src = 'highlight.min.js', - visibility = ['PUBLIC'], -) diff --git a/lib/httpcomponents/BUCK b/lib/httpcomponents/BUCK deleted file mode 100644 index 1e56f94ca4..0000000000 --- a/lib/httpcomponents/BUCK +++ /dev/null @@ -1,63 +0,0 @@ -include_defs('//lib/maven.defs') - -VERSION = '4.4.1' - -maven_jar( - name = 'fluent-hc', - id = 'org.apache.httpcomponents:fluent-hc:' + VERSION, - bin_sha1 = '96fb842b68a44cc640c661186828b60590c71261', - src_sha1 = '702515612b2b94ce3374ed5b579d38cbd308eb4f', - license = 'Apache2.0', - deps = [':httpclient'] -) - -maven_jar( - name = 'httpclient', - id = 'org.apache.httpcomponents:httpclient:' + VERSION, - bin_sha1 = '016d0bc512222f1253ee6b64d389c84e22f697f0', - src_sha1 = '30cb4791019c7280227e027b01814f4964a02482', - license = 'Apache2.0', - deps = [ - '//lib/commons:codec', - ':httpcore', - '//lib/log:jcl-over-slf4j', - ], -) - -maven_jar( - name = 'httpcore', - id = 'org.apache.httpcomponents:httpcore:' + VERSION, - bin_sha1 = 'f5aa318bda4c6c8d688c9d00b90681dcd82ce636', - src_sha1 = '9700be0d0a331691654a8e901943c9a74e33c5fc', - license = 'Apache2.0', -) - -maven_jar( - name = 'httpmime', - id = 'org.apache.httpcomponents:httpmime:' + VERSION, - bin_sha1 = '2f8757f5ac5e38f46c794e5229d1f3c522e9b1df', - src_sha1 = '5394d3715181a87009032335a55b0a9789f6e26f', - license = 'Apache2.0', -) - -maven_jar( - name = 'httpasyncclient', - id = 'org.apache.httpcomponents:httpasyncclient:4.1.2', - sha1 = '95aa3e6fb520191a0970a73cf09f62948ee614be', - license = 'Apache2.0', -) - -maven_jar( - name = 'httpcore-nio', - id = 'org.apache.httpcomponents:httpcore-nio:' + VERSION, - sha1 = 'a8c5e3c3bfea5ce23fb647c335897e415eb442e3', - license = 'Apache2.0', -) - -maven_jar( - name = 'httpcore-niossl', - id = 'org.apache.httpcomponents:httpcore-niossl:4.0-alpha6', - sha1 = '9c662e7247ca8ceb1de5de629f685c9ef3e4ab58', - license = 'Apache2.0', - attach_source = False, -) diff --git a/lib/jackson/BUCK b/lib/jackson/BUCK deleted file mode 100644 index 46056b5308..0000000000 --- a/lib/jackson/BUCK +++ /dev/null @@ -1,26 +0,0 @@ -include_defs('//lib/maven.defs') - -VERSION = '2.6.6' - -maven_jar( - name = 'jackson-core', - id = 'com.fasterxml.jackson.core:jackson-core:' + VERSION, - sha1 = '02eb801df67aacaf5b1deb4ac626e1964508e47b', - license = 'Apache2.0', -) - -maven_jar( - name = 'jackson-dataformat-smile', - id = 'com.fasterxml.jackson.dataformat:jackson-dataformat-smile:' + VERSION, - sha1 = 'ccbfc948748ed2754a58c1af9e0a02b5cc1aed69', - license = 'Apache2.0', -) - -maven_jar( - name = 'jackson-dataformat-cbor', - id = 'com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:' + VERSION, - sha1 = '34c7b7ff495fc6b049612bdc9db0900a68e112f8', - license = 'Apache2.0' -) - - diff --git a/lib/jetty/BUCK b/lib/jetty/BUCK deleted file mode 100644 index e24cfe5728..0000000000 --- a/lib/jetty/BUCK +++ /dev/null @@ -1,95 +0,0 @@ -include_defs('//lib/maven.defs') - -VERSION = '9.3.11.v20160721' -EXCLUDE = ['about.html'] - -maven_jar( - name = 'servlet', - id = 'org.eclipse.jetty:jetty-servlet:' + VERSION, - sha1 = 'd550147b85c73ea81084a4ac7915ba7f609021c5', - license = 'Apache2.0', - deps = [':security'], - exclude = EXCLUDE, -) - -maven_jar( - name = 'security', - id = 'org.eclipse.jetty:jetty-security:' + VERSION, - sha1 = '1cbefc5d1196b9e1ca6f4cc36738998a6ebde8bf', - license = 'Apache2.0', - deps = [':server'], - exclude = EXCLUDE, - visibility = [], -) - -maven_jar( - name = 'servlets', - id = 'org.eclipse.jetty:jetty-servlets:' + VERSION, - sha1 = 'a9f7a43977151a463aa21a9b0e882aa3d25452ef', - license = 'Apache2.0', - exclude = EXCLUDE, - visibility = [ - '//tools/eclipse:classpath', - '//gerrit-gwtdebug:gwtdebug', - ], -) - -maven_jar( - name = 'server', - id = 'org.eclipse.jetty:jetty-server:' + VERSION, - sha1 = 'd932e0dc1e9bd4839ae446754615163d60271a66', - license = 'Apache2.0', - exported_deps = [ - ':continuation', - ':http', - ], - exclude = EXCLUDE, -) - -maven_jar( - name = 'jmx', - id = 'org.eclipse.jetty:jetty-jmx:' + VERSION, - sha1 = '21a658d2f5eb87c23eef4911966625ea95f66d32', - license = 'Apache2.0', - exported_deps = [ - ':continuation', - ':http', - ], - exclude = EXCLUDE, -) - -maven_jar( - name = 'continuation', - id = 'org.eclipse.jetty:jetty-continuation:' + VERSION, - sha1 = '92a91c0dcc5f5d779a1c9f94038332be3f46c9df', - license = 'Apache2.0', - exclude = EXCLUDE, -) - -maven_jar( - name = 'http', - id = 'org.eclipse.jetty:jetty-http:' + VERSION, - sha1 = 'dcfb95e5b886a981bb76467b911c5b706117f9cf', - license = 'Apache2.0', - exported_deps = [':io'], - exclude = EXCLUDE, -) - -maven_jar( - name = 'io', - id = 'org.eclipse.jetty:jetty-io:' + VERSION, - sha1 = 'db5f4f481159894a4b670072a34917b5414d0c98', - license = 'Apache2.0', - exported_deps = [':util'], - exclude = EXCLUDE, - visibility = [], -) - -maven_jar( - name = 'util', - id = 'org.eclipse.jetty:jetty-util:' + VERSION, - sha1 = '1812ffd5a04698051180d582c146ca807760c808', - license = 'Apache2.0', - exclude = EXCLUDE, - visibility = [], -) diff --git a/lib/jgit/org.eclipse.jgit.archive/BUCK b/lib/jgit/org.eclipse.jgit.archive/BUCK deleted file mode 100644 index f96bf4c030..0000000000 --- a/lib/jgit/org.eclipse.jgit.archive/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -include_defs('//lib/maven.defs') -include_defs('//lib/JGIT_VERSION') - -maven_jar( - name = 'jgit-archive', - id = 'org.eclipse.jgit:org.eclipse.jgit.archive:' + JGIT_VERS, - sha1 = 'a728cf277396f1227c5a8dffcf5dee0188fc0821', - license = 'jgit', - repository = REPO, - deps = ['//lib/jgit/org.eclipse.jgit:jgit'], - unsign = True, - exclude = [ - 'about.html', - 'plugin.properties', - ], - ) diff --git a/lib/jgit/org.eclipse.jgit.http.server/BUCK b/lib/jgit/org.eclipse.jgit.http.server/BUCK deleted file mode 100644 index c31de7057b..0000000000 --- a/lib/jgit/org.eclipse.jgit.http.server/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -include_defs('//lib/maven.defs') -include_defs('//lib/JGIT_VERSION') - -maven_jar( - name = 'jgit-servlet', - id = 'org.eclipse.jgit:org.eclipse.jgit.http.server:' + JGIT_VERS, - sha1 = 'd3aa54bd610db9a5c246aa8fef13989982c98628', - license = 'jgit', - repository = REPO, - deps = ['//lib/jgit/org.eclipse.jgit:jgit'], - unsign = True, - exclude = [ - 'about.html', - 'plugin.properties', - ], -) diff --git a/lib/jgit/org.eclipse.jgit.junit/BUCK b/lib/jgit/org.eclipse.jgit.junit/BUCK deleted file mode 100644 index 6073fa0382..0000000000 --- a/lib/jgit/org.eclipse.jgit.junit/BUCK +++ /dev/null @@ -1,12 +0,0 @@ -include_defs('//lib/maven.defs') -include_defs('//lib/JGIT_VERSION') - -maven_jar( - name = 'junit', - id = 'org.eclipse.jgit:org.eclipse.jgit.junit:' + JGIT_VERS, - sha1 = '6c2b2f192c95d25a2e1576aee5d1169dd8bd2266', - license = 'DO_NOT_DISTRIBUTE', - repository = REPO, - unsign = True, - deps = ['//lib/jgit/org.eclipse.jgit:jgit'], -) diff --git a/lib/jgit/org.eclipse.jgit/BUCK b/lib/jgit/org.eclipse.jgit/BUCK deleted file mode 100644 index a1e14a5890..0000000000 --- a/lib/jgit/org.eclipse.jgit/BUCK +++ /dev/null @@ -1,25 +0,0 @@ -include_defs('//lib/maven.defs') -include_defs('//lib/JGIT_VERSION') - -maven_jar( - name = 'jgit', - id = 'org.eclipse.jgit:org.eclipse.jgit:' + JGIT_VERS, - bin_sha1 = 'a2b5970b853f8fee64589fc1103c0ceb7677ba63', - src_sha1 = '765f955774c36c226aa41fba7c20119451de2db7', - license = 'jgit', - repository = REPO, - unsign = True, - deps = [':javaewah'], - exclude = [ - 'META-INF/eclipse.inf', - 'about.html', - 'plugin.properties', - ], -) - -maven_jar( - name = 'javaewah', - id = 'com.googlecode.javaewah:JavaEWAH:1.1.6', - sha1 = '94ad16d728b374d65bd897625f3fbb3da223a2b6', - license = 'Apache2.0', -) diff --git a/lib/joda/BUCK b/lib/joda/BUCK deleted file mode 100644 index d78c456148..0000000000 --- a/lib/joda/BUCK +++ /dev/null @@ -1,25 +0,0 @@ -include_defs('//lib/maven.defs') - -EXCLUDE = [ - 'META-INF/LICENSE.txt', - 'META-INF/NOTICE.txt', -] - -maven_jar( - name = 'joda-time', - id = 'joda-time:joda-time:2.9.4', - sha1 = '1c295b462f16702ebe720bbb08f62e1ba80da41b', - deps = [':joda-convert'], - license = 'Apache2.0', - exclude = EXCLUDE, - visibility = ['PUBLIC'], -) - -maven_jar( - name = 'joda-convert', - id = 'org.joda:joda-convert:1.8.1', - sha1 = '675642ac208e0b741bc9118dcbcae44c271b992a', - license = 'Apache2.0', - exclude = EXCLUDE, - visibility = ['//lib/joda:joda-time'], -) diff --git a/lib/js.defs b/lib/js.defs deleted file mode 100644 index f215de92ec..0000000000 --- a/lib/js.defs +++ /dev/null @@ -1,172 +0,0 @@ -# Copyright (C) 2015 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -NPMJS = 'NPMJS' -GERRIT = 'GERRIT' - -# NOTE: npm_binary rules do not get their licenses checked by gen_licenses.py, -# as we would have to cut too many edges. DO NOT include these binaries in -# build outputs. Using them in the build _process_ is ok. -def npm_binary( - name, - version, - sha1 = '', - repository = NPMJS, - visibility = ['PUBLIC']): - - dir = '%s-%s' % (name, version) - filename = '%s.tgz' % dir - dest = '%s@%s.npm_binary.tgz' % (name, version) - if repository == GERRIT: - url = 'http://gerrit-maven.storage.googleapis.com/npm-packages/%s' % filename - elif repository == NPMJS: - url = 'http://registry.npmjs.org/%s/-/%s' % (name, filename) - else: - raise ValueError('invalid repository: %s' % repository) - cmd = ['$(exe //tools:download_file)', '-o', '$OUT', '-u', url] - if sha1: - cmd.extend(['-v', sha1]) - genrule( - name = name, - cmd = ' '.join(cmd), - out = dest, - visibility = visibility, - ) - - -def run_npm_binary(target): - return '$(location //tools/js:run_npm_binary) $(location %s)' % target - - -def bower_component( - name, - package, - version, - license, - deps = [], - semver = None, - sha1 = '', - visibility = ['PUBLIC']): - download_name = '%s__download_bower' % name - genrule( - name = download_name, - cmd = ' '.join([ - '$(exe //tools/js:download_bower)', - '-b', '"%s"' % run_npm_binary('//lib/js:bower'), - '-n', name, - '-p', package, - '-v', version, - '-s', sha1, - '-o', '$OUT', - ]), - out = '%s.zip' % download_name, - license = license, - visibility = [], - ) - - renamed_name = '%s__renamed' % name - genrule( - name = renamed_name, - cmd = ' && '.join([ - 'cd $TMP', - 'mkdir bower_components', - 'cd bower_components', - 'unzip $(location :%s)' % download_name, - 'cd ..', - 'zip -r $OUT bower_components', - ]), - out = '%s.zip' % renamed_name, - visibility = [], - ) - - genrule( - name = name, - cmd = _combine_components([':%s' % renamed_name] + deps), - out = '%s-%s.zip' % (name, version), - visibility = visibility, - ) - - version_name = '%s__bower_version' % name - dep_version = semver if semver is not None else version - deps_json = '{"%s": "%s#%s"}' % (name, package, dep_version) - genrule( - name = version_name, - cmd = "echo '%s' > $OUT" % deps_json, - out = version_name, - visibility = visibility, - ) - - -def bower_components( - name, - deps, - visibility = ['PUBLIC']): - genrule( - name = name, - cmd = _combine_components(deps), - out = '%s.bower_components.zip' % name, - visibility = visibility, - ) - - -def _combine_components(deps): - cmds = ['cd $TMP'] - for d in deps: - cmds.append('unzip -qo $(location %s)' % d) - cmds.append("find bower_components -exec touch -t 198001010000 '{}' ';'") - cmds.append('zip -r $OUT bower_components/*') - return ' && '.join(cmds) - - -VULCANIZE_FLAGS = [ - '--inline-scripts', - '--inline-css', - '--strip-comments', -] - -def vulcanize( - name, - app, - srcs, - components, - extra_flags = [], - visibility = ['PUBLIC']): - genrule( - name = '%s__vulcanized' % name, - cmd = ' '.join([ - 'unzip', '-qd', '$TMP', '$(location %s)' % components, - '&&', 'rm', '-rf', '$SRCDIR/bower_components', - '&&', 'ln', '-s', '-f', '$TMP/bower_components', '.', - '&&', run_npm_binary('//lib/js:vulcanize') - ] + VULCANIZE_FLAGS + extra_flags + [ - '--out-html', '$OUT', - '$SRCDIR/%s' % app, - ]), - srcs = srcs, - out = '%s.vulcanized.html' % name, - visibility = visibility, - ) - - genrule( - name = name, - cmd = ' '.join([ - 'cd', '$TMP', - '&&', run_npm_binary('//lib/js:crisper'), '--always-write-script', - '--source', '$(location :%s__vulcanized)' % name, - '--html', '%s.html' % name, - '--js', '%s.js' % name, - '&&', 'zip', '$OUT', '%s.html' % name, '%s.js' % name, - ]), - out = '%s.vulcanized.zip' % name, - ) diff --git a/lib/js/BUCK b/lib/js/BUCK deleted file mode 100644 index bb31b94ce7..0000000000 --- a/lib/js/BUCK +++ /dev/null @@ -1,427 +0,0 @@ -include_defs('//lib/js.defs') - -# WHEN REVIEWING NEW NPM_BINARY RULES: -# -# You must check licenses in the transitive closure of dependencies to ensure -# they can be used by Gerrit. (npm binaries are not distributed with Gerrit -# releases, so we are less restrictive in our selection of licenses, but we -# still need to do a sanity check.) -# -# To do this: -# npm install -g license-checker -# mkdir /tmp/npmtmp -# cd /tmp/npmtmp -# npm install @ -# license-checker -# (Piping to grep -o 'licenses:.*' and/or sort -u may make the output saner.) - -npm_binary( - name = 'bower', - version = '1.7.9', - sha1 = 'b7296c2393e0d75edaa6ca39648132dd255812b0', -) - -npm_binary( - name = 'crisper', - version = '2.0.2', - sha1 = '7183c58cea33632fb036c91cefd1b43e390d22a2', - repository = GERRIT, -) - -npm_binary( - name = 'vulcanize', - version = '1.14.8', - sha1 = '679107f251c19ab7539529b1e3fdd40829e6fc63', - repository = GERRIT, -) - -# ## Adding Bower component dependencies -# -# 1. Add a dummy bower_component rule to this file, specifying the semantic -# version you want to use. The actual version will be filled in by Bower, -# after evaluating the full dependency tree. -# -# bower_component( -# name = 'somepackage', -# package = 'someauthor/somepackage', -# version = 'TODO', -# semver = '~1.0.0', -# license = 'DO_NOT_DISTRIBUTE' -# ) -# -# 2. Add your bower_component as a dep to a bower_components rule. -# -# bower_components( -# name = 'polygerrit_components', -# deps = [ -# '//lib/js:foo', -# '//lib/js:somepackage', # NEW -# ], -# ) -# -# 3. Run bower2buck.py. -# -# buck run //tools/js:bower2buck -- -o /tmp/newbuck -# -# 4. Use your favorite diff tool to merge the output in newbuck with this file. -# bower2buck reevaluates semantic versions and may upgrade some packages, so -# you may need to make changes beyond the new component that was added. -# -# meld /tmp/newbuck lib/js/BUCK -# -# -# ## Updating Bower component dependencies -# -# Use the same procedure as for adding dependencies, except just change the -# version number of the existing bower_component rather than adding a new rule. - -bower_component( - name = 'accessibility-developer-tools', - package = 'accessibility-developer-tools', - version = '2.10.0', - license = 'DO_NOT_DISTRIBUTE', - sha1 = 'bc1a5e56ff1bed7a7a6ef22a4b4e8300e4822aa5', -) - -bower_component( - name = 'async', - package = 'async', - version = '1.5.2', - license = 'DO_NOT_DISTRIBUTE', - sha1 = '1ec975d3b3834646a7e3d4b7e68118b90ed72508', -) - -bower_component( - name = 'chai', - package = 'chai', - version = '3.5.0', - license = 'DO_NOT_DISTRIBUTE', - sha1 = '849ad3ee7c77506548b7b5db603a4e150b9431aa', -) - -bower_component( - name = 'es6-promise', - package = 'stefanpenner/es6-promise', - version = '3.3.0', - license = 'es6-promise', - sha1 = 'a3a797bb22132f1ef75f9a2556173f81870c2e53', -) - -bower_component( - name = 'fetch', - package = 'fetch', - version = '1.0.0', - license = 'fetch', - sha1 = '1b05a2bb40c73232c2909dc196de7519fe4db7a9', -) - -bower_component( - name = 'iron-a11y-announcer', - package = 'polymerelements/iron-a11y-announcer', - version = '1.0.4', - deps = [':polymer'], - license = 'polymer', - sha1 = '9a915711b35092fa2f86ff6e904c4f3e43aa5234', -) - -bower_component( - name = 'iron-a11y-keys-behavior', - package = 'polymerelements/iron-a11y-keys-behavior', - version = '1.1.2', - deps = [':polymer'], - license = 'polymer', - sha1 = '57fd39ee153ce37ed719ba3f7a405afb987d54f9', -) - -bower_component( - name = 'iron-autogrow-textarea', - package = 'polymerelements/iron-autogrow-textarea', - version = '1.0.12', - deps = [ - ':iron-behaviors', - ':iron-flex-layout', - ':iron-form-element-behavior', - ':iron-validatable-behavior', - ':polymer', - ], - license = 'polymer', - sha1 = 'b9b6874c9a2b5be435557a827ff8bd6661672ee3', -) - -bower_component( - name = 'iron-behaviors', - package = 'polymerelements/iron-behaviors', - version = '1.0.16', - deps = [ - ':iron-a11y-keys-behavior', - ':polymer', - ], - license = 'polymer', - sha1 = 'bd70636a2c0a78c50d1a76f9b8ca1ffd815478a3', -) - -bower_component( - name = 'iron-dropdown', - package = 'polymerelements/iron-dropdown', - version = '1.4.0', - deps = [ - ':iron-a11y-keys-behavior', - ':iron-behaviors', - ':iron-overlay-behavior', - ':iron-resizable-behavior', - ':neon-animation', - ':polymer', - ], - license = 'polymer', - sha1 = '63e3d669a09edaa31c4f05afc76b53b919ef0595', -) - -bower_component( - name = 'iron-fit-behavior', - package = 'polymerelements/iron-fit-behavior', - version = '1.2.2', - deps = [':polymer'], - license = 'polymer', - sha1 = 'bc53e9bab36b21f086ab8fac8c53cc7214aa1890', -) - -bower_component( - name = 'iron-flex-layout', - package = 'polymerelements/iron-flex-layout', - version = '1.3.1', - deps = [':polymer'], - license = 'polymer', - sha1 = 'ba696394abff5e799fc06eb11bff4720129a1b52', -) - -bower_component( - name = 'iron-form-element-behavior', - package = 'polymerelements/iron-form-element-behavior', - version = '1.0.6', - deps = [':polymer'], - license = 'polymer', - sha1 = '8d9e6530edc1b99bec1a5c34853911fba3701220', -) - -bower_component( - name = 'iron-input', - package = 'polymerelements/iron-input', - version = '1.0.10', - deps = [ - ':iron-a11y-announcer', - ':iron-validatable-behavior', - ':polymer', - ], - license = 'polymer', - sha1 = '9bc0c8e81de2527125383cbcf74dd9f27e7fa9ac', -) - -bower_component( - name = 'iron-meta', - package = 'polymerelements/iron-meta', - version = '1.1.1', - deps = [':polymer'], - license = 'polymer', - sha1 = 'e06281b6ddb3355ceca44975a167381b1fd72ce5', -) - -bower_component( - name = 'iron-overlay-behavior', - package = 'polymerelements/iron-overlay-behavior', - version = '1.7.6', - deps = [ - ':iron-a11y-keys-behavior', - ':iron-fit-behavior', - ':iron-resizable-behavior', - ':polymer', - ], - license = 'polymer', - sha1 = '83181085fda59446ce74fd0d5ca30c223f38ee4a', -) - -bower_component( - name = 'iron-resizable-behavior', - package = 'polymerelements/iron-resizable-behavior', - version = '1.0.3', - deps = [':polymer'], - license = 'polymer', - sha1 = '5982a3e19af7ed3e3de276a9b7bd266b3a144002', -) - -bower_component( - name = 'iron-selector', - package = 'polymerelements/iron-selector', - version = '1.5.2', - deps = [':polymer'], - license = 'polymer', - sha1 = 'c57235dfda7fbb987c20ad0e97aac70babf1a1bf', -) - -bower_component( - name = 'iron-test-helpers', - package = 'polymerelements/iron-test-helpers', - version = '1.2.5', - deps = [':polymer'], - license = 'DO_NOT_DISTRIBUTE', - sha1 = '433b03b106f5ff32049b84150cd70938e18b67ac', -) - -bower_component( - name = 'iron-validatable-behavior', - package = 'polymerelements/iron-validatable-behavior', - version = '1.1.1', - deps = [ - ':iron-meta', - ':polymer', - ], - license = 'polymer', - sha1 = '480423380be0536f948735d91bc472f6e7ced5b4', -) - -bower_component( - name = 'lodash', - package = 'lodash', - version = '3.10.1', - license = 'DO_NOT_DISTRIBUTE', - sha1 = '2f207a8293c4c554bf6cf071241f7a00dc513d3a', -) - -bower_component( - name = 'mocha', - package = 'mocha', - version = '2.5.1', - license = 'DO_NOT_DISTRIBUTE', - sha1 = 'cb29bdd1047cfd9304659ecf10ec263f9c888c99', -) - -bower_component( - name = 'moment', - package = 'moment/moment', - version = '2.13.0', - license = 'moment', - sha1 = 'fc8ce2c799bab21f6ced7aff928244f4ca8880aa', -) - -bower_component( - name = 'neon-animation', - package = 'polymerelements/neon-animation', - version = '1.2.3', - deps = [ - ':iron-meta', - ':iron-resizable-behavior', - ':iron-selector', - ':polymer', - ':web-animations-js', - ], - license = 'polymer', - sha1 = '71cc0d3e0afdf8b8563e87d2ff03a6fa19183bd9', -) - -bower_component( - name = 'page', - package = 'visionmedia/page.js', - version = '1.7.1', - license = 'page.js', - sha1 = '51a05428dd4f68fae1df5f12d0e2b61ba67f7757', -) - -bower_component( - name = 'polymer', - package = 'polymer/polymer', - version = '1.7.0', - deps = [':webcomponentsjs'], - license = 'polymer', - sha1 = 'e70caa58fdee0ce51c805d548f544f74cc27d143', -) - -bower_component( - name = 'promise-polyfill', - package = 'polymerlabs/promise-polyfill', - version = '1.0.0', - deps = [':polymer'], - license = 'promise-polyfill', - sha1 = 'a3b598c06cbd7f441402e666ff748326030905d6', -) - -bower_component( - name = 'sinon-chai', - package = 'sinon-chai', - version = '2.8.0', - license = 'DO_NOT_DISTRIBUTE', - sha1 = '0464b5d944fdf8116bb23e0b02ecfbac945b3517', -) - -bower_component( - name = 'sinonjs', - package = 'sinonjs', - version = '1.17.1', - license = 'DO_NOT_DISTRIBUTE', - sha1 = 'a26a6aab7358807de52ba738770f6ac709afd240', -) - -bower_component( - name = 'stacky', - package = 'stacky', - version = '1.3.2', - license = 'DO_NOT_DISTRIBUTE', - sha1 = 'd6c07a0112ab2e9677fe085933744466a89232fb', -) - -bower_component( - name = 'test-fixture', - package = 'polymerelements/test-fixture', - version = '1.1.1', - license = 'DO_NOT_DISTRIBUTE', - sha1 = 'e373bd21c069163c3a754e234d52c07c77b20d3c', -) - -bower_component( - name = 'web-animations-js', - package = 'web-animations/web-animations-js', - version = '2.2.1', - license = 'Apache2.0', - sha1 = '0e73b263a86aa6764ad35c273eb12055f83d7eda', -) - -bower_component( - name = 'web-component-tester', - package = 'web-component-tester', - version = '4.2.2', - deps = [ - ':accessibility-developer-tools', - ':async', - ':chai', - ':lodash', - ':mocha', - ':sinon-chai', - ':sinonjs', - ':stacky', - ':test-fixture', - ], - license = 'DO_NOT_DISTRIBUTE', - sha1 = '54556000c33d9ed7949aa546c1b4a1531491a5f0', -) - -bower_component( - name = 'webcomponentsjs', - package = 'webcomponentsjs', - version = '0.7.22', - license = 'polymer', - sha1 = '8ba97a4a279ec6973a19b171c462a7b5cf454fb9', -) - -# Zip highlightjs so that it can be imported as though it were a -# bower_component and also attach the library license to the Buck dependency -# graph. -HLJS_DIR = 'bower_components/highlightjs' -genrule( - name = 'highlightjs', - cmd = ' && '.join([ - 'mkdir -p %s' % HLJS_DIR, - 'cp $(location //lib/highlightjs:highlightjs) %s/highlight.min.js' % HLJS_DIR, - 'zip -r $OUT bower_components', - ]), - out = 'highlightjs.zip', - license = 'highlightjs', - visibility = ['PUBLIC'], -) diff --git a/lib/log/BUCK b/lib/log/BUCK deleted file mode 100644 index a5201f3505..0000000000 --- a/lib/log/BUCK +++ /dev/null @@ -1,56 +0,0 @@ -include_defs('//lib/maven.defs') - -VER = '1.7.7' - -maven_jar( - name = 'api', - id = 'org.slf4j:slf4j-api:' + VER, - sha1 = '2b8019b6249bb05d81d3a3094e468753e2b21311', - license = 'slf4j', -) - -maven_jar( - name = 'nop', - id = 'org.slf4j:slf4j-nop:' + VER, - sha1 = '6cca9a3b999ff28b7a35ca762b3197cd7e4c2ad1', - license = 'slf4j', - deps = [':api'], -) - -maven_jar( - name = 'impl_log4j', - id = 'org.slf4j:slf4j-log4j12:' + VER, - sha1 = '58f588119ffd1702c77ccab6acb54bfb41bed8bd', - license = 'slf4j', - deps = [':log4j'], -) - -maven_jar( - name = 'jcl-over-slf4j', - id = 'org.slf4j:jcl-over-slf4j:' + VER, - sha1 = '56003dcd0a31deea6391b9e2ef2f2dc90b205a92', - license = 'slf4j', -) - -maven_jar( - name = 'log4j', - id = 'log4j:log4j:1.2.17', - sha1 = '5af35056b4d257e4b64b9e8069c0746e8b08629f', - license = 'Apache2.0', - exclude = ['META-INF/LICENSE', 'META-INF/NOTICE'], -) - -maven_jar( - name = 'jsonevent-layout', - id = 'net.logstash.log4j:jsonevent-layout:1.7', - sha1 = '507713504f0ddb75ba512f62763519c43cf46fde', - license = 'Apache2.0', - deps = [':json-smart', '//lib/commons:lang'] -) - -maven_jar( - name = 'json-smart', - id = 'net.minidev:json-smart:1.1.1', - sha1 = '24a2f903d25e004de30ac602c5b47f2d4e420a59', - license = 'Apache2.0', -) diff --git a/lib/lucene/BUCK b/lib/lucene/BUCK deleted file mode 100644 index 8f2efa2c3b..0000000000 --- a/lib/lucene/BUCK +++ /dev/null @@ -1,163 +0,0 @@ -include_defs('//lib/maven.defs') - -VERSION = '5.5.2' - -# core and backward-codecs both provide -# META-INF/services/org.apache.lucene.codecs.Codec, so they must be merged. -merge_maven_jars( - name = 'lucene-core-and-backward-codecs', - srcs = [ - ':backward-codecs_jar', - ':lucene-core', - ], - visibility = ['PUBLIC'], -) - -maven_jar( - name = 'lucene-codecs', - id = 'org.apache.lucene:lucene-codecs:' + VERSION, - sha1 = 'e01fe463d9490bb1b4a6a168e771f7b7255a50b1', - license = 'Apache2.0', - exclude = [ - 'META-INF/LICENSE.txt', - 'META-INF/NOTICE.txt', - ], -) - -maven_jar( - name = 'lucene-core', - id = 'org.apache.lucene:lucene-core:' + VERSION, - sha1 = 'de5e5c3161ea01e89f2a09a14391f9b7ed66cdbb', - license = 'Apache2.0', - exclude = [ - 'META-INF/LICENSE.txt', - 'META-INF/NOTICE.txt', - ], - visibility = ['//gerrit-elasticsearch:elasticsearch'], -) - -maven_jar( - name = 'lucene-analyzers-common', - id = 'org.apache.lucene:lucene-analyzers-common:' + VERSION, - sha1 = 'f0bc3114a6b43f8e64a33c471d5b9e8ddc51564d', - license = 'Apache2.0', - deps = [':lucene-core-and-backward-codecs'], - exclude = [ - 'META-INF/LICENSE.txt', - 'META-INF/NOTICE.txt', - ], -) - -maven_jar( - name = 'backward-codecs_jar', - id = 'org.apache.lucene:lucene-backward-codecs:' + VERSION, - sha1 = 'c5cfcd7a8cf48a0144b61fb991c8e50a0bf868d5', - license = 'Apache2.0', - deps = [':lucene-core'], - exclude = [ - 'META-INF/LICENSE.txt', - 'META-INF/NOTICE.txt', - ], - visibility = [], -) - -maven_jar( - name = 'lucene-highlighter', - id = 'org.apache.lucene:lucene-highlighter:' + VERSION, - sha1 = 'd127ac514e9df965ab0b57d92bbe0c68d3d145b8', - license = 'Apache2.0', - exclude = [ - 'META-INF/LICENSE.txt', - 'META-INF/NOTICE.txt', - ], -) - -maven_jar( - name = 'lucene-join', - id = 'org.apache.lucene:lucene-join:'+ VERSION, - sha1 = 'dac1b322508f3f2696ecc49a97311d34d8382054', - license = 'Apache2.0', - exclude = [ - 'META-INF/LICENSE.txt', - 'META-INF/NOTICE.txt', - ], -) - -maven_jar( - name = 'lucene-memory', - id = 'org.apache.lucene:lucene-memory:' + VERSION, - sha1 = '7409db9863d8fbc265c27793c6cc7511304182c2', - license = 'Apache2.0', - exclude = [ - 'META-INF/LICENSE.txt', - 'META-INF/NOTICE.txt', - ], -) - -maven_jar( - name = 'lucene-misc', - id = 'org.apache.lucene:lucene-misc:' + VERSION, - sha1 = '37bbe5a2fb429499dfbe75d750d1778881fff45d', - license = 'Apache2.0', - deps = [':lucene-core-and-backward-codecs'], - exclude = [ - 'META-INF/LICENSE.txt', - 'META-INF/NOTICE.txt', - ], -) - -maven_jar( - name = 'lucene-sandbox', - id = 'org.apache.lucene:lucene-sandbox:' + VERSION, - sha1 = '30a91f120706ba66732d5a974b56c6971b3c8a16', - license = 'Apache2.0', - exclude = [ - 'META-INF/LICENSE.txt', - 'META-INF/NOTICE.txt', - ], -) - -maven_jar( - name = 'lucene-spatial', - id = 'org.apache.lucene:lucene-spatial:' + VERSION, - sha1 = '8ed7a9a43d78222038573dd1c295a61f3c0bb0db', - license = 'Apache2.0', - exclude = [ - 'META-INF/LICENSE.txt', - 'META-INF/NOTICE.txt', - ], -) -maven_jar( - name = 'lucene-suggest', - id = 'org.apache.lucene:lucene-suggest:' + VERSION, - sha1 = 'e8316b37dddcf2092a54dab2ce6aad0d5ad78585', - license = 'Apache2.0', - exclude = [ - 'META-INF/LICENSE.txt', - 'META-INF/NOTICE.txt', - ], -) - -maven_jar( - name = 'lucene-queries', - id = 'org.apache.lucene:lucene-queries:' + VERSION, - sha1 = '692f1ad887cf4e006a23f45019e6de30f3312d3f', - license = 'Apache2.0', - exclude = [ - 'META-INF/LICENSE.txt', - 'META-INF/NOTICE.txt', - ], -) - -maven_jar( - name = 'lucene-queryparser', - id = 'org.apache.lucene:lucene-queryparser:' + VERSION, - sha1 = '8ac921563e744463605284c6d9d2d95e1be5b87c', - license = 'Apache2.0', - deps = [':lucene-core-and-backward-codecs'], - exclude = [ - 'META-INF/LICENSE.txt', - 'META-INF/NOTICE.txt', - ], -) - diff --git a/lib/mail/BUCK b/lib/mail/BUCK deleted file mode 100644 index 3243ff588d..0000000000 --- a/lib/mail/BUCK +++ /dev/null @@ -1,13 +0,0 @@ -include_defs('//lib/maven.defs') - -VERSION = '1.5.6' - -maven_jar( - name = 'mail', - id = 'com.sun.mail:javax.mail:' + VERSION, - sha1 = 'ab5daef2f881c42c8e280cbe918ec4d7fdfd7efe', - license = 'DO_NOT_DISTRIBUTE', - exclude_java_sources = True, - visibility = ['PUBLIC'], -) - diff --git a/lib/maven.defs b/lib/maven.defs deleted file mode 100644 index 913be35946..0000000000 --- a/lib/maven.defs +++ /dev/null @@ -1,188 +0,0 @@ -# Copyright (C) 2013 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -GERRIT = 'GERRIT:' -GERRIT_API = 'GERRIT_API:' -MAVEN_CENTRAL = 'MAVEN_CENTRAL:' -MAVEN_LOCAL = 'MAVEN_LOCAL:' -MAVEN_SNAPSHOT = 'MAVEN_SNAPSHOT:' - -def define_license(name): - n = 'LICENSE-' + name - genrule( - name = n, - cmd = 'ln -s $SRCS $OUT', - srcs = [n], - out = n, - visibility = ['PUBLIC'], - ) - -def maven_jar( - name, - id, - license, - exclude = [], - exclude_java_sources = False, - unsign = False, - deps = [], - exported_deps = [], - sha1 = '', bin_sha1 = '', src_sha1 = '', - repository = MAVEN_CENTRAL, - attach_source = True, - visibility = ['PUBLIC'], - local_license = False): - from os import path - - def maven_snapshot(parts): - if len(parts) != 4: - raise NameError('%s:\nexpected id="groupId:artifactId:version:snapshot]"' - % id) - group, artifact, version, snapshot = parts - jar = path.join(name, - version + '-SNAPSHOT', - '-'.join([artifact.lower(), version, snapshot])) - url = '/'.join([ - repository, - group.replace('.', '/'), - artifact, - version + '-SNAPSHOT', - '-'.join([artifact.lower(), version, snapshot])]) - return jar, url - - def maven_release(parts): - if len(parts) not in [3, 4]: - raise NameError('%s:\nexpected id="groupId:artifactId:version[:classifier]"' - % id) - if len(parts) == 4: - group, artifact, version, classifier = parts - file_version = version + '-' + classifier - else: - group, artifact, version = parts - file_version = version - - jar = path.join(name, artifact.lower() + '-' + file_version) - url = '/'.join([ - repository, - group.replace('.', '/'), - artifact, - version, - artifact + '-' + file_version]) - - return jar, url - - parts = id.split(':') - if repository.startswith(MAVEN_SNAPSHOT): - jar, url = maven_snapshot(parts) - else: - jar, url = maven_release(parts) - - binjar = jar + '.jar' - binurl = url + '.jar' - - srcjar = jar + '-src.jar' - srcurl = url + '-sources.jar' - - cmd = ['$(exe //tools:download_file)', '-o', '$OUT', '-u', binurl] - if sha1: - cmd.extend(['-v', sha1]) - elif bin_sha1: - cmd.extend(['-v', bin_sha1]) - for x in exclude: - cmd.extend(['-x', x]) - if exclude_java_sources: - cmd.append('--exclude_java_sources') - if unsign: - cmd.append('--unsign') - - genrule( - name = '%s__download_bin' % name, - cmd = ' '.join(cmd), - out = binjar, - ) - license = ':LICENSE-' + license - if not local_license: - license = '//lib' + license - license = [license] - - if src_sha1 or attach_source: - cmd = ['$(exe //tools:download_file)', '-o', '$OUT', '-u', srcurl] - if src_sha1: - cmd.extend(['-v', src_sha1]) - genrule( - name = '%s__download_src' % name, - cmd = ' '.join(cmd), - out = srcjar, - ) - prebuilt_jar( - name = '%s_src' % name, - binary_jar = ':%s__download_src' % name, - deps = license, - visibility = visibility, - ) - else: - srcjar = None - genrule( - name = '%s_src' % name, - cmd = ':>$OUT', - out = '__%s__no_src' % name, - ) - - if exported_deps: - prebuilt_jar( - name = '%s__jar' % name, - deps = deps + license, - binary_jar = ':%s__download_bin' % name, - source_jar = ':%s__download_src' % name if srcjar else None, - ) - java_library( - name = name, - exported_deps = exported_deps + [':' + name + '__jar'], - visibility = visibility, - ) - else: - prebuilt_jar( - name = name, - deps = deps + license, - binary_jar = ':%s__download_bin' % name, - source_jar = ':%s__download_src' % name if srcjar else None, - visibility = visibility, - ) - - -def merge_maven_jars( - name, - srcs, - visibility = []): - - def cmd(jars): - return ('$(location //tools:merge_jars) $OUT ' - + ' '.join(['$(location %s)' % j for j in jars])) - - genrule( - name = '%s__merged_bin' % name, - cmd = cmd(['%s__download_bin' % s for s in srcs]), - out = '%s__merged.jar' % name, - ) - genrule( - name = '%s__merged_src' % name, - cmd = cmd(['%s__download_src' % s for s in srcs]), - # tools/eclipse/project.py requires -src.jar suffix. - out = '%s__merged-src.jar' % name, - ) - prebuilt_jar( - name = name, - binary_jar = ':%s__merged_bin' % name, - source_jar = ':%s__merged_src' % name, - visibility = visibility, - ) diff --git a/lib/mime4j/BUCK b/lib/mime4j/BUCK deleted file mode 100644 index 08fa903ef7..0000000000 --- a/lib/mime4j/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -include_defs('//lib/maven.defs') - -VERSION = '0.8.0' - -maven_jar( - name = 'core', - id = 'org.apache.james:apache-mime4j-core:' + VERSION, - sha1 = 'd54f45fca44a2f210569656b4ca3574b42911c95', - license = 'Apache2.0', - visibility = ['PUBLIC'], -) - -maven_jar( - name = 'dom', - id = 'org.apache.james:apache-mime4j-dom:' + VERSION, - sha1 = '6720c93d14225c3e12c4a69768a0370c80e376a3', - license = 'Apache2.0', - visibility = ['PUBLIC'], -) diff --git a/lib/mina/BUCK b/lib/mina/BUCK deleted file mode 100644 index f22a710631..0000000000 --- a/lib/mina/BUCK +++ /dev/null @@ -1,26 +0,0 @@ -include_defs('//lib/maven.defs') - -EXCLUDE = [ - 'META-INF/DEPENDENCIES', - 'META-INF/LICENSE', - 'META-INF/NOTICE', -] - -maven_jar( - name = 'sshd', - id = 'org.apache.sshd:sshd-core:1.2.0', - sha1 = '4bc24a8228ba83dac832680366cf219da71dae8e', - src_sha1 = '490e3f03d7628ecf1cbb8317563fdbf06e68e29f', - license = 'Apache2.0', - deps = [':core'], - exclude = EXCLUDE, -) - -maven_jar( - name = 'core', - id = 'org.apache.mina:mina-core:2.0.10', - sha1 = 'a1cb1136b104219d6238de886bf5a3ea4554eb58', - src_sha1 = 'b70ff94ba379b4e825caca1af4ec83193fac4b10', - license = 'Apache2.0', - exclude = EXCLUDE, -) diff --git a/lib/openid/BUCK b/lib/openid/BUCK deleted file mode 100644 index 728698bb32..0000000000 --- a/lib/openid/BUCK +++ /dev/null @@ -1,35 +0,0 @@ -include_defs('//lib/maven.defs') - -maven_jar( - name = 'consumer', - id = 'org.openid4java:openid4java:0.9.8', - sha1 = 'de4f1b33d3b0f0b2ab1d32834ec1190b39db4160', - license = 'Apache2.0', - deps = [ - ':nekohtml', - ':xerces', - '//lib/httpcomponents:httpclient', - '//lib/log:jcl-over-slf4j', - '//lib/guice:guice', - ], - visibility = ['PUBLIC'], -) - -maven_jar( - name = 'nekohtml', - id = 'net.sourceforge.nekohtml:nekohtml:1.9.10', - sha1 = '14052461031a7054aa094f5573792feb6686d3de', - license = 'Apache2.0', - deps = [':xerces'], - attach_source = False, - visibility = [], -) - -maven_jar( - name = 'xerces', - id = 'xerces:xercesImpl:2.8.1', - sha1 = '25101e37ec0c907db6f0612cbf106ee519c1aef1', - license = 'Apache2.0', - attach_source = False, - visibility = [], -) diff --git a/lib/ow2/BUCK b/lib/ow2/BUCK deleted file mode 100644 index 653bd2bfc4..0000000000 --- a/lib/ow2/BUCK +++ /dev/null @@ -1,39 +0,0 @@ -include_defs('//lib/maven.defs') - -VERSION = '5.1' - -maven_jar( - name = 'ow2-asm', - id = 'org.ow2.asm:asm:' + VERSION, - sha1 = '5ef31c4fe953b1fd00b8a88fa1d6820e8785bb45', - license = 'ow2', -) - -maven_jar( - name = 'ow2-asm-analysis', - id = 'org.ow2.asm:asm-analysis:' + VERSION, - sha1 = '6d1bf8989fc7901f868bee3863c44f21aa63d110', - license = 'ow2', -) - -maven_jar( - name = 'ow2-asm-commons', - id = 'org.ow2.asm:asm-commons:' + VERSION, - sha1 = '25d8a575034dd9cfcb375a39b5334f0ba9c8474e', - deps = [':ow2-asm-tree'], - license = 'ow2', -) - -maven_jar( - name = 'ow2-asm-tree', - id = 'org.ow2.asm:asm-tree:' + VERSION, - sha1 = '87b38c12a0ea645791ead9d3e74ae5268d1d6c34', - license = 'ow2', -) - -maven_jar( - name = 'ow2-asm-util', - id = 'org.ow2.asm:asm-util:' + VERSION, - sha1 = 'b60e33a6bd0d71831e0c249816d01e6c1dd90a47', - license = 'ow2', -) diff --git a/lib/powermock/BUCK b/lib/powermock/BUCK deleted file mode 100644 index d469a85cff..0000000000 --- a/lib/powermock/BUCK +++ /dev/null @@ -1,73 +0,0 @@ -include_defs('//lib/maven.defs') - -VERSION = '1.6.1' # When bumping VERSION, make sure to also move -# easymock to a compatible version - -maven_jar( - name = 'powermock-module-junit4', - id = 'org.powermock:powermock-module-junit4:' + VERSION, - sha1 = 'ea8530b2848542624f110a393513af397b37b9cf', - license = 'DO_NOT_DISTRIBUTE', - deps = [ - ':powermock-module-junit4-common', - '//lib:junit', - ], -) - -maven_jar( - name = 'powermock-module-junit4-common', - id = 'org.powermock:powermock-module-junit4-common:' + VERSION, - sha1 = '7222ced54dabc310895d02e45c5428ca05193cda', - license = 'DO_NOT_DISTRIBUTE', - deps = [ - ':powermock-reflect', - '//lib:junit', - ], -) - -maven_jar( - name = 'powermock-reflect', - id = 'org.powermock:powermock-reflect:' + VERSION, - sha1 = '97d25eda8275c11161bcddda6ef8beabd534c878', - license = 'DO_NOT_DISTRIBUTE', - deps = [ - '//lib:junit', - '//lib/easymock:objenesis', - ], -) - -maven_jar( - name = 'powermock-api-easymock', - id = 'org.powermock:powermock-api-easymock:' + VERSION, - sha1 = 'aa740ecf89a2f64d410b3d93ef8cd6833009ef00', - license = 'DO_NOT_DISTRIBUTE', - deps = [ - ':powermock-api-support', - '//lib/easymock:easymock', - ], -) - -maven_jar( - name = 'powermock-api-support', - id = 'org.powermock:powermock-api-support:' + VERSION, - sha1 = '592ee6d929c324109d3469501222e0c76ccf0869', - license = 'DO_NOT_DISTRIBUTE', - deps = [ - ':powermock-core', - ':powermock-reflect', - '//lib:junit', - ], -) - -maven_jar( - name = 'powermock-core', - id = 'org.powermock:powermock-core:' + VERSION, - sha1 = '5afc1efce8d44ed76b30af939657bd598e45d962', - license = 'DO_NOT_DISTRIBUTE', - deps = [ - ':powermock-reflect', - '//lib:javassist', - '//lib:junit', - ], -) - diff --git a/lib/prolog/BUCK b/lib/prolog/BUCK deleted file mode 100644 index 854b0f7cfc..0000000000 --- a/lib/prolog/BUCK +++ /dev/null @@ -1,64 +0,0 @@ -include_defs('//lib/maven.defs') - -VERSION = '1.4.2' -REPO = GERRIT - -maven_jar( - name = 'runtime', - id = 'com.googlecode.prolog-cafe:prolog-runtime:' + VERSION, - sha1 = '4421b4806b6e3a318680f6ab1d57569e857169c6', - license = 'prologcafe', - repository = REPO, -) - -maven_jar( - name = 'compiler', - id = 'com.googlecode.prolog-cafe:prolog-compiler:' + VERSION, - sha1 = '7e5a7ca5efe7db7f69e015cf492f8f04665244d8', - license = 'prologcafe', - repository = REPO, - deps = [ - ':io', - ':runtime', - ], -) - -maven_jar( - name = 'io', - id = 'com.googlecode.prolog-cafe:prolog-io:' + VERSION, - sha1 = 'd177f6211d1013e0f31a507127f5c87a7f6941f3', - license = 'prologcafe', - repository = REPO, - deps = [':runtime'], - visibility = [], -) - -maven_jar( - name = 'cafeteria', - id = 'com.googlecode.prolog-cafe:prolog-cafeteria:' + VERSION, - sha1 = '11f396cb2588b65e6a78070488aaa58d12bf000e', - license = 'prologcafe', - repository = REPO, - deps = [ - ':io', - ':runtime', - ], - visibility = ['//gerrit-pgm:'], -) - -java_binary( - name = 'compiler_bin', - main_class = 'BuckPrologCompiler', - deps = [':compiler_lib'], - visibility = ['PUBLIC'], -) - -java_library( - name = 'compiler_lib', - srcs = ['java/BuckPrologCompiler.java'], - deps = [ - ':compiler', - ':runtime', - ], - visibility = ['//tools/eclipse:classpath'], -) diff --git a/lib/prolog/prolog.defs b/lib/prolog/prolog.defs deleted file mode 100644 index e74c21d3d7..0000000000 --- a/lib/prolog/prolog.defs +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (C) 2013 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -def prolog_cafe_library( - name, - srcs, - deps = [], - visibility = []): - genrule( - name = name + '__pl2j', - cmd = '$(exe //lib/prolog:compiler_bin)' + - ' $TMP $OUT ' + - ' '.join(srcs), - srcs = srcs, - out = name + '.src.zip', - ) - java_library( - name = name + '__lib', - srcs = [':' + name + '__pl2j'], - deps = ['//lib/prolog:runtime'] + deps, - ) - genrule( - name = name + '__ln', - cmd = 'ln -s $(location :%s__lib) $OUT' % name, - out = name + '.jar', - ) - prebuilt_jar( - name = name, - binary_jar = ':%s__ln' % name, - visibility = visibility, - ) diff --git a/plugins/BUCK b/plugins/BUCK deleted file mode 100644 index c6bb7f1824..0000000000 --- a/plugins/BUCK +++ /dev/null @@ -1,42 +0,0 @@ -BASE = get_base_path() -CORE = [ - 'commit-message-length-validator', - 'download-commands', - 'hooks', - 'replication', - 'reviewnotes', - 'singleusergroup' -] -CUSTOM = [ - # Add custom core plugins here -] - -# buck audit parses and resolves all deps even if not reachable -# from the root(s) passed to audit. Filter dependencies to only -# the ones that currently exist to allow buck to parse cleanly. -# TODO(sop): buck should more lazily resolve deps -def core_plugins(names): - from os import path - h, n = [], [] - for p in names: - if path.exists(path.join(BASE, p, 'BUCK')): - h.append(p) - else: - n.append(p) - return h, n -HAVE, NEED = core_plugins(CORE + CUSTOM) - -genrule( - name = 'core', - cmd = '' + - ';'.join(['echo >&2 plugins/'+n+' is required.' for n in NEED]) + - (';echo >&2;exit 1;' if NEED else '') + - 'mkdir -p $TMP/WEB-INF/plugins;' + - 'for s in ' + - ' '.join(['$(location //%s/%s:%s)' % (BASE, n, n) for n in HAVE]) + - ';do ln -s $s $TMP/WEB-INF/plugins;done;' + - 'cd $TMP;' + - 'zip -qr $OUT .', - out = 'core.zip', - visibility = ['//:release'], -) diff --git a/polygerrit-ui/BUCK b/polygerrit-ui/BUCK deleted file mode 100644 index b5dee99f4a..0000000000 --- a/polygerrit-ui/BUCK +++ /dev/null @@ -1,35 +0,0 @@ -include_defs('//lib/js.defs') - -bower_components( - name = 'polygerrit_components', - deps = [ - '//lib/js:es6-promise', - '//lib/js:fetch', - '//lib/js:highlightjs', - '//lib/js:iron-a11y-keys-behavior', - '//lib/js:iron-autogrow-textarea', - '//lib/js:iron-dropdown', - '//lib/js:iron-input', - '//lib/js:iron-overlay-behavior', - '//lib/js:iron-selector', - '//lib/js:moment', - '//lib/js:page', - '//lib/js:polymer', - '//lib/js:promise-polyfill', - ], -) - -genrule( - name = 'fonts', - cmd = ' && '.join([ - 'cd $TMP', - 'mkdir fonts', - 'for file in $SRCS; do echo `pwd` > /tmp/log.log; unzip -qd fonts/ $file; done', - 'zip -qr $OUT fonts', - ]), - srcs = [ - '//lib/fonts:sourcecodepro', - ], - out = 'fonts.zip', - visibility = ['PUBLIC'], -) diff --git a/polygerrit-ui/README.md b/polygerrit-ui/README.md index 28d028b0e6..e4e27df3cb 100644 --- a/polygerrit-ui/README.md +++ b/polygerrit-ui/README.md @@ -13,11 +13,11 @@ brew install node All other platforms: [download from nodejs.org](https://nodejs.org/en/download/). -## Installing [Buck](https://buckbuild.com/) +## Installing [Bazel](https://bazel.build/) Follow the instructions -[here](https://gerrit-review.googlesource.com/Documentation/dev-buck.html#_installation) -to get and install Buck. +[here](https://gerrit-review.googlesource.com/Documentation/dev-bazel.html#_installation) +to get and install Bazel. ## Local UI, Production Data @@ -59,7 +59,7 @@ Then visit http://localhost:8081 One-time setup: -1. [Build Gerrit](https://gerrit-review.googlesource.com/Documentation/dev-buck.html#_gerrit_development_war_file) +1. [Build Gerrit](https://gerrit-review.googlesource.com/Documentation/dev-bazel.html#_gerrit_development_war_file) 2. Set up a local test site. Docs [here](https://gerrit-review.googlesource.com/Documentation/install-quick.html) and [here](https://gerrit-review.googlesource.com/Documentation/dev-readme.html#init). @@ -68,8 +68,8 @@ When your project is set up and works using the classic UI, run a test server that serves PolyGerrit: ```sh -buck build polygerrit && \ -java -jar buck-out/gen/polygerrit/polygerrit.war daemon --polygerrit-dev \ +bazel build polygerrit && \ +java -jar bazel-out/polygerrit.war daemon --polygerrit-dev \ -d ../gerrit_testsite --console-log --show-stack-trace ``` @@ -91,16 +91,13 @@ sudo npm install -g web-component-tester Run all web tests: ```sh -buck test --no-results-cache --include web +./polygerrit-ui/app/run_test.sh ``` -The `--no-results-cache` flag prevents flaky test failures from being -cached. - If you need to pass additional arguments to `wct`: ```sh -WCT_ARGS='-p --some-flag="foo bar"' buck test --no-results-cache --include web +WCT_ARGS='-p --some-flag="foo bar"' ./polygerrit-ui/app/run_test.sh ``` For interactively working on a single test file, do the following: @@ -111,14 +108,6 @@ For interactively working on a single test file, do the following: Then visit http://localhost:8081/elements/foo/bar_test.html -## Running tests (bazel) - -Run - -```sh -WCT_ARGS='--some-flag' sh polygerrit-ui/app/run_test.sh -``` - ## Style guide We follow the [Google JavaScript Style Guide](https://google.github.io/styleguide/javascriptguide.xml) diff --git a/polygerrit-ui/app/BUCK b/polygerrit-ui/app/BUCK deleted file mode 100644 index 5d4f06ddd9..0000000000 --- a/polygerrit-ui/app/BUCK +++ /dev/null @@ -1,99 +0,0 @@ -include_defs('//lib/js.defs') - -WCT_TEST_PATTERNS = [ - 'test/*.js', - 'test/*.html', - '**/*_test.html', -] -PY_TEST_PATTERNS = ['polygerrit_wct_tests.py'] -APP_SRCS = glob( - ['**'], - excludes = [ - 'BUCK', - 'BUILD', - 'index.html', - 'test/**', - ] + WCT_TEST_PATTERNS + PY_TEST_PATTERNS) - -# List libraries to be copied statically into the build. (i.e. Libraries not -# expected to be Vulcanized.) -WEB_JS_LIBS = [ - ('bower_components/webcomponentsjs', 'webcomponents-lite.js'), - ('bower_components/highlightjs', 'highlight.min.js'), -] - -# Map the static libraries to commands for the polygerrit_ui rule. -JS_LIBS_MKDIR_CMDS = [] -JS_LIBS_UNZIP_CMDS = [] -for lib in WEB_JS_LIBS: - JS_LIBS_MKDIR_CMDS.append('mkdir -p ' + lib[0]) - path = lib[0] + '/' + lib[1] - cmd = 'unzip -p $(location //polygerrit-ui:polygerrit_components) %s>%s' % (path, path) - JS_LIBS_UNZIP_CMDS.append(cmd) - -# TODO(dborowitz): Putting these rules in this package avoids having to handle -# the app/ prefix like we would have to if this were in the parent directory. -# The only reason for the app subdirectory in the first place was convenience -# when witing server.go; when that goes away, we can just move all the files and -# these rules up one directory. -genrule( - name = 'polygerrit_ui', - cmd = ' && '.join([ - 'mkdir $TMP/polygerrit_ui', - 'cd $TMP/polygerrit_ui', - 'mkdir -p {fonts,elements}', - ' && '.join(JS_LIBS_MKDIR_CMDS), - 'unzip -qd . $(location //polygerrit-ui:fonts)', - 'unzip -qd elements $(location :gr-app)', - 'cp -rp $SRCDIR/* .', - ' && '.join(JS_LIBS_UNZIP_CMDS), - 'cd $TMP', - 'zip -9qr $OUT .', - ]), - srcs = glob([ - 'favicon.ico', - 'index.html', - 'styles/**/*.css' - ]), - out = 'polygerrit_ui.zip', - visibility = ['PUBLIC'], -) - -vulcanize( - name = 'gr-app', - app = 'elements/gr-app.html', - srcs = APP_SRCS, - components = '//polygerrit-ui:polygerrit_components', -) - -bower_components( - name = 'test_components', - deps = [ - '//polygerrit-ui:polygerrit_components', - '//lib/js:iron-test-helpers', - '//lib/js:test-fixture', - '//lib/js:web-component-tester', - ], -) - -genrule( - name = 'test_resources', - cmd = ' && '.join([ - 'cd $TMP', - 'unzip -q $(location :test_components)', - 'cp -r $SRCDIR/* .', - 'zip -r $OUT .', - ]), - srcs = APP_SRCS + glob(WCT_TEST_PATTERNS), - out = 'test_resources.zip', -) - -python_test( - name = 'polygerrit_tests', - srcs = glob(PY_TEST_PATTERNS), - resources = [':test_resources'], - labels = [ - 'manual', - 'web', - ], -) diff --git a/polygerrit-ui/app/polygerrit_wct_tests.py b/polygerrit-ui/app/polygerrit_wct_tests.py deleted file mode 100644 index eb34fef789..0000000000 --- a/polygerrit-ui/app/polygerrit_wct_tests.py +++ /dev/null @@ -1,118 +0,0 @@ -# Copyright (C) 2015 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from __future__ import print_function - -import atexit -from distutils import spawn -import json -import os -import pkg_resources -import shlex -import shutil -import subprocess -import sys -import tempfile -import unittest -import zipfile - - -def _write_wct_conf(root, exports): - with open(os.path.join(root, 'wct.conf.js'), 'w') as f: - f.write('module.exports = %s;\n' % json.dumps(exports)) - - -def _wct_cmd(): - return ['wct'] + shlex.split(os.environ.get('WCT_ARGS', '')) - - -class PolyGerritWctTests(unittest.TestCase): - - # Should really be setUpClass/tearDownClass, but Buck's test runner doesn't - # produce sane stack traces from those methods. There's only one test method - # anyway, so just use setUp. - - def _check_wct(self): - self.assertTrue( - spawn.find_executable('wct'), - msg='wct not found; try `npm install -g web-component-tester`') - - def _extract_resources(self): - tmpdir = tempfile.mkdtemp() - atexit.register(lambda: shutil.rmtree(tmpdir)) - root = os.path.join(tmpdir, 'polygerrit') - os.mkdir(root) - - tr = 'test_resources.zip' - zip_path = os.path.join(tmpdir, tr) - s = pkg_resources.resource_stream(__name__, tr) - with open(zip_path, 'w') as f: - shutil.copyfileobj(s, f) - - with zipfile.ZipFile(zip_path, 'r') as z: - z.extractall(root) - - return tmpdir, root - - def test_wct(self): - self._check_wct() - tmpdir, root = self._extract_resources() - - cmd = _wct_cmd() - print('Running %s in %s' % (cmd, root), file=sys.stderr) - - _write_wct_conf(root, { - 'suites': ['test'], - 'webserver': { - 'pathMappings': [ - {'/components/bower_components': 'bower_components'}, - ], - }, - 'plugins': { - 'local': { - # For some reason wct tries to install selenium into its node_modules - # directory on first run. If you've installed into /usr/local and - # aren't running wct as root, you're screwed. Turning this option off - # seems to still work, so there's that. - 'skipSeleniumInstall': True, - }, - 'sauce': { - # Disabled by default in order to run local tests only. - # Run it with (saucelabs.com account required; free for open source): - # WCT_ARGS='--plugin sauce' buck test --no-results-cache --include web - 'disabled': True, - 'browsers': [ - 'OS X 10.11/chrome', - 'Windows 10/chrome', - 'Linux/firefox', - 'OS X 10.11/safari', - 'Windows 10/microsoftedge', - ], - }, - }, - }) - - p = subprocess.Popen(cmd, cwd=root, - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out, err = p.communicate() - sys.stdout.write(out) - sys.stderr.write(err) - self.assertEquals(0, p.returncode) - - # Only remove tmpdir if successful, to allow debugging. - shutil.rmtree(tmpdir) - - -if __name__ == '__main__': - unittest.main() diff --git a/polygerrit-ui/app/wct_test.sh b/polygerrit-ui/app/wct_test.sh index 10de424605..e6f3e0ec6f 100755 --- a/polygerrit-ui/app/wct_test.sh +++ b/polygerrit-ui/app/wct_test.sh @@ -19,8 +19,7 @@ cp $TEST_SRCDIR/gerrit/polygerrit-ui/app/test/index.html $t/test/ # Sauce tests are disabled by default in order to run local tests # only. Run it with (saucelabs.com account required; free for open -# source): WCT_ARGS='--plugin sauce' buck test --no-results-cache -# --include web +# source): WCT_ARGS='--plugin sauce' ./polygerrit-ui/app/run_test.sh cat < $t/wct.conf.js module.exports = { diff --git a/polygerrit-ui/run-server.sh b/polygerrit-ui/run-server.sh index e6d782f8c2..139e846cc1 100755 --- a/polygerrit-ui/run-server.sh +++ b/polygerrit-ui/run-server.sh @@ -15,22 +15,22 @@ set -eu -while [[ ! -f .buckconfig && "$PWD" != / ]]; do +while [[ ! -f WORKSPACE && "$PWD" != / ]]; do cd .. done -if [[ ! -f .buckconfig ]]; then +if [[ ! -f WORKSPACE ]]; then echo "$(basename "$0"): must be run from a gerrit checkout" 1>&2 exit 1 fi -buck build \ - //polygerrit-ui/app:test_components \ - //polygerrit-ui:fonts +bazel build \ + polygerrit-ui:polygerrit_components.bower_components.zip \ + //polygerrit-ui:fonts.zip cd polygerrit-ui/app rm -rf bower_components -unzip -q ../../buck-out/gen/polygerrit-ui/app/test_components/test_components.bower_components.zip +unzip -q ../../bazel-bin/polygerrit-ui/polygerrit_components.bower_components.zip rm -rf fonts -unzip -q ../../buck-out/gen/polygerrit-ui/fonts/fonts.zip -d fonts +unzip -q ../../bazel-bin/polygerrit-ui/fonts.zip -d fonts cd .. exec go run server.go "$@" diff --git a/tools/BUCK b/tools/BUCK deleted file mode 100644 index 489dffc8e8..0000000000 --- a/tools/BUCK +++ /dev/null @@ -1,51 +0,0 @@ -python_binary( - name = 'download_file', - main = 'download_file.py', - deps = [':util'], - visibility = ['PUBLIC'], -) - -python_binary( - name = 'merge_jars', - main = 'merge_jars.py', - visibility = ['PUBLIC'], -) - -python_binary( - name = 'pack_war', - main = 'pack_war.py', - deps = [':util'], - visibility = ['PUBLIC'], -) - -python_library( - name = 'util', - srcs = [ - 'util.py', - '__init__.py' - ], - visibility = ['PUBLIC'], -) - -python_test( - name = 'util_test', - srcs = ['util_test.py'], - deps = [':util'], - visibility = ['PUBLIC'], -) - -def shquote(s): - return s.replace("'", "'\\''") - -def os_path(): - from os import environ - return environ.get('PATH') - -genrule( - name = 'buck', - cmd = 'echo buck=`which buck`>$OUT;' + - ("echo PATH=\''%s'\' >>$OUT;" % shquote(os_path())), - out = 'buck.properties', - visibility = ['PUBLIC'], -) - diff --git a/tools/build.defs b/tools/build.defs deleted file mode 100644 index 3ea506c806..0000000000 --- a/tools/build.defs +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright (C) 2013 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# These definitions support building a runnable version of Gerrit. - -DOCS_HTML = '//Documentation:html' -DOCS_LIB = '//Documentation:index_lib' -LIBS = [ - '//gerrit-war:log4j-config', - '//gerrit-war:init', - '//lib:postgresql', - '//lib/log:impl_log4j', -] -PGMLIBS = ['//gerrit-pgm:pgm'] - -def scan_plugins(): - import os - deps = [] - for n in os.listdir('plugins'): - if os.path.exists(os.path.join('plugins', n, 'BUCK')): - deps.append('//plugins/%s:%s__plugin' % (n, n)) - return deps - -def war( - name, - libs = [], - pgmlibs = [], - context = [], - visibility = [], - docs = False - ): - cmd = ['$(exe //tools:pack_war)', '-o', '$OUT', '--tmp', '$TMP'] - for l in libs: - cmd.extend(['--lib', '$(classpath %s)' % l]) - for l in pgmlibs: - cmd.extend(['--pgmlib', '$(classpath %s)' % l]) - - if docs: - cmd.append('$(location %s)' % DOCS_HTML) - cmd.extend(['--lib', '$(classpath %s)' % DOCS_LIB]) - if context: - for t in context: - cmd.append('$(location %s)' % t) - - genrule( - name = name, - cmd = ' '.join(cmd), - out = name + '.war', - visibility = visibility, - ) - -def gerrit_war(name, ui = 'ui_optdbg', context = [], docs = False, visibility = []): - ui_deps = [] - if ui: - if ui == 'polygerrit' or ui == 'ui_optdbg' or ui == 'ui_optdbg_r': - ui_deps.append('//polygerrit-ui/app:polygerrit_ui') - if ui != 'polygerrit': - ui_deps.append('//gerrit-gwtui:%s' % ui) - war( - name = name, - libs = LIBS + ['//gerrit-war:version'], - pgmlibs = PGMLIBS, - context = ui_deps + context + [ - '//gerrit-main:main_bin', - '//gerrit-war:webapp_assets', - ], - docs = docs, - visibility = visibility, - ) diff --git a/tools/default.defs b/tools/default.defs deleted file mode 100644 index fa1800b50a..0000000000 --- a/tools/default.defs +++ /dev/null @@ -1,231 +0,0 @@ -# Copyright (C) 2013 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Rule definitions loaded by default into every BUCK file. - -include_defs('//lib/auto/auto_value.defs') -include_defs('//tools/gwt-constants.defs') -include_defs('//tools/java_doc.defs') -include_defs('//tools/java_sources.defs') -include_defs('//tools/git.defs') -import copy -import traceback -import os -from multiprocessing import cpu_count - -# Set defaults on java rules: -# - Add AutoValue annotation processing support. -# - Treat source files as UTF-8. - -_buck_java_library = java_library -def java_library(*args, **kwargs): - _munge_args(kwargs) - _buck_java_library(*args, **kwargs) - -_buck_java_test = java_test -def java_test(*args, **kwargs): - _munge_args(kwargs) - _buck_java_test(*args, **kwargs) - - -# Munge kwargs to set Gerrit-specific defaults. -def _munge_args(kwargs): - if read_config('sanitizers', 'error_prone'): - _set_error_prone(kwargs) - _set_auto_value(kwargs) - _set_extra_arguments(kwargs) - -def _set_error_prone(kwargs): - kwargs['javac_jar'] = '//lib:errorprone' - kwargs['compiler_class_name'] = 'com.google.errorprone.ErrorProneJavaCompiler' - -def _set_extra_arguments(kwargs): - ext = 'extra_arguments' - if ext not in kwargs: - kwargs[ext] = [] - extra_args = kwargs[ext] - - for arg in extra_args: - if arg.startswith('-encoding'): - return - - extra_args.extend(['-encoding', 'UTF-8']) - -def _set_auto_value(kwargs): - apk = 'annotation_processors' - if apk not in kwargs: - kwargs[apk] = [] - aps = kwargs.get(apk, []) - - apdk = 'annotation_processor_deps' - if apdk not in kwargs: - kwargs[apdk] = [] - apds = kwargs.get(apdk, []) - - all_deps = kwargs.get('deps', []) + kwargs.get('exported_deps', []) - if AUTO_VALUE_DEP in all_deps: - aps.extend(AUTO_VALUE_PROCESSORS) - apds.extend(AUTO_VALUE_PROCESSOR_DEPS) - - -# Add 'license' argument to genrule. -_buck_genrule = genrule -def genrule(*args, **kwargs): - license = kwargs.pop('license', None) - if license: - license = '//lib:LICENSE-%s' % license - # genrule has no deps attribute, but locations listed in the command show - # up as deps of the target with buck audit. - kwargs['cmd'] = 'true $(location %s); %s' % (license, kwargs['cmd']) - _buck_genrule(*args, **kwargs) - - -def genantlr( - name, - srcs, - out): - genrule( - name = name, - srcs = srcs, - cmd = '$(exe //lib/antlr:antlr-tool) -o $TMP $SRCS;' + - 'cd $TMP;' + - 'zip -qr $OUT .', - out = out, - ) - -def gwt_module(gwt_xml=None, **kwargs): - kw = copy.deepcopy(kwargs) - if 'resources' not in kw: - kw['resources'] = [] - if gwt_xml: - kw['resources'] += [gwt_xml] - if 'srcs' in kw: - kw['resources'] += kw['srcs'] - - # Buck does not accept duplicate resources. Callers may have - # included gwt_xml or srcs as part of resources, so de-dupe. - kw['resources'] = list(set(kw['resources'])) - - java_library(**kw) - -def gerrit_extension( - name, - deps = [], - provided_deps = [], - srcs = [], - resources = [], - manifest_file = None, - manifest_entries = [], - visibility = ['PUBLIC']): - gerrit_plugin( - name = name, - deps = deps, - provided_deps = provided_deps, - srcs = srcs, - resources = resources, - manifest_file = manifest_file, - manifest_entries = manifest_entries, - type = 'extension', - visibility = visibility, - ) - -def gerrit_plugin( - name, - deps = [], - provided_deps = [], - srcs = [], - resources = [], - gwt_module = None, - manifest_file = None, - manifest_entries = [], - type = 'plugin', - visibility = ['PUBLIC'], - target_suffix = ''): - tb = traceback.extract_stack() - calling_BUCK_file = tb[-2][0] - calling_BUCK_dir = os.path.abspath(os.path.dirname(calling_BUCK_file)) - mf_cmd = 'v=%s;' % git_describe(calling_BUCK_dir) - if manifest_file: - mf_src = [manifest_file] - mf_cmd += 'sed "s:@VERSION@:$v:g" $SRCS >$OUT' - else: - mf_src = [] - mf_cmd += 'echo "Manifest-Version: 1.0" >$OUT;' - mf_cmd += 'echo "Gerrit-ApiType: %s" >>$OUT;' % type - mf_cmd += 'echo "Implementation-Version: $v" >>$OUT;' - mf_cmd += 'echo "Implementation-Vendor: Gerrit Code Review" >>$OUT' - for line in manifest_entries: - line = line.replace('$', '\$') - mf_cmd += ';echo "%s" >> $OUT' % line - genrule( - name = name + '__manifest', - cmd = mf_cmd, - srcs = mf_src, - out = 'MANIFEST.MF', - ) - static_jars = [] - if gwt_module: - static_jars = [':%s-static-jar' % name] - java_library( - name = name + '__plugin', - srcs = srcs, - resources = resources, - deps = deps, - provided_deps = ['//gerrit-%s-api:lib' % type] + - provided_deps + - GWT_PLUGIN_DEPS, - visibility = ['PUBLIC'], - ) - if gwt_module: - java_library( - name = name + '__gwt_module', - srcs = [], - resources = list(set(srcs + resources)), - deps = deps, - provided_deps = GWT_PLUGIN_DEPS, - visibility = ['PUBLIC'], - ) - prebuilt_jar( - name = '%s-static-jar' % name, - binary_jar = ':%s-static' % name, - ) - genrule( - name = '%s-static' % name, - cmd = 'mkdir -p $TMP/static' + - ';unzip -qd $TMP/static $(location %s)' % - ':%s__gwt_application' % name + - ';cd $TMP' + - ';zip -qr $OUT .', - out = '%s-static.jar' % name, - ) - gwt_binary( - name = name + '__gwt_application', - modules = [gwt_module], - deps = GWT_PLUGIN_DEPS + GWT_TRANSITIVE_DEPS + ['//lib/gwt:dev'], - module_deps = [':%s__gwt_module' % name], - local_workers = cpu_count(), - strict = True, - experimental_args = GWT_COMPILER_ARGS, - vm_args = GWT_JVM_ARGS, - ) - - java_binary( - name = name + target_suffix, - manifest_file = ':%s__manifest' % name, - merge_manifests = False, - deps = [ - ':%s__plugin' % name, - ] + static_jars, - visibility = visibility, - ) diff --git a/tools/download_all.py b/tools/download_all.py deleted file mode 100755 index 58316ca2ed..0000000000 --- a/tools/download_all.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2013 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from optparse import OptionParser -import re -from subprocess import check_call, CalledProcessError, Popen, PIPE - -MAIN = ['//tools/eclipse:classpath'] -PAT = re.compile(r'"(//.*?)" -> "//tools:download_file"') - -opts = OptionParser() -opts.add_option('--src', action='store_true') -args, _ = opts.parse_args() - -targets = set() - -p = Popen(['buck', 'audit', 'classpath', '--dot'] + MAIN, stdout = PIPE) -for line in p.stdout: - m = PAT.search(line) - if m: - n = m.group(1) - if args.src and n.endswith('__download_bin'): - n = n[:-13] + 'src' - targets.add(n) -r = p.wait() -if r != 0: - exit(r) - -try: - check_call(['buck', 'build'] + sorted(targets)) -except CalledProcessError as err: - exit(1) diff --git a/tools/download_file.py b/tools/download_file.py index c9c6ef0de0..8f5aa7c4f2 100755 --- a/tools/download_file.py +++ b/tools/download_file.py @@ -25,6 +25,7 @@ from util import hash_file, resolve_url from zipfile import ZipFile, BadZipfile, LargeZipFile GERRIT_HOME = path.expanduser('~/.gerritcodereview') +# TODO(davido): Rename in bazel-cache CACHE_DIR = path.join(GERRIT_HOME, 'buck-cache', 'downloaded-artifacts') LOCAL_PROPERTIES = 'local.properties' @@ -86,7 +87,7 @@ args, _ = opts.parse_args() root_dir = args.o while root_dir and root_dir != "/": root_dir, n = path.split(root_dir) - if n == 'buck-out': + if n == 'WORKSPACE': break redirects = download_properties(root_dir) diff --git a/tools/eclipse/BUCK b/tools/eclipse/BUCK deleted file mode 100644 index a8b3f01671..0000000000 --- a/tools/eclipse/BUCK +++ /dev/null @@ -1,37 +0,0 @@ -include_defs('//tools/build.defs') - -java_library( - name = 'classpath', - deps = LIBS + PGMLIBS + [ - '//gerrit-acceptance-tests:lib', - '//gerrit-gpg:gpg_tests', - '//gerrit-gwtdebug:gwtdebug', - '//gerrit-gwtui:ui_module', - '//gerrit-gwtui:ui_tests', - '//gerrit-httpd:httpd_tests', - '//gerrit-main:main_lib', - '//gerrit-patch-jgit:jgit_patch_tests', - '//gerrit-plugin-gwtui:gwtui-api-lib', - '//gerrit-reviewdb:client_tests', - '//gerrit-server:server', - '//gerrit-server:server_tests', - '//lib/asciidoctor:asciidoc_lib', - '//lib/asciidoctor:doc_indexer_lib', - '//lib/auto:auto-value', - '//lib/bouncycastle:bcprov', - '//lib/bouncycastle:bcpg', - '//lib/bouncycastle:bcpkix', - '//lib/gwt:ant', - '//lib/gwt:colt', - '//lib/gwt:javax-validation', - '//lib/gwt:javax-validation_src', - '//lib/gwt:jsinterop-annotations', - '//lib/gwt:jsinterop-annotations_src', - '//lib/gwt:tapestry', - '//lib/gwt:w3c-css-sac', - '//lib/jetty:servlets', - '//lib/prolog:compiler_lib', - '//polygerrit-ui:polygerrit_components', - '//Documentation:index_lib', - ] + scan_plugins(), -) diff --git a/tools/eclipse/project.py b/tools/eclipse/project.py deleted file mode 100755 index 46cd9fcb2c..0000000000 --- a/tools/eclipse/project.py +++ /dev/null @@ -1,265 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2013 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# TODO(sop): Remove hack after Buck supports Eclipse - -from __future__ import print_function -from optparse import OptionParser -from os import makedirs, path -from subprocess import Popen, PIPE, CalledProcessError, check_call -from xml.dom import minidom -import re -import sys - -MAIN = ['//tools/eclipse:classpath'] -GWT = ['//gerrit-gwtui:ui_module'] -JRE = '/'.join([ - 'org.eclipse.jdt.launching.JRE_CONTAINER', - 'org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType', - 'JavaSE-1.8', -]) - -ROOT = path.abspath(__file__) -while not path.exists(path.join(ROOT, '.buckconfig')): - ROOT = path.dirname(ROOT) - -opts = OptionParser() -opts.add_option('--src', action='store_true', - help='(deprecated) attach sources') -opts.add_option('--no-src', dest='no_src', action='store_true', - help='do not attach sources') -opts.add_option('--plugins', help='create eclipse projects for plugins', - action='store_true') -opts.add_option('--name', help='name of the generated project', - action='store', default='gerrit', dest='project_name') -args, _ = opts.parse_args() - -def _query_classpath(targets): - deps = [] - p = Popen(['buck', 'audit', 'classpath'] + targets, stdout=PIPE) - for line in p.stdout: - deps.append(line.strip()) - s = p.wait() - if s != 0: - exit(s) - return deps - - -def gen_project(name='gerrit', root=ROOT): - p = path.join(root, '.project') - with open(p, 'w') as fd: - print("""\ - - - """ + name + """ - - - org.eclipse.jdt.core.javabuilder - - - - org.eclipse.jdt.core.javanature - -\ -""", file=fd) - -def gen_primary_build_tool(): - with open(path.join(ROOT, ".primary_build_tool"), 'w') as fd: - fd.write("buck") - -def gen_plugin_classpath(root): - p = path.join(root, '.classpath') - with open(p, 'w') as fd: - if path.exists(path.join(root, 'src', 'test', 'java')): - testpath = """ - """ - else: - testpath = "" - print("""\ - - - %(testpath)s - - - -""" % {"testpath": testpath}, file=fd) - -def gen_classpath(): - def make_classpath(): - impl = minidom.getDOMImplementation() - return impl.createDocument(None, 'classpath', None) - - def classpathentry(kind, path, src=None, out=None, exported=None): - e = doc.createElement('classpathentry') - e.setAttribute('kind', kind) - # TODO(davido): Remove this and other exclude BUILD files hack - # when this Bazel bug is fixed: - # https://github.com/bazelbuild/bazel/issues/1083 - if kind == 'src': - e.setAttribute('excluding', '**/BUILD') - e.setAttribute('path', path) - if src: - e.setAttribute('sourcepath', src) - if out: - e.setAttribute('output', out) - if exported: - e.setAttribute('exported', 'true') - doc.documentElement.appendChild(e) - - doc = make_classpath() - src = set() - lib = set() - gwt_src = set() - gwt_lib = set() - plugins = set() - - # Classpath entries are absolute for cross-cell support - java_library = re.compile('.*/buck-out/gen/(.*)/lib__[^/]+__output/[^/]+[.]jar$') - srcs = re.compile('.*/(__.*__)/.*') - for p in _query_classpath(MAIN): - if p.endswith('-src.jar'): - # gwt_module() depends on -src.jar for Java to JavaScript compiles. - gwt_lib.add(p) - continue - - if 'buck-out/gen/lib/gwt/' in p: - # gwt_module() depends on huge shaded GWT JARs that import - # incorrect versions of classes for Gerrit. Collect into - # a private grouping for later use. - gwt_lib.add(p) - continue - - m = java_library.match(p) - if m: - src.add(m.group(1)) - else: - lib.add(p) - - for p in _query_classpath(GWT): - m = java_library.match(p) - if m: - gwt_src.add(m.group(1)) - - for s in sorted(src): - out = None - - if s.startswith('lib/'): - out = 'eclipse-out/lib' - elif s.startswith('plugins/'): - if args.plugins: - plugins.add(s) - continue - out = 'eclipse-out/' + s - - p = path.join(s, 'java') - if path.exists(p): - classpathentry('src', p, out=out) - continue - - for env in ['main', 'test']: - o = None - if out: - o = out + '/' + env - elif env == 'test': - o = 'eclipse-out/test' - - for srctype in ['java', 'resources']: - p = path.join(s, 'src', env, srctype) - if path.exists(p): - classpathentry('src', p, out=o) - - for libs in [lib, gwt_lib]: - for j in sorted(libs): - s = None - if j.endswith('.jar'): - s = j[:-4] + '-src.jar' - if not path.exists(s): - m = srcs.match(s) - if m: - l = m.group(1) - if l.endswith('__jar__'): - s = s.replace(l, l.replace('__jar__', '_src__')) - else: - s = s.replace(l, l[:-1] + 'src__') - if not path.exists(s): - s = None - else: - s = None - if args.plugins: - classpathentry('lib', j, s, exported=True) - else: - classpathentry('lib', j, s) - for s in sorted(gwt_src): - p = path.join(ROOT, s, 'src', 'main', 'java') - if path.exists(p): - classpathentry('lib', p, out='eclipse-out/gwtsrc') - - classpathentry('con', JRE) - classpathentry('output', 'eclipse-out/classes') - - p = path.join(ROOT, '.classpath') - with open(p, 'w') as fd: - doc.writexml(fd, addindent='\t', newl='\n', encoding='UTF-8') - - if args.plugins: - for plugin in plugins: - plugindir = path.join(ROOT, plugin) - try: - gen_project(plugin.replace('plugins/', ""), plugindir) - gen_plugin_classpath(plugindir) - except (IOError, OSError) as err: - print('error generating project for %s: %s' % (plugin, err), - file=sys.stderr) - -def gen_factorypath(): - doc = minidom.getDOMImplementation().createDocument(None, 'factorypath', None) - for jar in _query_classpath(['//lib/auto:auto-value']): - e = doc.createElement('factorypathentry') - e.setAttribute('kind', 'EXTJAR') - e.setAttribute('id', path.join(ROOT, jar)) - e.setAttribute('enabled', 'true') - e.setAttribute('runInBatchMode', 'false') - doc.documentElement.appendChild(e) - - p = path.join(ROOT, '.factorypath') - with open(p, 'w') as fd: - doc.writexml(fd, addindent='\t', newl='\n', encoding='UTF-8') - -try: - if not args.no_src: - try: - check_call([path.join(ROOT, 'tools', 'download_all.py'), '--src']) - except CalledProcessError as err: - exit(1) - - gen_project(args.project_name) - gen_classpath() - gen_factorypath() - gen_primary_build_tool() - - # TODO(davido): Remove this when GWT gone - gwt_working_dir = ".gwt_work_dir" - if not path.isdir(gwt_working_dir): - makedirs(path.join(ROOT, gwt_working_dir)) - - try: - targets = ['//tools:buck'] + MAIN + GWT - check_call(['buck', 'build', '--deep'] + targets) - except CalledProcessError as err: - exit(1) -except KeyboardInterrupt: - print('Interrupted by user', file=sys.stderr) - exit(1) diff --git a/tools/git.defs b/tools/git.defs deleted file mode 100644 index 859f1730cb..0000000000 --- a/tools/git.defs +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (C) 2013 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -def git_describe(directory = None): - import subprocess - cmd = ['git', 'describe', '--always', '--match', 'v[0-9].*', '--dirty'] - if not directory: - p = subprocess.Popen(cmd, stdout = subprocess.PIPE) - else: - p = subprocess.Popen(cmd, stdout = subprocess.PIPE, cwd = directory) - v = p.communicate()[0].strip() - r = p.returncode - if r != 0: - raise subprocess.CalledProcessError(r, ' '.join(cmd)) - return v diff --git a/tools/gwt-constants.defs b/tools/gwt-constants.defs deleted file mode 100644 index b76c04b648..0000000000 --- a/tools/gwt-constants.defs +++ /dev/null @@ -1,30 +0,0 @@ -GWT_JVM_ARGS = ['-Xmx512m'] - -GWT_COMPILER_ARGS = [ - '-XdisableClassMetadata', -] - -GWT_COMPILER_ARGS_RELEASE_MODE = GWT_COMPILER_ARGS + [ - '-XdisableCastChecking', -] - -GWT_PLUGIN_DEPS = [ - '//gerrit-plugin-gwtui:gwtui-api-lib', - '//lib/gwt:user', -] - -GWT_TRANSITIVE_DEPS = [ - '//lib/gwt:ant', - '//lib/gwt:colt', - '//lib/gwt:javax-validation', - '//lib/gwt:javax-validation_src', - '//lib/gwt:jsinterop-annotations', - '//lib/gwt:jsinterop-annotations_src', - '//lib/gwt:tapestry', - '//lib/gwt:w3c-css-sac', - '//lib/ow2:ow2-asm', - '//lib/ow2:ow2-asm-analysis', - '//lib/ow2:ow2-asm-commons', - '//lib/ow2:ow2-asm-tree', - '//lib/ow2:ow2-asm-util', -] diff --git a/tools/java_doc.defs b/tools/java_doc.defs deleted file mode 100644 index 583407c6d5..0000000000 --- a/tools/java_doc.defs +++ /dev/null @@ -1,38 +0,0 @@ -def java_doc( - name, - title, - pkgs, - source_jar, - srcs = [], - deps = [], - visibility = [], - external_docs = [], - ): - # TODO(davido): Actually we shouldn't need to extract the source - # archive, javadoc should just work with provided archive. - external_docs.insert(0, 'http://docs.oracle.com/javase/8/docs/api') - genrule( - name = name, - cmd = ' '.join([ - 'mkdir $TMP/sourcepath &&', - 'unzip $(location %s) -d $TMP/sourcepath &&' % source_jar, - 'javadoc', - '-Xdoclint:-missing', - '-quiet', - '-protected', - '-encoding UTF-8', - '-charset UTF-8', - '-notimestamp', - '-windowtitle "' + title + '"', - ' '.join(['-link %s' % url for url in external_docs]), - '-subpackages ', - ':'.join(pkgs), - '-sourcepath $TMP/sourcepath', - ' -classpath ', - ':'.join(['$(classpath %s)' % n for n in deps]), - '-d $TMP', - ]) + ';jar cf $OUT -C $TMP .', - srcs = srcs, - out = name + '.jar', - visibility = visibility, - ) diff --git a/tools/java_sources.defs b/tools/java_sources.defs deleted file mode 100644 index 0b3974ec7a..0000000000 --- a/tools/java_sources.defs +++ /dev/null @@ -1,10 +0,0 @@ -def java_sources( - name, - srcs, - visibility = [] - ): - java_library( - name = name, - resources = srcs, - visibility = visibility, - ) diff --git a/tools/js/BUCK b/tools/js/BUCK deleted file mode 100644 index 9eb0c91106..0000000000 --- a/tools/js/BUCK +++ /dev/null @@ -1,32 +0,0 @@ -python_binary( - name = 'bower2buck', - main = 'bower2buck.py', - deps = [ - '//tools:util', - ":bowerutil", - ], - visibility = ['PUBLIC'], -) - -python_library( - name = 'bowerutil', - srcs = [ 'bowerutil.py' ], - visibility = [ 'PUBLIC' ], -) - -python_binary( - name = 'download_bower', - main = 'download_bower.py', - deps = [ - '//tools:util', - ":bowerutil", - ], - visibility = ['PUBLIC'], -) - -python_binary( - name = 'run_npm_binary', - main = 'run_npm_binary.py', - deps = ['//tools:util'], - visibility = ['PUBLIC'], -) diff --git a/tools/js/bower2buck.py b/tools/js/bower2buck.py deleted file mode 100755 index d99b2824a2..0000000000 --- a/tools/js/bower2buck.py +++ /dev/null @@ -1,217 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2015 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from __future__ import print_function - -import atexit -import collections -import json -import hashlib -import optparse -import os -import shutil -import subprocess -import sys -import tempfile - -from tools.js import bowerutil - -# This script is run with `buck run`, but needs to shell out to buck; this is -# only possible if we avoid buckd. -BUCK_ENV = dict(os.environ) -BUCK_ENV['NO_BUCKD'] = '1' - -HEADER = """\ -include_defs('//lib/js.defs') - -# AUTOGENERATED BY BOWER2BUCK -# -# This file should be merged with an existing BUCK file containing these rules. -# -# This comment SHOULD NOT be copied to the existing BUCK file, and you should -# leave alone any non-bower_component contents of the file. -# -# Generally, the following attributes SHOULD be copied from this file to the -# existing BUCK file: -# - package: the normalized package name -# - version: the exact version number -# - deps: direct dependencies of the package -# - sha1: a hash of the package contents -# -# The following fields SHOULD NOT be copied to the existing BUCK file: -# - semver: manually-specified semantic version, not included in autogenerated -# output. -# -# The following fields require SPECIAL HANDLING: -# - license: all licenses in this file are specified as TODO. You must replace -# this text with one of the existing licenses defined in lib/BUCK, or -# define a new one if necessary. Leave existing licenses alone. - -""" - - -def usage(): - print(('Usage: %s -o [//path/to:bower_components_rule...]' - % sys.argv[0]), - file=sys.stderr) - return 1 - - -class Rule(object): - def __init__(self, bower_json_path): - with open(bower_json_path) as f: - bower_json = json.load(f) - self.name = bower_json['name'] - self.version = bower_json['version'] - self.deps = bower_json.get('dependencies', {}) - self.license = bower_json.get('license', 'NO LICENSE') - self.sha1 = bowerutil.hash_bower_component( - hashlib.sha1(), os.path.dirname(bower_json_path)).hexdigest() - - def to_rule(self, packages): - if self.name not in packages: - raise ValueError('No package name found for %s' % self.name) - - lines = [ - 'bower_component(', - " name = '%s'," % self.name, - " package = '%s'," % packages[self.name], - " version = '%s'," % self.version, - ] - if self.deps: - if len(self.deps) == 1: - lines.append(" deps = [':%s']," % next(self.deps.iterkeys())) - else: - lines.append(' deps = [') - lines.extend(" ':%s'," % d for d in sorted(self.deps.iterkeys())) - lines.append(' ],') - lines.extend([ - " license = 'TODO: %s'," % self.license, - " sha1 = '%s'," % self.sha1, - ')']) - return '\n'.join(lines) - - -def build_bower_json(targets, buck_out): - """create bower.json so 'bower install' fetches transitive deps""" - bower_json = collections.OrderedDict() - bower_json['name'] = 'bower2buck-output' - bower_json['version'] = '0.0.0' - bower_json['description'] = 'Auto-generated bower.json for dependency management' - bower_json['private'] = True - bower_json['dependencies'] = {} - - deps = subprocess.check_output( - ['buck', 'query', '-v', '0', - "filter('__download_bower', deps(%s))" % '+'.join(targets)], - env=BUCK_ENV) - - # __bower_version contains the version number coming from version - # attr in BUCK/BUILD - deps = deps.replace('__download_bower', '__bower_version').split() - subprocess.check_call(['buck', 'build'] + deps, env=BUCK_ENV) - - for dep in deps: - dep = dep.replace(':', '/').lstrip('/') - depout = os.path.basename(dep) - version_json = os.path.join(buck_out, 'gen', dep, depout) - with open(version_json) as f: - bower_json['dependencies'].update(json.load(f)) - - tmpdir = tempfile.mkdtemp() - atexit.register(lambda: shutil.rmtree(tmpdir)) - ret = os.path.join(tmpdir, 'bower.json') - with open(ret, 'w') as f: - json.dump(bower_json, f, indent=2) - return ret - - -def get_package_name(name, package_version): - v = package_version.lower() - if '#' in v: - return v[:v.find('#')] - return name - - -def get_packages(path): - with open(path) as f: - bower_json = json.load(f) - return dict((n, get_package_name(n, v)) - for n, v in bower_json.get('dependencies', {}).iteritems()) - - -def collect_rules(packages): - # TODO(dborowitz): Use run_npm_binary instead of system bower. - rules = {} - subprocess.check_call(['bower', 'install']) - for dirpath, dirnames, filenames in os.walk('.', topdown=True): - if '.bower.json' not in filenames: - continue - del dirnames[:] - rule = Rule(os.path.join(dirpath, '.bower.json')) - rules[rule.name] = rule - - # Oddly, the package name referred to in the deps section of dependents, - # e.g. 'PolymerElements/iron-ajax', is not found anywhere in this - # bower.json, which only contains 'iron-ajax'. Build up a map of short name - # to package name so we can resolve them later. - # TODO(dborowitz): We can do better: - # - Infer 'user/package' from GitHub URLs (i.e. a simple subset of Bower's package - # resolution logic). - # - Resolve aliases using https://bower.herokuapp.com/packages/shortname - # (not currently biting us but it might in the future.) - for n, v in rule.deps.iteritems(): - p = get_package_name(n, v) - old = packages.get(n) - if old is not None and old != p: - raise ValueError('multiple packages named %s: %s != %s' % (n, p, old)) - packages[n] = p - - return rules - - -def find_buck_out(): - dir = os.getcwd() - while not os.path.isfile(os.path.join(dir, '.buckconfig')): - dir = os.path.dirname(dir) - return os.path.join(dir, 'buck-out') - - -def main(args): - opts = optparse.OptionParser() - opts.add_option('-o', help='output file location') - opts, args = opts.parse_args() - - if not opts.o or not all(a.startswith('//') for a in args): - return usage() - outfile = os.path.abspath(opts.o) - buck_out = find_buck_out() - - targets = args if args else ['//polygerrit-ui/...'] - bower_json_path = build_bower_json(targets, buck_out) - os.chdir(os.path.dirname(bower_json_path)) - packages = get_packages(bower_json_path) - rules = collect_rules(packages) - - with open(outfile, 'w') as f: - f.write(HEADER) - for _, r in sorted(rules.iteritems()): - f.write('\n\n%s' % r.to_rule(packages)) - - print('Wrote bower_components rules to:\n %s' % outfile) - - -if __name__ == '__main__': - main(sys.argv[1:]) diff --git a/tools/maven/BUCK b/tools/maven/BUCK deleted file mode 100644 index 0541fc0a26..0000000000 --- a/tools/maven/BUCK +++ /dev/null @@ -1,33 +0,0 @@ -include_defs('//tools/maven/package.defs') -include_defs('//tools/maven/repository.defs') -include_defs('//version.bzl') - -if GERRIT_VERSION.endswith('-SNAPSHOT'): - URL = MAVEN_SNAPSHOT_URL -else: - URL = MAVEN_RELEASE_URL - -maven_package( - repository = MAVEN_REPOSITORY, - url = URL, - version = GERRIT_VERSION, - jar = { - 'gerrit-acceptance-framework': '//gerrit-acceptance-framework:acceptance-framework', - 'gerrit-extension-api': '//gerrit-extension-api:extension-api', - 'gerrit-plugin-api': '//gerrit-plugin-api:plugin-api', - 'gerrit-plugin-gwtui': '//gerrit-plugin-gwtui:gwtui-api', - }, - src = { - 'gerrit-acceptance-framework': '//gerrit-acceptance-framework:acceptance-framework-src', - 'gerrit-extension-api': '//gerrit-extension-api:extension-api-src', - 'gerrit-plugin-api': '//gerrit-plugin-api:plugin-api-src', - 'gerrit-plugin-gwtui': '//gerrit-plugin-gwtui:gwtui-api-src', - }, - doc = { - 'gerrit-acceptance-framework': '//gerrit-acceptance-framework:acceptance-framework-javadoc', - 'gerrit-extension-api': '//gerrit-extension-api:extension-api-javadoc', - 'gerrit-plugin-api': '//gerrit-plugin-api:plugin-api-javadoc', - 'gerrit-plugin-gwtui': '//gerrit-plugin-gwtui:gwtui-api-javadoc', - }, - war = {'gerrit-war': '//:release'}, -) diff --git a/tools/maven/api.sh b/tools/maven/api.sh index 93b5f2eb8c..92fc0dd50c 100755 --- a/tools/maven/api.sh +++ b/tools/maven/api.sh @@ -14,9 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -if [[ "$#" != "2" ]] ; then +if [[ "$#" != "1" ]] ; then cat < $OUT", - 'echo "# this script should run from the root of your workspace." >> $OUT', - 'echo "" >> $OUT', - "echo 'if [[ \"${VERBOSE}\" ]]; then set -x ; fi' >> $OUT", - 'echo "" >> $OUT', - 'echo %s >> $OUT', - 'echo "" >> $OUT', - 'echo %s >> $OUT', - # This is supposed to be handled by executable=True, but it doesn't - # work. Bug? - 'chmod +x $OUT' ])) - -def maven_package( - version, - repository = None, - url = None, - jar = {}, - src = {}, - doc = {}, - war = {}): - - build_cmd = ['buck', 'build'] - - # This is not using python_binary() to avoid the baggage and bugs - # that PEX brings along. - mvn_cmd = ['python', 'tools/maven/mvn.py', '-v', version] - api_cmd = mvn_cmd[:] - api_targets = [] - for type,d in [('jar', jar), ('java-source', src), ('javadoc', doc)]: - for a,t in sorted(d.iteritems()): - api_cmd.append('-s %s:%s:$(location %s)' % (a,type,t)) - api_targets.append(t) - - genrule( - name = 'gen_api_install', - cmd = sh_bang_template % ( - ' '.join(build_cmd + api_targets), - ' '.join(api_cmd + ['-a', 'install'])), - out = 'api_install.sh', - executable = True, - ) - - if repository and url: - genrule( - name = 'gen_api_deploy', - cmd = sh_bang_template % ( - ' '.join(build_cmd + api_targets), - ' '.join(api_cmd + ['-a', 'deploy', - '--repository', repository, - '--url', url])), - out = 'api_deploy.sh', - executable = True, - ) - - war_cmd = mvn_cmd[:] - war_targets = [] - for a,t in sorted(war.iteritems()): - war_cmd.append('-s %s:war:$(location %s)' % (a,t)) - war_targets.append(t) - - genrule( - name = 'gen_war_install', - cmd = sh_bang_template % (' '.join(build_cmd + war_targets), - ' '.join(war_cmd + ['-a', 'install'])), - out = 'war_install.sh', - executable = True, - ) - - if repository and url: - genrule( - name = 'gen_war_deploy', - cmd = sh_bang_template % ( - ' '.join(build_cmd + war_targets), - ' '.join(war_cmd + [ - '-a', 'deploy', - '--repository', repository, - '--url', url])), - out = 'war_deploy.sh', - executable = True, - ) diff --git a/tools/maven/repository.defs b/tools/maven/repository.defs deleted file mode 100644 index c4e8fbf7d4..0000000000 --- a/tools/maven/repository.defs +++ /dev/null @@ -1,3 +0,0 @@ -MAVEN_REPOSITORY = 'sonatype-nexus-staging' -MAVEN_SNAPSHOT_URL = 'https://oss.sonatype.org/content/repositories/snapshots' -MAVEN_RELEASE_URL = 'https://oss.sonatype.org/service/local/staging/deploy/maven2' diff --git a/tools/pack_war.py b/tools/pack_war.py deleted file mode 100755 index ca21790ad4..0000000000 --- a/tools/pack_war.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2013 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from __future__ import print_function -from optparse import OptionParser -from os import makedirs, path, symlink -from subprocess import check_call -import sys - -opts = OptionParser() -opts.add_option('-o', help='path to write WAR to') -opts.add_option('--lib', action='append', help='target for WEB-INF/lib') -opts.add_option('--pgmlib', action='append', help='target for WEB-INF/pgm-lib') -opts.add_option('--tmp', help='temporary directory') -args, ctx = opts.parse_args() - -war = args.tmp -jars = set() - -def prune(l): - return [j for e in l for j in e.split(':')] - -def link_jars(libs, directory): - makedirs(directory) - for j in libs: - if j not in jars: - jars.add(j) - n = path.basename(j) - if j.find('buck-out/gen/gerrit-') > 0: - n = j[j.find('buck-out'):].split('/')[2] + '-' + n - symlink(j, path.join(directory, n)) - -if args.lib: - link_jars(prune(args.lib), path.join(war, 'WEB-INF', 'lib')) -if args.pgmlib: - link_jars(prune(args.pgmlib), path.join(war, 'WEB-INF', 'pgm-lib')) -try: - for s in ctx: - check_call(['unzip', '-q', '-d', war, s]) - check_call(['zip', '-9qr', args.o, '.'], cwd=war) -except KeyboardInterrupt: - print('Interrupted by user', file=sys.stderr) - exit(1)