Fix standalone build: add Module and workspace

Change-Id: I7e163453d20a059e57b9433c08b0970d11fa1cc1
diff --git a/.bazelrc b/.bazelrc
new file mode 100644
index 0000000..2210511
--- /dev/null
+++ b/.bazelrc
@@ -0,0 +1 @@
+build --workspace_status_command=./tools/workspace-status.sh
diff --git a/BUILD b/BUILD
index f36a951..77d9d09 100644
--- a/BUILD
+++ b/BUILD
@@ -99,3 +99,10 @@
         ":testdata",
     ],
 )
+
+java_library(
+    name = "copyright_classpath_deps",
+    testonly = 1,
+    visibility = ["//visibility:public"],
+    exports = TEST_DEPS,
+)
diff --git a/src/main/java/com/googlesource/gerrit/plugins/copyright/Module.java b/src/main/java/com/googlesource/gerrit/plugins/copyright/Module.java
new file mode 100644
index 0000000..a319bd2
--- /dev/null
+++ b/src/main/java/com/googlesource/gerrit/plugins/copyright/Module.java
@@ -0,0 +1,30 @@
+// Copyright (C) 2019 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 com.googlesource.gerrit.plugins.copyright;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Provides;
+
+public class Module extends AbstractModule {
+  @Override
+  protected void configure() {
+    install(CopyrightConfig.module());
+  }
+
+  @Provides
+  ScannerConfig getScannerConfig(CopyrightConfig config) {
+    return config.getScannerConfig();
+  }
+}
diff --git a/tools/workspace-status.sh b/tools/workspace-status.sh
new file mode 100755
index 0000000..e6665f7
--- /dev/null
+++ b/tools/workspace-status.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# This script will be run by bazel when the build process starts to
+# generate key-value information that represents the status of the
+# workspace. The output should be like
+#
+# KEY1 VALUE1
+# KEY2 VALUE2
+#
+# If the script exits with non-zero code, it's considered as a failure
+# and the output will be discarded.
+
+function rev() {
+  cd $1 && git describe --always --match "v[0-9].*" --dirty
+}
+
+echo STABLE_BUILD_COPYRIGHT_LABEL "$(rev .)"
+echo "STABLE_WORKSPACE_ROOT ${PWD}"