Clean up poms and verion bump where appropriate.
diff --git a/compile-testing/pom.xml b/compile-testing/pom.xml
index e5c22d1..6d8c31f 100644
--- a/compile-testing/pom.xml
+++ b/compile-testing/pom.xml
@@ -1,3 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2013 Google, Inc.
+
+ 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.
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
diff --git a/factory/pom.xml b/factory/pom.xml
index e8bd6fd..2161c63 100644
--- a/factory/pom.xml
+++ b/factory/pom.xml
@@ -34,42 +34,36 @@
<dependencies>
<dependency>
- <groupId>javax.inject</groupId>
- <artifactId>javax.inject</artifactId>
- <version>1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.10</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.squareup</groupId>
- <artifactId>javawriter</artifactId>
- <version>1.0.2</version>
+ <groupId>com.google.auto.service</groupId>
+ <artifactId>auto-service</artifactId>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
- <version>14.0.1</version>
</dependency>
<dependency>
- <groupId>com.google.auto.service</groupId>
- <artifactId>auto-service</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <groupId>com.squareup</groupId>
+ <artifactId>javawriter</artifactId>
</dependency>
<dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ </dependency>
+ <!-- test dependencies -->
+ <dependency>
<groupId>com.google.testing.compile</groupId>
<artifactId>compile-testing</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.truth0</groupId>
<artifactId>truth</artifactId>
- <version>0.11</version>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/factory/src/main/java/com/google/auto/factory/FactoryWriter.java b/factory/src/main/java/com/google/auto/factory/FactoryWriter.java
index 189744c..a5fabf5 100644
--- a/factory/src/main/java/com/google/auto/factory/FactoryWriter.java
+++ b/factory/src/main/java/com/google/auto/factory/FactoryWriter.java
@@ -15,17 +15,20 @@
*/
package com.google.auto.factory;
-import static java.lang.reflect.Modifier.PUBLIC;
+import static javax.lang.model.element.Modifier.FINAL;
+import static javax.lang.model.element.Modifier.PRIVATE;
+import static javax.lang.model.element.Modifier.PUBLIC;
import java.io.IOException;
-import java.lang.reflect.Modifier;
import java.util.Collection;
+import java.util.EnumSet;
import java.util.List;
import java.util.Map.Entry;
import javax.annotation.Generated;
import javax.annotation.processing.Filer;
import javax.inject.Inject;
+import javax.lang.model.element.Modifier;
import javax.tools.JavaFileObject;
import com.google.common.base.Function;
@@ -36,7 +39,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Ordering;
-import com.squareup.java.JavaWriter;
+import com.squareup.javawriter.JavaWriter;
final class FactoryWriter {
private final Filer filer;
@@ -80,15 +83,17 @@
String factoryName = getSimpleName(descriptor.name()).toString();
writer.emitAnnotation(Generated.class,
ImmutableMap.of("value", "\"" + AutoFactoryProcessor.class.getName() + "\""));
- writer.beginType(factoryName, "class", Modifier.FINAL | (descriptor.publicType() ? PUBLIC : 0),
- null, implementedClasses);
+ EnumSet<Modifier> modifiers = EnumSet.of(FINAL);
+ if (descriptor.publicType()) {
+ modifiers.add(PUBLIC);
+ }
+ writer.beginType(factoryName, "class", modifiers, null, implementedClasses);
ImmutableList.Builder<String> constructorTokens = ImmutableList.builder();
for (Entry<Key, String> entry : descriptor.providerNames().entrySet()) {
Key key = entry.getKey();
String providerName = entry.getValue();
- writer.emitField("Provider<" + key.getType() + ">", providerName,
- Modifier.PRIVATE | Modifier.FINAL);
+ writer.emitField("Provider<" + key.getType() + ">", providerName, EnumSet.of(PRIVATE, FINAL));
Optional<String> qualifier = key.getQualifier();
String qualifierPrefix = qualifier.isPresent() ? "@" + qualifier.get() + " " : "";
constructorTokens.add(qualifierPrefix + "Provider<" + key.getType() + ">").add(providerName);
@@ -96,7 +101,8 @@
writer.emitAnnotation("Inject");
- writer.beginMethod(null, factoryName, descriptor.publicType() ? PUBLIC : 0,
+ writer.beginMethod(null, factoryName,
+ descriptor.publicType() ? EnumSet.of(PUBLIC) : EnumSet.noneOf(Modifier.class),
constructorTokens.build().toArray(new String[0]));
for (String providerName : descriptor.providerNames().values()) {
@@ -107,7 +113,7 @@
for (final FactoryMethodDescriptor methodDescriptor : descriptor.methodDescriptors()) {
writer.beginMethod(methodDescriptor.returnType(), methodDescriptor.name(),
- methodDescriptor.publicMethod() ? PUBLIC : 0,
+ methodDescriptor.publicMethod() ? EnumSet.of(PUBLIC) : EnumSet.noneOf(Modifier.class),
parameterTokens(methodDescriptor.passedParameters()));
FluentIterable<String> creationParameterNames =
FluentIterable.from(methodDescriptor.creationParameters())
@@ -127,7 +133,7 @@
: descriptor.implementationMethodDescriptors()) {
writer.emitAnnotation(Override.class);
writer.beginMethod(methodDescriptor.returnType(), methodDescriptor.name(),
- methodDescriptor.publicMethod() ? PUBLIC : 0,
+ methodDescriptor.publicMethod() ? EnumSet.of(PUBLIC) : EnumSet.noneOf(Modifier.class),
parameterTokens(methodDescriptor.passedParameters()));
FluentIterable<String> creationParameterNames =
FluentIterable.from(methodDescriptor.passedParameters())
diff --git a/factory/src/test/resources/tests/ConstructorAnnotatedFactory.java b/factory/src/test/resources/tests/ConstructorAnnotatedFactory.java
index 5e650c3..17282eb 100644
--- a/factory/src/test/resources/tests/ConstructorAnnotatedFactory.java
+++ b/factory/src/test/resources/tests/ConstructorAnnotatedFactory.java
@@ -19,7 +19,7 @@
import javax.inject.Inject;
import javax.inject.Provider;
-@Generated(value = "com.google.auto.factory.AutoFactoryProcessor")
+@Generated("com.google.auto.factory.AutoFactoryProcessor")
final class ConstructorAnnotatedFactory {
private final Provider<Object> objProvider;
diff --git a/factory/src/test/resources/tests/CustomNamedFactory.java b/factory/src/test/resources/tests/CustomNamedFactory.java
index 3ceb647..3f87963 100644
--- a/factory/src/test/resources/tests/CustomNamedFactory.java
+++ b/factory/src/test/resources/tests/CustomNamedFactory.java
@@ -18,7 +18,7 @@
import javax.annotation.Generated;
import javax.inject.Inject;
-@Generated(value = "com.google.auto.factory.AutoFactoryProcessor")
+@Generated("com.google.auto.factory.AutoFactoryProcessor")
final class CustomNamedFactory {
@Inject CustomNamedFactory() {}
diff --git a/factory/src/test/resources/tests/MixedDepsImplementingInterfacesFactory.java b/factory/src/test/resources/tests/MixedDepsImplementingInterfacesFactory.java
index 0d95ac8..4233f3f 100644
--- a/factory/src/test/resources/tests/MixedDepsImplementingInterfacesFactory.java
+++ b/factory/src/test/resources/tests/MixedDepsImplementingInterfacesFactory.java
@@ -27,7 +27,7 @@
/**
* @author Gregory Kick
*/
-@Generated(value = "com.google.auto.factory.AutoFactoryProcessor")
+@Generated("com.google.auto.factory.AutoFactoryProcessor")
final class MixedDepsImplementingInterfacesFactory
implements FromInt, FromObject, MarkerA, MarkerB {
private final Provider<String> sProvider;
diff --git a/factory/src/test/resources/tests/PublicClassFactory.java b/factory/src/test/resources/tests/PublicClassFactory.java
index e875296..1d42dc3 100644
--- a/factory/src/test/resources/tests/PublicClassFactory.java
+++ b/factory/src/test/resources/tests/PublicClassFactory.java
@@ -18,7 +18,7 @@
import javax.annotation.Generated;
import javax.inject.Inject;
-@Generated(value = "com.google.auto.factory.AutoFactoryProcessor")
+@Generated("com.google.auto.factory.AutoFactoryProcessor")
public final class PublicClassFactory {
@Inject public PublicClassFactory() {}
diff --git a/factory/src/test/resources/tests/SimpleClassFactory.java b/factory/src/test/resources/tests/SimpleClassFactory.java
index a6070a6..6bcf4ba 100644
--- a/factory/src/test/resources/tests/SimpleClassFactory.java
+++ b/factory/src/test/resources/tests/SimpleClassFactory.java
@@ -18,7 +18,7 @@
import javax.annotation.Generated;
import javax.inject.Inject;
-@Generated(value = "com.google.auto.factory.AutoFactoryProcessor")
+@Generated("com.google.auto.factory.AutoFactoryProcessor")
final class SimpleClassFactory {
@Inject SimpleClassFactory() {}
diff --git a/factory/src/test/resources/tests/SimpleClassImplementingMarkerFactory.java b/factory/src/test/resources/tests/SimpleClassImplementingMarkerFactory.java
index 0160f05..63b92e1 100644
--- a/factory/src/test/resources/tests/SimpleClassImplementingMarkerFactory.java
+++ b/factory/src/test/resources/tests/SimpleClassImplementingMarkerFactory.java
@@ -19,7 +19,7 @@
import javax.inject.Inject;
import java.util.RandomAccess;
-@Generated(value = "com.google.auto.factory.AutoFactoryProcessor")
+@Generated("com.google.auto.factory.AutoFactoryProcessor")
final class SimpleClassImplementingMarkerFactory implements RandomAccess {
@Inject SimpleClassImplementingMarkerFactory() {}
diff --git a/factory/src/test/resources/tests/SimpleClassImplementingSimpleInterfaceFactory.java b/factory/src/test/resources/tests/SimpleClassImplementingSimpleInterfaceFactory.java
index f41a351..014cdb3 100644
--- a/factory/src/test/resources/tests/SimpleClassImplementingSimpleInterfaceFactory.java
+++ b/factory/src/test/resources/tests/SimpleClassImplementingSimpleInterfaceFactory.java
@@ -19,7 +19,7 @@
import javax.inject.Inject;
import tests.SimpleClassImplementingSimpleInterface.SimpleInterface;
-@Generated(value = "com.google.auto.factory.AutoFactoryProcessor")
+@Generated("com.google.auto.factory.AutoFactoryProcessor")
final class SimpleClassImplementingSimpleInterfaceFactory implements SimpleInterface {
@Inject SimpleClassImplementingSimpleInterfaceFactory() {}
diff --git a/factory/src/test/resources/tests/SimpleClassMixedDepsFactory.java b/factory/src/test/resources/tests/SimpleClassMixedDepsFactory.java
index 63d907b..38c146b 100644
--- a/factory/src/test/resources/tests/SimpleClassMixedDepsFactory.java
+++ b/factory/src/test/resources/tests/SimpleClassMixedDepsFactory.java
@@ -19,7 +19,7 @@
import javax.inject.Inject;
import javax.inject.Provider;
-@Generated(value = "com.google.auto.factory.AutoFactoryProcessor")
+@Generated("com.google.auto.factory.AutoFactoryProcessor")
final class SimpleClassMixedDepsFactory {
private final Provider<String> providedDepAProvider;
diff --git a/factory/src/test/resources/tests/SimpleClassPassedDepsFactory.java b/factory/src/test/resources/tests/SimpleClassPassedDepsFactory.java
index 09f9689..50beaf0 100644
--- a/factory/src/test/resources/tests/SimpleClassPassedDepsFactory.java
+++ b/factory/src/test/resources/tests/SimpleClassPassedDepsFactory.java
@@ -18,7 +18,7 @@
import javax.annotation.Generated;
import javax.inject.Inject;
-@Generated(value = "com.google.auto.factory.AutoFactoryProcessor")
+@Generated("com.google.auto.factory.AutoFactoryProcessor")
final class SimpleClassPassedDepsFactory {
@Inject SimpleClassPassedDepsFactory() {}
diff --git a/factory/src/test/resources/tests/SimpleClassProvidedDepsFactory.java b/factory/src/test/resources/tests/SimpleClassProvidedDepsFactory.java
index 2c62520..5410751 100644
--- a/factory/src/test/resources/tests/SimpleClassProvidedDepsFactory.java
+++ b/factory/src/test/resources/tests/SimpleClassProvidedDepsFactory.java
@@ -19,7 +19,7 @@
import javax.inject.Inject;
import javax.inject.Provider;
-@Generated(value = "com.google.auto.factory.AutoFactoryProcessor")
+@Generated("com.google.auto.factory.AutoFactoryProcessor")
final class SimpleClassProvidedDepsFactory {
private final Provider<String> providedDepAProvider;
private final Provider<String> providedDepBProvider;
diff --git a/pom.xml b/pom.xml
index 9b818e7..f26838d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,7 +14,8 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -32,6 +33,7 @@
<url>https://github.com/google/auto</url>
<modules>
+ <!-- TODO(gak): move compile-testing to its own project-->
<module>compile-testing</module>
<module>factory</module>
<module>service</module>
@@ -67,6 +69,58 @@
<url>http://www.google.com</url>
</organization>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ <version>1.3.9</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>14.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.squareup</groupId>
+ <artifactId>javawriter</artifactId>
+ <version>2.1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
+ <scope>provided</scope>
+ </dependency>
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>com.google.testing.compile</groupId>
+ <artifactId>compile-testing</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava-testlib</artifactId>
+ <version>14.0.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.truth0</groupId>
+ <artifactId>truth</artifactId>
+ <version>0.13</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<build>
<plugins>
<plugin>
@@ -81,7 +135,6 @@
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
-
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
@@ -89,7 +142,6 @@
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
-
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
@@ -110,30 +162,31 @@
</plugin>
</plugins>
</build>
+
<profiles>
<profile>
- <id>default-profile</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- <file>
- <exists>${java.home}/../lib/tools.jar</exists>
- </file>
- </activation>
- <properties>
- <toolsjar>${java.home}/../lib/tools.jar</toolsjar>
- </properties>
+ <id>default-profile</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ <file>
+ <exists>${java.home}/../lib/tools.jar</exists>
+ </file>
+ </activation>
+ <properties>
+ <toolsjar>${java.home}/../lib/tools.jar</toolsjar>
+ </properties>
</profile>
<profile>
- <id>mac-profile</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- <file>
- <exists>${java.home}/../Classes/classes.jar</exists>
- </file>
- </activation>
- <properties>
- <toolsjar>${java.home}/../Classes/classes.jar</toolsjar>
- </properties>
+ <id>mac-profile</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ <file>
+ <exists>${java.home}/../Classes/classes.jar</exists>
+ </file>
+ </activation>
+ <properties>
+ <toolsjar>${java.home}/../Classes/classes.jar</toolsjar>
+ </properties>
</profile>
</profiles>
</project>
diff --git a/service/pom.xml b/service/pom.xml
index 5aa1a73..e8a9962 100644
--- a/service/pom.xml
+++ b/service/pom.xml
@@ -33,26 +33,23 @@
<dependencies>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.11</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
- <version>14.0.1</version>
</dependency>
+ <!-- test dependencies -->
<dependency>
<groupId>com.google.testing.compile</groupId>
<artifactId>compile-testing</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.truth0</groupId>
<artifactId>truth</artifactId>
- <version>0.11</version>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/value/pom.xml b/value/pom.xml
index db76a0b..011186b 100644
--- a/value/pom.xml
+++ b/value/pom.xml
@@ -33,43 +33,39 @@
<dependencies>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.10</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>4.1</version>
</dependency>
+ <!-- test dependencies -->
<dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
- <version>1.3.9</version>
- <scope>provided</scope>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava-testlib</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.testing.compile</groupId>
<artifactId>compile-testing</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.truth0</groupId>
<artifactId>truth</artifactId>
- <version>0.11</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava-testlib</artifactId>
- <version>14.0.1</version>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/value/src/it/functional/pom.xml b/value/src/it/functional/pom.xml
index 4165dee..1458022 100644
--- a/value/src/it/functional/pom.xml
+++ b/value/src/it/functional/pom.xml
@@ -1,11 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2013 Google, Inc. 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. -->
+<!--
+ Copyright (C) 2013 Google, Inc.
+
+ 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(gak): see if we can manage these dependencies any better -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>