diff --git a/eo-maven-plugin/pom.xml b/eo-maven-plugin/pom.xml index 461a403bb2..34ebc4aa73 100644 --- a/eo-maven-plugin/pom.xml +++ b/eo-maven-plugin/pom.xml @@ -175,6 +175,12 @@ SOFTWARE. xml-apis + + com.yegor256 + farea + + 0.7.0 + org.yaml snakeyaml diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/ParseMojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/ParseMojo.java index 45d57d1776..0985b47a3b 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/ParseMojo.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/ParseMojo.java @@ -103,7 +103,10 @@ public void exec() { ).intValue(); if (0 == total) { if (this.scopedTojos().withSources().isEmpty()) { - Logger.info(this, "No new .eo sources need to be parsed to XMIRs"); + Logger.info( + this, + "No .eo sources registered, nothing to be parsed to XMIRs (maybe you forgot to execute the \"register\" goal?)" + ); } else { Logger.info(this, "No new .eo sources parsed to XMIRs"); } diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/ParseMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/ParseMojoTest.java index d9d001d870..352de095a2 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/ParseMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/ParseMojoTest.java @@ -24,6 +24,8 @@ package org.eolang.maven; import com.yegor256.WeAreOnline; +import com.yegor256.farea.Farea; +import com.yegor256.farea.RequisiteMatcher; import java.io.File; import java.io.IOException; import java.nio.file.Files; @@ -56,6 +58,34 @@ @SuppressWarnings("PMD.AvoidDuplicateLiterals") final class ParseMojoTest { + @Test + void parsesSimpleFile(@TempDir final Path temp) throws Exception { + new Farea(temp).together( + f -> { + f.clean(); + f.files().file("src/main/eo/foo.eo").write( + "# Simple object.\n[] > foo\n".getBytes() + ); + f.build() + .plugins() + .appendItself() + .execution() + .goals("register", "parse"); + f.exec("compile", String.format("-Deo.cache=%s", temp.resolve("cache"))); + MatcherAssert.assertThat( + "build has no problems", + f.log(), + RequisiteMatcher.SUCCESS + ); + MatcherAssert.assertThat( + "the XMIR file is generated", + f.files().file("target/eo/1-parse/foo.xmir").exists(), + Matchers.is(true) + ); + } + ); + } + @Test void parsesSuccessfully(@TempDir final Path temp) throws Exception { final FakeMaven maven = new FakeMaven(temp); diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/PhiMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/PhiMojoTest.java index 29daf05064..6608015d30 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/PhiMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/PhiMojoTest.java @@ -23,6 +23,8 @@ */ package org.eolang.maven; +import com.yegor256.farea.Farea; +import com.yegor256.farea.RequisiteMatcher; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; @@ -43,6 +45,7 @@ * Test cases for {@link PhiMojo}. * @since 0.34.0 */ +@SuppressWarnings("PMD.TooManyMethods") final class PhiMojoTest { /** * Comment. @@ -50,6 +53,35 @@ final class PhiMojoTest { private static final String COMMENT = "# This is the default 64+ symbols comment in front of named abstract object."; + @Test + void convertsSimpleObjectToPhi(@TempDir final Path temp) throws Exception { + new Farea(temp).together( + f -> { + f.clean(); + f.files().file("src/main/eo/foo.eo").write( + String.format("%s\n[] > foo\n", PhiMojoTest.COMMENT).getBytes() + ); + f.build() + .plugins() + .appendItself() + .execution() + .goals("register", "parse", "optimize", "xmir-to-phi"); + f.exec("compile"); + MatcherAssert.assertThat( + "build has no problems", + f.log(), + RequisiteMatcher.SUCCESS + ); + MatcherAssert.assertThat( + "the .phi file is generated", + f.files().file("target/eo/phi/foo.phi").exists(), + Matchers.is(true) + ); + f.files().show(); + } + ); + } + @Test void createsFiles(@TempDir final Path temp) throws Exception { MatcherAssert.assertThat( diff --git a/eo-runtime/pom.xml b/eo-runtime/pom.xml index 677b9f93fe..99f726177e 100644 --- a/eo-runtime/pom.xml +++ b/eo-runtime/pom.xml @@ -143,8 +143,7 @@ SOFTWARE. com.yegor256 farea - 0.6.0 - test + org.eolang diff --git a/pom.xml b/pom.xml index 2296872dd2..7215687fc2 100644 --- a/pom.xml +++ b/pom.xml @@ -251,6 +251,12 @@ SOFTWARE. test 0.0.5 + + com.yegor256 + farea + 0.7.0 + test +