Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,23 @@
</path>
</annotationProcessorPaths>
</configuration>
<executions>
<execution>
<id>compile-java9</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>9</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
<useIncrementalCompilation>false</useIncrementalCompilation>
<moduleVersion>1.0</moduleVersion>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
Expand All @@ -110,6 +127,13 @@
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Multi-Release>true</Multi-Release>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current configuration, I don't think we actually end up producing a multi-release jar, so I think we can get by without this.

</manifestEntries>
</archive>
</configuration>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error #2 from mvn clean install:

[INFO] Running com.google.common.truth.CorrespondenceExceptionStoreTest
[ERROR] Tests run: 6, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.009 s <<< FAILURE! -- in com.google.common.truth.CorrespondenceExceptionStoreTest
[ERROR] com.google.common.truth.CorrespondenceExceptionStoreTest.describeAsMainCause_notEmpty -- Time elapsed: 0.007 s <<< FAILURE!
value of:
    getValue()
expected to match:
    compare\(null, 123\) threw com.google.common.truth.TestCorrespondences\$NullPointerExceptionFromWithin10Of\s+at com\.google\.common\.truth\.TestCorrespondences(.|\n)*\n---
but was:
    compare(null, 123) threw com.google.common.truth.TestCorrespondences$NullPointerExceptionFromWithin10Of
        at [email protected]/com.google.common.truth.TestCorrespondences.lambda$static$1(TestCorrespondences.java:76)
        at [email protected]/com.google.common.truth.Correspondence$FromBinaryPredicate.compare(Correspondence.java:150)
        at [email protected]/com.google.common.truth.Correspondence$FormattingDiffs.compare(Correspondence.java:453)
    
    ---
        at [email protected]/com.google.common.truth.CorrespondenceExceptionStoreTest.assertExpectedFacts(CorrespondenceExceptionStoreTest.java:99)
        at [email protected]/com.google.common.truth.CorrespondenceExceptionStoreTest.describeAsMainCause_notEmpty(CorrespondenceExceptionStoreTest.java:58)
 
[ERROR] com.google.common.truth.CorrespondenceExceptionStoreTest.describeAsAdditionalInfo_notEmpty -- Time elapsed: 0.002 s <<< FAILURE!
value of:
    getValue()
expected to match:
    compare\(null, 123\) threw com.google.common.truth.TestCorrespondences\$NullPointerExceptionFromWithin10Of\s+at com\.google\.common\.truth\.TestCorrespondences(.|\n)*\n---
but was:
    compare(null, 123) threw com.google.common.truth.TestCorrespondences$NullPointerExceptionFromWithin10Of
        at [email protected]/com.google.common.truth.TestCorrespondences.lambda$static$1(TestCorrespondences.java:76)
        at [email protected]/com.google.common.truth.Correspondence$FromBinaryPredicate.compare(Correspondence.java:150)
        at [email protected]/com.google.common.truth.Correspondence$FormattingDiffs.compare(Correspondence.java:453)
    
    ---
        at [email protected]/com.google.common.truth.CorrespondenceExceptionStoreTest.assertExpectedFacts(CorrespondenceExceptionStoreTest.java:99)
        at [email protected]/com.google.common.truth.CorrespondenceExceptionStoreTest.describeAsAdditionalInfo_notEmpty(CorrespondenceExceptionStoreTest.java:73)
 

That should just be a matter of loosening the assertion to accept either style.

Of course, another option for this (and for Error #1) is to see if we can keep maven-surefire-plugin out of "modules mode" for its testing. Having the modular mode set up is nice if it's straightforward, but I don't want you to feel like you need to block the user-facing improvements you need on an internal build improvement, albeit one that might someday help us catch modules-related bugs before you encounter them.

<executions>
<execution>
<id>attach-gwt-sources</id>
Expand Down
27 changes: 27 additions & 0 deletions core/src/main/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) 2024 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.
*/

module com.google.truth {
requires com.google.common;
requires junit;

requires static org.jspecify;
requires static com.google.errorprone.annotations;
requires static org.objectweb.asm;
requires static auto.value.annotations;

exports com.google.common.truth;
}
25 changes: 25 additions & 0 deletions extensions/liteproto/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,31 @@
</path>
</annotationProcessorPaths>
</configuration>
<executions>
<execution>
<id>compile-java9</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>9</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</plugin>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error from mvn clean install -DskipTests:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.14.0:testCompile (default-testCompile) on project truth-liteproto-extension: Compilation failure: Compilation failure:
[ERROR] /usr/local/google/home/cpovirk/clients/truth-green/truth/extensions/liteproto/src/test/java/com/google/common/truth/extensions/liteproto/test/LiteProtoSubjectTest.java:[24,63] package com.google.common.truth.extensions.liteproto.test.proto does not exist
[ERROR] /usr/local/google/home/cpovirk/clients/truth-green/truth/extensions/liteproto/src/test/java/com/google/common/truth/extensions/liteproto/test/LiteProtoSubjectTest.java:[25,63] package com.google.common.truth.extensions.liteproto.test.proto does not exist
[ERROR] /usr/local/google/home/cpovirk/clients/truth-green/truth/extensions/liteproto/src/test/java/com/google/common/truth/extensions/liteproto/test/LiteProtoSubjectTest.java:[26,63] package com.google.common.truth.extensions.liteproto.test.proto does not exist
[ERROR] /usr/local/google/home/cpovirk/clients/truth-green/truth/extensions/liteproto/src/test/java/com/google/common/truth/extensions/liteproto/test/LiteProtoSubjectTest.java:[27,63] package com.google.common.truth.extensions.liteproto.test.proto does not exist
[ERROR] /usr/local/google/home/cpovirk/clients/truth-green/truth/extensions/liteproto/src/test/java/com/google/common/truth/extensions/liteproto/test/LiteProtoSubjectTest.java:[28,63] package com.google.common.truth.extensions.liteproto.test.proto does not exist

I haven't thought about that one, but it might be a matter of moving more stuff or updating more references. I'd encourage you not to worry about it until we discuss the proto/liteproto business more, but I'm noting it here as a record of potential remaining work.

</plugins>
</build>
Expand Down
26 changes: 26 additions & 0 deletions extensions/liteproto/src/main/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2024 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.
*/

module com.google.truth.extensions.liteproto {
requires com.google.truth;
requires com.google.common;

requires static org.jspecify;
requires static com.google.errorprone.annotations;
requires static com.google.protobuf.lite;

exports com.google.common.truth.extensions.proto;
}
25 changes: 25 additions & 0 deletions extensions/proto/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,31 @@
</path>
</annotationProcessorPaths>
</configuration>
<executions>
<execution>
<id>compile-java9</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>9</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
27 changes: 27 additions & 0 deletions extensions/proto/src/main/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) 2024 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.
*/

module com.google.truth.extensions.proto {
requires com.google.truth;
requires com.google.truth.extensions.liteproto;
requires com.google.common;
requires com.google.protobuf;

requires static org.jspecify;
requires static com.google.errorprone.annotations;

exports com.google.common.truth.extensions.proto;
}
28 changes: 28 additions & 0 deletions extensions/re2j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,34 @@
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>compile-java9</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>9</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
22 changes: 22 additions & 0 deletions extensions/re2j/src/main/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2024 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.
*/

module com.google.truth.extensions.re2j {
requires com.google.truth;
requires com.google.re2j;

exports com.google.common.truth.extensions.re2j;
}