aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--compiler/pom.xml48
-rw-r--r--compiler/src/it/functional-tests/pom.xml87
-rw-r--r--compiler/src/it/functional-tests/src/main/java/test/Thing.java10
-rw-r--r--compiler/src/it/functional-tests/src/main/java/test/ThingComponent.java11
-rw-r--r--compiler/src/it/functional-tests/src/test/java/test/SimpleTest.java18
-rw-r--r--examples/pom.xml3
7 files changed, 175 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 4ff44f910..7e1335895 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,6 +16,7 @@ lib
target
pom.xml.*
release.properties
+build.log
.idea
*.iml
diff --git a/compiler/pom.xml b/compiler/pom.xml
index 465c1ae3b..d6197dddc 100644
--- a/compiler/pom.xml
+++ b/compiler/pom.xml
@@ -139,6 +139,54 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <configuration>
+ <addTestClassPath>true</addTestClassPath>
+ <!--<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+ <cloneClean>true</cloneClean>-->
+ <pomIncludes>
+ <pomInclude>*/pom.xml</pomInclude>
+ </pomIncludes>
+ <localRepositoryPath>${project.build.directory}/it-repo</localRepositoryPath>
+ <filterProperties>
+ <dagger.version>${project.version}</dagger.version>
+ <dagger.groupId>${project.groupId}</dagger.groupId>
+ </filterProperties>
+ <streamLogs>true</streamLogs>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>install</goal>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>ide</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <configuration>
+ <addTestClassPath>true</addTestClassPath>
+ <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+ <cloneClean>true</cloneClean>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/compiler/src/it/functional-tests/pom.xml b/compiler/src/it/functional-tests/pom.xml
new file mode 100644
index 000000000..ca5ad8af6
--- /dev/null
+++ b/compiler/src/it/functional-tests/pom.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2012 Square, Inc.
+ Copyright (C) 2012 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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>com.google.dagger</groupId>
+ <artifactId>dagger-parent</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+ <groupId>dagger.tests</groupId>
+ <artifactId>functional-tests</artifactId>
+ <name>Functional Tests</name>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.dagger</groupId>
+ <artifactId>dagger</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.dagger</groupId>
+ <artifactId>dagger-compiler</artifactId>
+ <version>${project.version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.truth</groupId>
+ <artifactId>truth</artifactId>
+ <version>0.24</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <annotationProcessors>
+ <annotationProcessor>dagger.internal.codegen.ComponentProcessor</annotationProcessor>
+ </annotationProcessors>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>2.10</version>
+ <configuration>
+ <failsOnError>false</failsOnError>
+ <consoleOutput>true</consoleOutput>
+ <configLocation>../../../../checkstyle.xml</configLocation>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>checkstyle</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project> \ No newline at end of file
diff --git a/compiler/src/it/functional-tests/src/main/java/test/Thing.java b/compiler/src/it/functional-tests/src/main/java/test/Thing.java
new file mode 100644
index 000000000..a0cf458fc
--- /dev/null
+++ b/compiler/src/it/functional-tests/src/main/java/test/Thing.java
@@ -0,0 +1,10 @@
+package test;
+
+import javax.inject.Inject;
+
+/**
+ * Created by gak on 11/13/14.
+ */
+final class Thing {
+ @Inject Thing() {}
+}
diff --git a/compiler/src/it/functional-tests/src/main/java/test/ThingComponent.java b/compiler/src/it/functional-tests/src/main/java/test/ThingComponent.java
new file mode 100644
index 000000000..f24a47dbf
--- /dev/null
+++ b/compiler/src/it/functional-tests/src/main/java/test/ThingComponent.java
@@ -0,0 +1,11 @@
+package test;
+
+import dagger.Component;
+
+/**
+ * Created by gak on 11/13/14.
+ */
+@Component
+interface ThingComponent {
+ Thing thing();
+}
diff --git a/compiler/src/it/functional-tests/src/test/java/test/SimpleTest.java b/compiler/src/it/functional-tests/src/test/java/test/SimpleTest.java
new file mode 100644
index 000000000..dc8086645
--- /dev/null
+++ b/compiler/src/it/functional-tests/src/test/java/test/SimpleTest.java
@@ -0,0 +1,18 @@
+package test;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+import static com.google.common.truth.Truth.assertThat;
+
+/**
+ */
+@RunWith(JUnit4.class)
+public class SimpleTest {
+ @Test public void testAThing() {
+ ThingComponent thingComponent = Dagger_ThingComponent.create();
+ assertThat(thingComponent).isNotNull();
+ assertThat(thingComponent.thing()).isNotNull();
+ }
+}
diff --git a/examples/pom.xml b/examples/pom.xml
index ebcd423c8..530438caf 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -37,9 +37,6 @@
<profiles>
<profile>
<id>android</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
<modules>
<module>simple</module>
<module>android-simple</module>