Skip to content

Commit

Permalink
bug(objectionary#3790): xsline
Browse files Browse the repository at this point in the history
  • Loading branch information
maxonfjvipon committed Dec 29, 2024
1 parent 8ce3934 commit 3261a41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
11 changes: 5 additions & 6 deletions eo-maven-plugin/src/main/java/org/eolang/maven/ShakeMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import com.yegor256.xsline.Xsline;
import java.nio.file.Path;
import java.util.Collection;
import java.util.function.Function;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
Expand Down Expand Up @@ -83,7 +82,7 @@ public final class ShakeMojo extends SafeMojo {
public void exec() {
final long start = System.currentTimeMillis();
final Collection<ForeignTojo> tojos = this.scopedTojos().withXmir();
final Function<XML, XML> transformations = this.transformations();
final Xsline transformations = this.transformations();
final int total = new Threaded<>(
new Filtered<>(
ForeignTojo::notShaken,
Expand All @@ -110,7 +109,7 @@ public void exec() {
* @return Amount of optimized XMIR files
* @throws Exception If fails
*/
private int shaken(final ForeignTojo tojo, final Function<XML, XML> transformations)
private int shaken(final ForeignTojo tojo, final Xsline transformations)
throws Exception {
final Path source = tojo.xmir();
final XML xmir = new XMLDocument(source);
Expand All @@ -119,7 +118,7 @@ private int shaken(final ForeignTojo tojo, final Function<XML, XML> transformati
final Path target = new Place(name).make(base, AssembleMojo.XMIR);
tojo.withShaken(
new FpDefault(
src -> transformations.apply(xmir).toString(),
src -> transformations.pass(xmir).toString(),
this.cache.toPath().resolve(ShakeMojo.CACHE),
this.plugin.getVersion(),
new TojoHash(tojo),
Expand All @@ -133,7 +132,7 @@ private int shaken(final ForeignTojo tojo, final Function<XML, XML> transformati
* Shake XSL transformations.
* @return Shake XSL transformations for all tojos.
*/
private Function<XML, XML> transformations() {
private Xsline transformations() {
final Train<Shift> measured = this.measured(new TrShaking());
final Train<Shift> train;
if (this.trackTransformationSteps) {
Expand All @@ -146,6 +145,6 @@ private Function<XML, XML> transformations() {
} else {
train = measured;
}
return new Xsline(train)::pass;
return new Xsline(train);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import java.util.Collection;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.function.Supplier;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
Expand Down Expand Up @@ -166,7 +165,7 @@ public final class TranspileMojo extends SafeMojo {
@Override
public void exec() {
final Collection<ForeignTojo> sources = this.scopedTojos().withShaken();
final Function<XML, XML> transpilation = this.transpilation();
final Xsline transpilation = this.transpilation();
final int saved = new Threaded<>(
sources,
tojo -> this.transpiled(tojo, transpilation)
Expand Down Expand Up @@ -198,7 +197,7 @@ public void exec() {
* @return Number of transpiled files.
* @throws java.io.IOException If any issues with I/O
*/
private int transpiled(final ForeignTojo tojo, final Function<XML, XML> transpilation)
private int transpiled(final ForeignTojo tojo, final Xsline transpilation)
throws IOException {
final Path source = tojo.shaken();;
final XML xmir = new XMLDocument(source);
Expand All @@ -211,7 +210,7 @@ private int transpiled(final ForeignTojo tojo, final Function<XML, XML> transpil
new FpDefault(
src -> {
rewrite.set(true);
return transpilation.apply(xmir).toString();
return transpilation.pass(xmir).toString();
},
this.cache.toPath().resolve(TranspileMojo.CACHE),
this.plugin.getVersion(),
Expand All @@ -225,15 +224,15 @@ private int transpiled(final ForeignTojo tojo, final Function<XML, XML> transpil
* Transpile optimization.
* @return Optimization that transpiles
*/
private Function<XML, XML> transpilation() {
private Xsline transpilation() {
return new Xsline(
new TrSpy(
this.measured(TranspileMojo.TRAIN),
new StickyFunc<>(
new ProgramPlace(this.targetDir.toPath().resolve(TranspileMojo.PRE))
)
)
)::pass;
);
}

/**
Expand Down

0 comments on commit 3261a41

Please sign in to comment.