aboutsummaryrefslogtreecommitdiff
path: root/guava-gwt/pom.xml
blob: b96ed97bfe199bf9e7df1eef8574aad45194f88c (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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<?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.guava</groupId>
    <artifactId>guava-parent</artifactId>
    <version>27.1-jre</version>
  </parent>
  <artifactId>guava-gwt</artifactId>
  <name>Guava GWT compatible libs</name>
  <description>
    Guava is a suite of core and expanded libraries that include
    utility classes, google's collections, io classes, and much
    much more.

    This project includes GWT-friendly sources.
  </description>
  <properties>
    <!-- We skip GWT tests by default. To run, pass -Dgwt.test.include=**/GwtTestSuite.java -->
    <gwt.test.include>**/DoesNotMatchAnyTests.java</gwt.test.include>
    <gwt.version>2.8.2</gwt.version>
    <gwt.plugin.version>2.8.2</gwt.plugin.version>
    <gwt.logLevel>WARN</gwt.logLevel>
  </properties>
  <repositories>
    <repository>
      <id>sonatype-google-snapshots</id>
      <name>sonatype-google-snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/google-snapshots/</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>sonatype-snapshots</id>
      <name>sonatype-snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>
  <dependencies>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>failureaccess</artifactId>
      <version>1.0.1</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava-testlib</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava-testlib</artifactId>
      <version>${project.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava-tests</artifactId>
      <version>${project.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-dev</artifactId>
      <version>${gwt.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <version>${gwt.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.truth</groupId>
      <artifactId>truth</artifactId>
      <version>${truth.version}</version>
      <classifier>gwt</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.truth.extensions</groupId>
      <artifactId>truth-java8-extension</artifactId>
      <version>${truth.version}</version>
      <classifier>gwt</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.checkerframework</groupId>
      <artifactId>checker-qual</artifactId>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <!-- Disable "normal" testing, which doesn't work for GWT tests. -->
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack-failureaccess-sources</id>
            <phase>generate-resources</phase>
            <goals><goal>unpack-dependencies</goal></goals>
            <configuration>
              <includeArtifactIds>failureaccess</includeArtifactIds>
              <classifier>sources</classifier>
              <excludeTransitive>true</excludeTransitive>
              <excludes>META-INF/MANIFEST.MF</excludes>
              <outputDirectory>${project.build.directory}/failureaccess-sources</outputDirectory>
              <type>java-source</type>
              <silent>false</silent>
            </configuration>
          </execution>
          <execution>
            <id>unpack-guava-sources</id>
            <phase>generate-resources</phase>
            <goals><goal>unpack-dependencies</goal></goals>
            <configuration>
              <includeArtifactIds>guava</includeArtifactIds>
              <classifier>sources</classifier>
              <excludeTransitive>true</excludeTransitive>
              <excludes>META-INF/MANIFEST.MF</excludes>
              <outputDirectory>${project.build.directory}/guava-sources</outputDirectory>
              <type>java-source</type>
              <silent>false</silent>
            </configuration>
          </execution>
          <execution>
            <id>unpack-guava-testlib-sources</id>
            <phase>generate-resources</phase>
            <goals><goal>unpack-dependencies</goal></goals>
            <configuration>
              <includeArtifactIds>guava-testlib</includeArtifactIds>
              <classifier>sources</classifier>
              <excludeTransitive>true</excludeTransitive>
              <excludes>META-INF/MANIFEST.MF</excludes>
              <outputDirectory>${project.build.directory}/guava-test-sources</outputDirectory>
              <type>java-source</type>
              <silent>false</silent>
            </configuration>
          </execution>
          <execution>
            <id>unpack-guava-testlib-test-sources</id>
            <phase>generate-resources</phase>
            <goals><goal>unpack-dependencies</goal></goals>
            <configuration>
              <includeArtifactIds>guava-testlib</includeArtifactIds>
              <classifier>test-sources</classifier>
              <excludeTransitive>true</excludeTransitive>
              <excludes>META-INF/MANIFEST.MF</excludes>
              <outputDirectory>${project.build.directory}/guava-test-sources</outputDirectory>
              <type>java-source</type>
              <silent>false</silent>
            </configuration>
          </execution>
          <execution>
            <id>unpack-guava-test-sources</id>
            <phase>generate-resources</phase>
            <goals><goal>unpack-dependencies</goal></goals>
            <configuration>
              <includeArtifactIds>guava-tests</includeArtifactIds>
              <classifier>test-sources</classifier>
              <excludeTransitive>true</excludeTransitive>
              <excludes>META-INF/MANIFEST.MF</excludes>
              <outputDirectory>${project.build.directory}/guava-test-sources</outputDirectory>
              <type>java-source</type>
              <silent>false</silent>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>failureaccess</artifactId>
            <version>1.0.1</version>
            <classifier>sources</classifier>
          </dependency>
          <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${project.version}</version>
            <classifier>sources</classifier>
          </dependency>
          <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava-testlib</artifactId>
            <version>${project.version}</version>
            <classifier>sources</classifier>
          </dependency>
          <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava-testlib</artifactId>
            <version>${project.version}</version>
            <classifier>test-sources</classifier>
          </dependency>
          <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava-tests</artifactId>
            <version>${project.version}</version>
            <classifier>test-sources</classifier>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-gwt-files</id>
            <phase>generate-resources</phase>
            <goals><goal>run</goal></goals>
            <configuration>
              <target name="copy-gwt-resources">
                <copy toDir="${project.build.directory}/guava-gwt-sources">
                  <fileset dir="${project.build.directory}/guava-sources">
                    <contains text="@GwtCompatible"/>
                  </fileset>
                </copy>
                <!-- The following don't contain @GwtCompatible for dependency reasons. -->
                <copy toDir="${project.build.directory}/guava-gwt-sources">
                  <fileset dir="${project.build.directory}/guava-sources">
                    <include name="**/ListenableFuture.java" />
                  </fileset>
                </copy>
                <copy toDir="${project.build.directory}/guava-gwt-sources">
                  <fileset dir="${project.build.directory}/failureaccess-sources">
                    <include name="**/InternalFutures.java" />
                  </fileset>
                </copy>
                <copy toDir="${project.build.directory}/guava-gwt-sources">
                  <fileset dir="${project.build.directory}/failureaccess-sources">
                    <include name="**/InternalFutureFailureAccess.java" />
                  </fileset>
                </copy>
                <copy toDir="${project.build.directory}/guava-test-gwt-sources">
                  <fileset dir="${project.build.directory}/guava-test-sources">
                    <contains text="@GwtCompatible"/>
                  </fileset>
                </copy>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>${gwt.plugin.version}</version>
        <executions>
          <execution>
            <id>gwt-compile</id>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <module>com.google.common.ForceGuavaCompilation</module>
              <failOnError>true</failOnError>
              <logLevel>${gwt.logLevel}</logLevel>
              <validateOnly>true</validateOnly>
              <sourceLevel>1.8</sourceLevel>
              <!--
                To avoid "java.io.IOException: User limit of inotify watches reached" under JDK10.
                Presumably we don't need inotify, since we don't intend to change files during the
                build?
                -->
              <extraJvmArgs>-Dgwt.watchFileChanges=false</extraJvmArgs>
            </configuration>
          </execution>
          <!--
            GWT issues some scary warnings while running tests, but I believe they are harmless.
            Let's take the warnings for one module, c.g.c.base.testModule, as an example:

              [INFO] Validating units:
              [INFO]    Ignored 53 units with compilation errors in first pass.
              [INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.

            Turning up the log level, we see that GWT is trying to compile classes from other
            packages, like RangeTest. The reason for this is that GWT doesn't distinguish between
            .java files in c.g.c.collect.Collect, a module that the c.g.c.base test module inherits,
            and .java files in c.g.c.collect.testModule, one that it doesn't[*]. Consequently,
            c.g.c.base.testModule transitively pulls in .java files from both modules while reading
            the module description of only the prod module. And the prod module doesn't inherit all
            the modules that the test module classes use, so we get errors.

            The good news is that, despite ignoring errors here, GWT does fail if any errors affect
            classes that are actually used in the module under test.

            One way to eliminate the warnings is to make base.testModule include the not really
            necessary <inherits> lines for c.g.c.collect.testModule, etc. However, adding <inherits>
            lines could make c.g.c.base.testModule transitively inherit from extra modules. If some
            of those modules are ones that it uses but forgets to list in its own <inherits>, we'd
            like to get an error. Currently we do, but if we add the extra <inherits> lines, we
            won't.

            I have one idea for a better approach, but it's painful, and I haven't tested it: We
            could postprocess Collect.gwt.xml to add <skip> lines for all the files that should be
            covered by testModule.gwt.xml. Maybe I'll try it someday.

            [*] https://code.google.com/p/google-web-toolkit/wiki/ResourceOracle#When_multiple_PathPrefix_es_have_the_same_path
                https://code.google.com/p/google-web-toolkit/issues/detail?id=7581
            -->
          <execution>
            <id>gwt-test</id>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <module>com.google.common.GuavaTests</module>
              <includes>${gwt.test.include}</includes>
              <logLevel>${gwt.logLevel}</logLevel>
              <mode>htmlunit</mode>
              <htmlunit>FF38</htmlunit>
              <productionMode>true</productionMode>
              <!-- Fix OutOfMemoryError under Travis. -->
              <extraJvmArgs>-Xms3500m -Xmx3500m -Xss1024k</extraJvmArgs>
              <sourceLevel>1.8</sourceLevel>
              <!-- Keep these timeouts very large because, if we hit the timeout, the tests silently pass :( -->
              <testTimeOut>86400 <!-- seconds --></testTimeOut>
              <testMethodTimeout>1440 <!-- minutes --></testMethodTimeout>
              <!-- Presumably we want watchFileChanges=false here, since we want it for compile: -->
              <extraJvmArgs>-Dgwt.watchFileChanges=false</extraJvmArgs>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <resources>
      <resource>
        <directory>src</directory>
      </resource>
      <resource>
        <directory>src-super</directory>
      </resource>
      <resource>
        <directory>${project.build.directory}/guava-gwt-sources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>test</directory>
      </testResource>
      <testResource>
        <directory>test-super</directory>
      </testResource>
      <testResource>
        <directory>${project.build.directory}/guava-test-gwt-sources</directory>
      </testResource>
    </testResources>
  </build>
</project>