diff --git a/build-tools/parent/pom.xml b/build-tools/parent/pom.xml index 556b9e91..ca04f778 100644 --- a/build-tools/parent/pom.xml +++ b/build-tools/parent/pom.xml @@ -14,6 +14,49 @@ pom + + + multi-release-java9 + + + src/main/java9 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + compile-java9 + + compile + + + 9 + + ${project.basedir}/src/main/java9 + + true + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + + + + + + + tests diff --git a/oo-equivalence/equivalence-base/src/main/java9/module-info.java b/oo-equivalence/equivalence-base/src/main/java9/module-info.java new file mode 100644 index 00000000..0972f4ad --- /dev/null +++ b/oo-equivalence/equivalence-base/src/main/java9/module-info.java @@ -0,0 +1,29 @@ +/*- + * =========================================================================== + * equivalence-base + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Copyright (C) 2019 - 2023 Kapralov Sergey + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * ============================================================================ + */ +module com.pragmaticobjects.oo.equivalence.base { + requires java.base; + exports com.pragmaticobjects.oo.equivalence.base; +} diff --git a/oo-equivalence/equivalence-codegen/src/main/java/com/pragmaticobjects/oo/equivalence/codegen/cn/CnFromPath.java b/oo-equivalence/equivalence-codegen/src/main/java/com/pragmaticobjects/oo/equivalence/codegen/cn/CnFromPath.java index efc3f467..44ad4b79 100644 --- a/oo-equivalence/equivalence-codegen/src/main/java/com/pragmaticobjects/oo/equivalence/codegen/cn/CnFromPath.java +++ b/oo-equivalence/equivalence-codegen/src/main/java/com/pragmaticobjects/oo/equivalence/codegen/cn/CnFromPath.java @@ -60,7 +60,7 @@ public final List classNames() { .map(p -> List.ofAll(StreamSupport.stream(p.spliterator(), false))) .map(pl -> pl.map(Object::toString).collect(Collectors.joining("."))) .map(s -> s.replaceFirst(".class$", "")) - .filter(s -> !"module-info".equals(s)) + .filter(s -> !s.endsWith("module-info")) .collect(List.collector()); return classes; } catch(Exception ex) { diff --git a/oo-equivalence/equivalence-codegen/src/test/java/com/pragmaticobjects/oo/equivalence/codegen/cn/CnFromPathTest.java b/oo-equivalence/equivalence-codegen/src/test/java/com/pragmaticobjects/oo/equivalence/codegen/cn/CnFromPathTest.java index 4b861bfc..734d065b 100644 --- a/oo-equivalence/equivalence-codegen/src/test/java/com/pragmaticobjects/oo/equivalence/codegen/cn/CnFromPathTest.java +++ b/oo-equivalence/equivalence-codegen/src/test/java/com/pragmaticobjects/oo/equivalence/codegen/cn/CnFromPathTest.java @@ -63,6 +63,15 @@ public CnFromPathTest() { ), Paths.get("module-info.class") ) + ), + new TestCase( + "ignores module-info.class in multi-release project", + new AssertSimulatingClasspath( + path -> new AssertZeroClassNames( + new CnFromPath(path) + ), + Paths.get("META-INF/versions/9/module-info.class") + ) ) ); }