Buck: Add support for standalone build mode
Change-Id: I5209747f4850fa04605ad701b63d025e0a7da072
diff --git a/.buckconfig b/.buckconfig
new file mode 100644
index 0000000..c209d85
--- /dev/null
+++ b/.buckconfig
@@ -0,0 +1,14 @@
+[alias]
+ wip = //:wip
+ plugin = //:wip
+
+[java]
+ src_roots = java, resources
+
+[project]
+ ignore = .git
+
+[cache]
+ mode = dir
+ dir = buck-out/cache
+
diff --git a/.gitignore b/.gitignore
index c650a1d..79eee44 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,7 @@
+/.buckversion
+/.buckd
+/buck-out
+/bucklets
/target
/.classpath
/.settings
diff --git a/BUCK b/BUCK
index cd1d04a..62240f2 100644
--- a/BUCK
+++ b/BUCK
@@ -1,3 +1,5 @@
+include_defs('//bucklets/gerrit_plugin.bucklet')
+
gerrit_plugin(
name = 'wip',
srcs = glob(['src/main/java/**/*.java']),
@@ -9,3 +11,7 @@
],
)
+java_library(
+ name = 'classpath',
+ deps = [':wip__plugin'],
+)
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..ae6d4b2
--- /dev/null
+++ b/VERSION
@@ -0,0 +1,4 @@
+# Used by BUCK to include "Implementation-Version" in plugin Manifest.
+# If this file doesn't exist the output of 'git describe' is used
+# instead.
+PLUGIN_VERSION = '1.0'
diff --git a/lib/gerrit/BUCK b/lib/gerrit/BUCK
new file mode 100644
index 0000000..11051b2
--- /dev/null
+++ b/lib/gerrit/BUCK
@@ -0,0 +1,20 @@
+include_defs('//bucklets/maven_jar.bucklet')
+
+VER = '2.10-SNAPSHOT'
+REPO = MAVEN_LOCAL
+
+maven_jar(
+ name = 'plugin-api',
+ id = 'com.google.gerrit:gerrit-plugin-api:' + VER,
+ license = 'Apache2.0',
+ attach_source = False,
+ repository = REPO,
+)
+
+maven_jar(
+ name = 'gwtui-api',
+ id = 'com.google.gerrit:gerrit-plugin-gwtui:' + VER,
+ license = 'Apache2.0',
+ attach_source = False,
+ repository = REPO,
+)
diff --git a/pom.xml b/pom.xml
index 766cb05..44b8fbd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
<version>1.0</version>
<properties>
<Gerrit-ApiType>plugin</Gerrit-ApiType>
- <Gerrit-ApiVersion>2.9</Gerrit-ApiVersion>
+ <Gerrit-ApiVersion>2.10-SNAPSHOT</Gerrit-ApiVersion>
</properties>
<build>
diff --git a/src/main/resources/Documentation/build.md b/src/main/resources/Documentation/build.md
new file mode 100644
index 0000000..fcd9e9e
--- /dev/null
+++ b/src/main/resources/Documentation/build.md
@@ -0,0 +1,79 @@
+Build
+=====
+
+This plugin can be built with Buck or Maven.
+
+Buck
+----
+
+Two build modes are supported: Standalone and in Gerrit tree.
+The standalone build mode is recommended, as this mode doesn't require
+the Gerrit tree to exist locally.
+
+
+### Build standalone
+
+Clone bucklets library:
+
+```
+ git clone https://gerrit.googlesource.com/bucklets
+
+```
+and link it to quota plugin directory:
+
+```
+ cd quota && ln -s ../bucklets .
+```
+
+Add link to the .buckversion file:
+
+```
+ cd quota && ln -s bucklets/buckversion .buckversion
+```
+
+To build the plugin, issue the following command:
+
+
+```
+ buck build plugin
+```
+
+The output is created in
+
+```
+ buck-out/gen/wip.jar
+```
+
+### Build in Gerrit tree
+
+Clone or link this plugin to the plugins directory of Gerrit's source
+tree, and issue the command:
+
+```
+ buck build plugins/wip
+```
+
+The output is created in
+
+```
+ buck-out/gen/plugins/wip/wip.jar
+```
+
+This project can be imported into the Eclipse IDE:
+
+```
+ ./tools/eclipse/project.py
+```
+
+Maven
+-----
+
+Note that the Maven build is provided for compatibility reasons, but
+it is considered to be deprecated and will be removed in a future
+version of this plugin.
+
+To build with Maven, run
+
+```
+mvn clean package
+```