| load("@rules_java//java:defs.bzl", "java_library") |
| load("//tools/bzl:junit.bzl", "junit_tests") |
| load("//tools/js:eslint.bzl", "eslint") |
| load( |
| "//tools/bzl:plugin.bzl", |
| "PLUGIN_DEPS", |
| "PLUGIN_TEST_DEPS", |
| "gerrit_plugin", |
| ) |
| load("//tools/bzl:js.bzl", "gerrit_js_bundle") |
| load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project") |
| |
| gerrit_plugin( |
| name = "delete-project", |
| srcs = glob(["src/main/java/**/*.java"]), |
| manifest_entries = [ |
| "Gerrit-PluginName: delete-project", |
| "Gerrit-Module: com.googlesource.gerrit.plugins.deleteproject.Module", |
| "Gerrit-HttpModule: com.googlesource.gerrit.plugins.deleteproject.HttpModule", |
| "Gerrit-SshModule: com.googlesource.gerrit.plugins.deleteproject.SshModule", |
| ], |
| resource_jars = [":gr-delete-repo"], |
| resources = glob(["src/main/resources/Documentation/*.md"]), |
| deps = ["@commons-io//jar"], |
| ) |
| |
| ts_config( |
| name = "tsconfig", |
| src = "tsconfig.json", |
| deps = [ |
| "//plugins:tsconfig-plugins-base.json", |
| ], |
| ) |
| |
| ts_project( |
| name = "gr-delete-repo-ts", |
| srcs = glob([ |
| "gr-delete-repo/**/*.ts", |
| ]), |
| incremental = True, |
| tsc = "//tools/node_tools:tsc-bin", |
| tsconfig = ":tsconfig", |
| deps = [ |
| "@plugins_npm//@gerritcodereview/typescript-api", |
| "@plugins_npm//lit", |
| ], |
| ) |
| |
| gerrit_js_bundle( |
| name = "gr-delete-repo", |
| srcs = [":gr-delete-repo-ts"], |
| entry_point = "gr-delete-repo/plugin.js", |
| ) |
| |
| junit_tests( |
| name = "delete-project_tests", |
| srcs = glob(["src/test/java/**/*.java"]), |
| tags = ["delete-project"], |
| deps = [ |
| ":delete-project__plugin_test_deps", |
| ], |
| ) |
| |
| java_library( |
| name = "delete-project__plugin_test_deps", |
| testonly = 1, |
| visibility = ["//visibility:public"], |
| exports = PLUGIN_DEPS + PLUGIN_TEST_DEPS + [ |
| ":delete-project__plugin", |
| "@commons-io//jar", |
| "@mockito//jar", |
| ], |
| ) |
| |
| # The eslint macro creates 2 rules: lint_test and lint_bin. Typical usage: |
| # bazel test $DIR:lint_test |
| # bazel run $DIR:lint_bin -- --fix $PATH_TO_SRCS |
| eslint( |
| name = "lint", |
| srcs = glob(["gr-delete-repo/**/*"]), |
| config = ".eslintrc.js", |
| data = [ |
| "tsconfig.json", |
| "//plugins:.eslintrc.js", |
| "//plugins:.prettierrc.js", |
| "//plugins:tsconfig-plugins-base.json", |
| ], |
| extensions = [".ts"], |
| ignore = "//plugins:.eslintignore", |
| plugins = [ |
| "@npm//eslint-config-google", |
| "@npm//eslint-plugin-html", |
| "@npm//eslint-plugin-import", |
| "@npm//eslint-plugin-jsdoc", |
| "@npm//eslint-plugin-prettier", |
| "@npm//gts", |
| ], |
| ) |