aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Francois-Rene Rideau <tunes@google.com>2015-04-07 06:05:19 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-04-08 08:45:53 +0000
commitc445809d11f82643b9a29636fd241aefef48fe9b (patch)
tree8a57d36013a80cd227435f68bfa5056271d86fab
parentd99b27b12437fd7f12c80f1ecebb66e4abf3d754 (diff)
Add Google auto to bazel
Add the Google auto generators for Java, for the sake of using AutoValue. Include dependencies apache commons collections and apache velocity. -- MOS_MIGRATED_REVID=90482044
-rw-r--r--examples/java-skylark/src/test/java/com/example/myproject/BUILD9
-rw-r--r--src/main/java/BUILD1
-rwxr-xr-xsrc/test/shell/bazel/test-setup.sh8
-rw-r--r--third_party/BUILD105
-rw-r--r--third_party/README.md71
5 files changed, 156 insertions, 38 deletions
diff --git a/examples/java-skylark/src/test/java/com/example/myproject/BUILD b/examples/java-skylark/src/test/java/com/example/myproject/BUILD
index 1d6b9c3c3f..a38d22208a 100644
--- a/examples/java-skylark/src/test/java/com/example/myproject/BUILD
+++ b/examples/java-skylark/src/test/java/com/example/myproject/BUILD
@@ -1,11 +1,16 @@
-load("/tools/build_rules/java_rules_skylark", "java_test")
+load("/tools/build_rules/java_rules_skylark", "java_library", "java_test")
+
+java_library(
+ name = "junit4",
+ jars = ["//third_party:junit4-jars"],
+)
java_test(
name = "pass",
srcs = ["TestHello.java"],
deps = [
+ ":junit4",
"//examples/java-skylark/src/main/java/com/example/myproject:hello-lib",
- "//third_party:junit4-skylark",
],
)
diff --git a/src/main/java/BUILD b/src/main/java/BUILD
index 1288ed0ae3..c2e3dbe517 100644
--- a/src/main/java/BUILD
+++ b/src/main/java/BUILD
@@ -42,6 +42,7 @@ java_library(
"//src/tools/xcode-common",
"//third_party:aether",
"//third_party:apache_commons_compress",
+ "//third_party:auto_value",
"//third_party:gson",
"//third_party:guava",
"//third_party:joda_time",
diff --git a/src/test/shell/bazel/test-setup.sh b/src/test/shell/bazel/test-setup.sh
index 5f43ef0b54..9b5b97026f 100755
--- a/src/test/shell/bazel/test-setup.sh
+++ b/src/test/shell/bazel/test-setup.sh
@@ -83,11 +83,9 @@ EOF
function setup_skylark_javatest_support() {
setup_javatest_common
cat <<EOF >>third_party/BUILD
-load("/tools/build_rules/java_rules_skylark", "java_library")
-
-java_library(
- name = "junit4-skylark",
- jars = [
+filegroup(
+ name = "junit4-jars",
+ srcs = [
"junit.jar",
"hamcrest.jar",
],
diff --git a/third_party/BUILD b/third_party/BUILD
index 861a3ee4bc..dd49116206 100644
--- a/third_party/BUILD
+++ b/third_party/BUILD
@@ -1,7 +1,5 @@
package(default_visibility = ["//visibility:public"])
-load("/tools/build_rules/java_rules_skylark", "java_library")
-
filegroup(
name = "srcs",
srcs = glob(["**"]),
@@ -34,6 +32,11 @@ java_import(
)
java_import(
+ name = "apache_commons_collections",
+ jars = ["apache_commons_collections/commons-collections-3.2.1.jar"],
+)
+
+java_import(
name = "apache_commons_compress",
jars = ["apache_commons_compress/apache-commons-compress-1.9.jar"],
)
@@ -54,6 +57,85 @@ java_import(
)
java_import(
+ name = "apache_velocity",
+ jars = ["apache_velocity/velocity-1.7.jar"],
+)
+
+java_import(
+ name = "asm",
+ jars = ["asm/asm-5.0.3.jar"],
+)
+
+java_plugin(
+ name = "auto_annotation_plugin",
+ processor_class = "com.google.auto.value.processor.AutoAnnotationProcessor",
+ deps = [
+ ":apache_commons_collections",
+ ":apache_velocity",
+ ":asm",
+ ":auto_common",
+ ":auto_service",
+ ":auto_value_value",
+ ":guava",
+ ":jsr305",
+ ":tomcat_annotations_api",
+ ],
+)
+
+java_import(
+ name = "auto_common",
+ jars = ["auto/auto-common-0.3.jar"],
+)
+
+java_import(
+ name = "auto_service",
+ jars = ["auto/auto-service-1.0-rc2.jar"],
+)
+
+java_plugin(
+ name = "auto_service_plugin",
+ processor_class = "com.google.auto.service.processor.AutoServiceProcessor",
+ deps = [
+ ":auto_common",
+ ":auto_service",
+ ":guava",
+ ],
+)
+
+java_plugin(
+ name = "auto_value_plugin",
+ processor_class = "com.google.auto.value.processor.AutoValueProcessor",
+ deps = [
+ ":apache_commons_collections",
+ ":apache_velocity",
+ ":asm",
+ ":auto_common",
+ ":auto_service",
+ ":auto_value_value",
+ ":guava",
+ ":jsr305",
+ ":tomcat_annotations_api",
+ ],
+)
+
+java_library(
+ name = "auto_value",
+ exported_plugins = [
+ ":auto_annotation_plugin",
+ ":auto_value_plugin",
+ ],
+ exports = [
+ ":auto_value_value",
+ ":tomcat_annotations_api",
+ ],
+)
+
+java_import(
+ name = "auto_value_value",
+ jars = ["auto/auto-value-1.0.jar"],
+)
+
+java_import(
name = "gson",
jars = ["gson/gson-2.2.4.jar"],
)
@@ -84,7 +166,6 @@ java_import(
"maven_model/maven-aether-provider-3.2.3.jar",
"maven_model/maven-model-3.2.3.jar",
"maven_model/maven-model-builder-3.2.3.jar",
- "maven_model/maven-repository-metadata-3.2.3.jar",
],
)
@@ -103,6 +184,11 @@ java_import(
jars = ["protobuf/protobuf-2.5.0.jar"],
)
+java_import(
+ name = "tomcat_annotations_api",
+ jars = ["tomcat_annotations_api/tomcat-annotations-api-8.0.5.jar"],
+)
+
# Testing
java_import(
@@ -128,20 +214,15 @@ java_import(
jars = ["truth/truth-0.24+.jar"],
)
-# For the java-skylark example.
-java_library(
- name = "junit4-skylark",
- jars = [
+# To be used by the skylark example.
+filegroup(
+ name = "junit4-jars",
+ srcs = [
"hamcrest/hamcrest-core-1.3.jar",
"junit/junit-4.11.jar",
],
)
-java_import(
- name = "asm",
- jars = ["asm/asm-5.0.3.jar"],
-)
-
config_setting(
name = "windows_mingw",
values = {"compiler": "windows_mingw"},
diff --git a/third_party/README.md b/third_party/README.md
index f2b9f59b47..afd6ca5106 100644
--- a/third_party/README.md
+++ b/third_party/README.md
@@ -10,10 +10,17 @@ a minimal set of extra dependencies.
* License: Eclipse Public License
+[apache_commons_collections](http://commons.apache.org/proper/commons-collections/)
+----------------------------
+
+* Version: 3.2.1
+* License: Apache License 2.0.
+
+
[apache_commons_logging](http://commons.apache.org/proper/commons-logging/)
------------------------
-* Version: 1.1.1.
+* Version: 1.1.1
* License: Apache License 2.0.
@@ -31,6 +38,29 @@ a minimal set of extra dependencies.
* License: Apache License 2.0
+[apache_velocity](http://velocity.apache.org/)
+-----------------
+
+* Version: 1.7
+* License: Apache License 2.0.
+
+
+[asm](https://asm.ow2.org)
+-----
+
+* Version: 5.0.3
+* License: 3-clause revised BSD
+
+
+[auto](https://github.com/google/auto)
+------
+
+* [auto_common](https://github.com/google/auto/tree/master/common) (version 0.3)
+* [auto_service](https://github.com/google/auto/tree/master/service) (version 1.0-rc2)
+* [auto_value](https://github.com/google/auto/tree/master/value) (version 1.0)
+* License: Apache License 2.0
+
+
[Buck (iOS support)](http://facebook.github.io/buck/)
--------------------
@@ -79,6 +109,13 @@ a minimal set of extra dependencies.
* Version: 2.3
* License: Apache License 2.0
+
+[jsr250](https://repository.apache.org/content/repositories/orgapachetomcat-002)
+--------
+* Version: 8.0.5
+* License: Apache License 2.0
+
+
[jsr305](https://code.google.com/p/jsr-305/)
--------
@@ -122,6 +159,20 @@ a minimal set of extra dependencies.
Testing
=======
+[hamcrest](https://code.google.com/p/hamcrest/)
+----------
+
+* Version: 1.3
+* License: New BSD License
+
+
+[iossim](https://code.google.com/p/google-toolbox-for-mac/source/browse/trunk/UnitTesting/iossim?r=701)
+--------
+
+* Version: Revision 701
+* License: 3-clause BSD
+
+
[junit](http://junit.org/)
-------
@@ -136,21 +187,3 @@ Testing
* License: Apache License 2.0
-[hamcrest](https://code.google.com/p/hamcrest/)
-----------
-
-* Version: 1.3
-* License: New BSD License
-
-
-[asm](https://asm.ow2.org)
------
-
-* Version: 5.0.3
-* License: 3-clause revised BSD
-
-[iossim](https://code.google.com/p/google-toolbox-for-mac/source/browse/trunk/UnitTesting/iossim?r=701)
---------
-
-* Version: Revision 701
-* License: 3-clause BSD