aboutsummaryrefslogtreecommitdiff
path: root/core/pom.xml
blob: 2afd00e57af0263bb47872c3496260c56028e9c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<?xml version="1.0" encoding="UTF-8"?>
<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.truth</groupId>
    <artifactId>truth-parent</artifactId>
    <version>HEAD-SNAPSHOT</version>
  </parent>
  <artifactId>truth</artifactId>
  <name>Truth Core</name>
  <dependencies>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>org.checkerframework</groupId>
      <artifactId>checker-qual</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
    <!-- Required only to test the -gwt sub-artifact. -->
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.auto.value</groupId>
      <artifactId>auto-value-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava-gwt</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava-testlib</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.errorprone</groupId>
      <artifactId>error_prone_annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>org.ow2.asm</groupId>
      <artifactId>asm</artifactId>
      <!-- Truth works fine without ASM: It just produces slightly less useful failure messages. Thus, users can exclude ASM if they prefer to reduce dependencies. (For example, ASM will not benefit anyone whose tests run in an Android VM.) Still, we have made it a dependency by default (non-<optional>), both because it provides useful functionality and because we have heard of problems with R8 when it is absent. -->
    </dependency>
  </dependencies>
  <build>
    <resources>
      <resource>
        <directory>src/main/java</directory>
        <excludes>
          <exclude>**/*.java</exclude>
          <exclude>**/*.gwt.xml</exclude>
        </excludes>
      </resource>
      <resource>
        <directory>..</directory>
        <includes>
          <include>LICENSE</include>
        </includes>
        <targetPath>META-INF</targetPath>
      </resource>
    </resources>
    <testResources>
      <testResource><directory>src/test/java</directory></testResource>
    </testResources>
    <plugins>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/super/**/*.java</exclude>
          </excludes>
          <testExcludes>
            <testExclude>**/super/**/*.java</testExclude>
          </testExcludes>
          <annotationProcessorPaths>
            <path>
              <groupId>com.google.auto.value</groupId>
              <artifactId>auto-value</artifactId>
              <version>${auto-value.version}</version>
            </path>
          </annotationProcessorPaths>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/super/**</exclude>
            <exclude>**/*.gwt.xml</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-gwt-sources</id>
            <phase>post-integration-test</phase>
            <goals><goal>jar</goal></goals>
            <configuration>
              <classifier>gwt</classifier>
              <classesDirectory>${project.build.directory}/gwt-sources</classesDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/*GwtTest.java</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>gwt-test</id>
            <goals><goal>test</goal></goals>
            <configuration>
              <mode>htmlunit</mode>
              <htmlunit>FF38</htmlunit>
              <productionMode>true</productionMode>
              <!-- Fix OutOfMemoryError in Travis. -->
              <extraJvmArgs>-Xms3500m -Xmx3500m -Xss1024k</extraJvmArgs>
              <sourceLevel>auto</sourceLevel>
              <userAgents>gecko1_8</userAgents>
              <includes>**/*GwtTest.java</includes>
              <!-- Keep these timeouts very large because, if we hit the timeout, the tests silently pass :( -->
              <testTimeOut>86400 <!-- seconds --></testTimeOut>
              <testMethodTimeout>1440 <!-- minutes --></testMethodTimeout>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- We need to strip "@Nullable" from the sources that we hand to GWT:
           b/183648616. To do that, we have to make a copy of the original
           source directory and add that directory as a Maven source root. But
           the added root comes *after* the original root, so, in order to make
           GWT choose those sources in preference to the originals, we need to
           put them in a `super` directory.

           TODO(b/183648616): Once we can use @Nullable from GWT, generate the
           GWT jar from the original sources instead of these sources that we
           strip @Nullable from. -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.4.0</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/gwt-sources</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>copy-gwt-files</id>
            <phase>generate-sources</phase>
            <goals><goal>run</goal></goals>
            <configuration>
              <target name="copy-gwt-resources">
                <copy toDir="${project.build.directory}/gwt-sources">
                  <fileset dir="${project.basedir}/src/main/java">
                    <include name="**/super/**/*.java"/>
                    <include name="**/*.gwt.xml"/>
                  </fileset>
                </copy>
                <copy toDir="${project.build.directory}/gwt-sources/com/google/common/truth/super">
                  <fileset dir="${project.basedir}/src/main/java">
                    <!-- Don't put files under .../super/.../super/... -->
                    <exclude name="**/super/**/*.java"/>
                    <!-- Don't put the .gwt.xml under super -->
                    <exclude name="**/*.gwt.xml"/>
                  </fileset>
                </copy>
                <replace token="@Nullable" value="">
                  <fileset dir="${project.build.directory}/gwt-sources">
                    <include name="**/super/**/*.java"/>
                  </fileset>
                </replace>
                <replace token="@NonNull" value="">
                  <fileset dir="${project.build.directory}/gwt-sources">
                    <include name="**/super/**/*.java"/>
                  </fileset>
                </replace>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.4.5</version>
      </plugin>
    </plugins>
  </reporting>
  <profiles>
    <profile>
      <id>java8</id>
      <activation>
        <jdk>[1.8,)</jdk>
      </activation>
      <properties>
        <javadoc.param>-Xdoclint:none</javadoc.param>
      </properties>
    </profile>
  </profiles>
</project>