diff --git a/core/pom.xml b/core/pom.xml index 720b509c2..91000d4d6 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -5,10 +5,13 @@ com.google.truth truth-parent - HEAD-SNAPSHOT + 999.0.0-SNAPSHOT truth Truth Core + + + com.google.guava @@ -128,6 +131,9 @@ maven-surefire-plugin + + ${test.add.exports} + default-test @@ -263,6 +269,42 @@ + + java9-plus + + [9,) + + + + --add-exports com.google.truth/com.google.common.truth.extension=junit,ALL-UNNAMED + + + + + maven-compiler-plugin + + + compile-java9 + compile + + compile + + + 9 + + ${project.basedir}/src/main/java9 + + false + + + + + + + java8 diff --git a/core/src/main/java9/module-info.java b/core/src/main/java9/module-info.java new file mode 100644 index 000000000..a78387ad7 --- /dev/null +++ b/core/src/main/java9/module-info.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2025 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 transitive com.google.common; + + /* + * AutoValue's annotations aren't ready for the module system: + * https://github.com/google/auto/issues/597. Let's hope that our usages are internal enough that + * we don't need to worry about listing them here. + */ + + requires static transitive com.google.errorprone.annotations; + requires static transitive com.google.j2objc.annotations; + requires static transitive junit; + requires static transitive org.jspecify; + requires static transitive org.objectweb.asm; + + exports com.google.common.truth; +} diff --git a/core/src/test/java/com/google/common/truth/CorrespondenceExceptionStoreTest.java b/core/src/test/java/com/google/common/truth/CorrespondenceExceptionStoreTest.java index 6b18bacb7..feb25fbaa 100644 --- a/core/src/test/java/com/google/common/truth/CorrespondenceExceptionStoreTest.java +++ b/core/src/test/java/com/google/common/truth/CorrespondenceExceptionStoreTest.java @@ -101,8 +101,9 @@ private static void assertExpectedFacts(Iterable facts, String expectedFir + "com.google.common.truth.TestCorrespondences\\$NullPointerExceptionFromWithin10Of" // some whitespace: + "\\s+" - // the start of a stack trace, with the correct class: - + "at com\\.google\\.common\\.truth\\.TestCorrespondences" + // the start of a stack trace, optionally with the module name and version, + // and the correct class: + + "at (?:[^/]+/)?com\\.google\\.common\\.truth\\.TestCorrespondences" // the rest of the stack trace, which we don't validate (and may contain newlines): + "(.|\\n)*" // the expected separator diff --git a/extensions/java8/pom.xml b/extensions/java8/pom.xml index b6f38c544..bcbb2ba42 100644 --- a/extensions/java8/pom.xml +++ b/extensions/java8/pom.xml @@ -7,7 +7,7 @@ com.google.truth.extensions truth-extensions-parent - HEAD-SNAPSHOT + 999.0.0-SNAPSHOT truth-java8-extension Obsolete Truth Extension for Java8 diff --git a/extensions/liteproto/pom.xml b/extensions/liteproto/pom.xml index a70faa5d8..21dea4bc2 100644 --- a/extensions/liteproto/pom.xml +++ b/extensions/liteproto/pom.xml @@ -7,7 +7,7 @@ com.google.truth.extensions truth-extensions-parent - HEAD-SNAPSHOT + 999.0.0-SNAPSHOT truth-liteproto-extension Truth Extension for Lite Protocol Buffers diff --git a/extensions/pom.xml b/extensions/pom.xml index a3af92922..f5549cf66 100644 --- a/extensions/pom.xml +++ b/extensions/pom.xml @@ -7,7 +7,7 @@ com.google.truth truth-parent - HEAD-SNAPSHOT + 999.0.0-SNAPSHOT com.google.truth.extensions truth-extensions-parent diff --git a/extensions/proto/pom.xml b/extensions/proto/pom.xml index d52855799..649ef78c3 100644 --- a/extensions/proto/pom.xml +++ b/extensions/proto/pom.xml @@ -7,7 +7,7 @@ com.google.truth.extensions truth-extensions-parent - HEAD-SNAPSHOT + 999.0.0-SNAPSHOT truth-proto-extension Truth Extension for Protocol Buffers diff --git a/extensions/re2j/pom.xml b/extensions/re2j/pom.xml index 6ca4180ce..ae497198c 100644 --- a/extensions/re2j/pom.xml +++ b/extensions/re2j/pom.xml @@ -7,7 +7,7 @@ com.google.truth.extensions truth-extensions-parent - HEAD-SNAPSHOT + 999.0.0-SNAPSHOT truth-re2j-extension Truth Extension for RE2J diff --git a/pom.xml b/pom.xml index d23431246..b2bad88c0 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 4.0.0 com.google.truth truth-parent - HEAD-SNAPSHOT + 999.0.0-SNAPSHOT pom Truth (Parent) @@ -249,6 +249,7 @@ -Xdoclint:-html ${conditionalJavadoc9PlusOptions} + true Truth ${project.version} Truth ${project.version} true