eo
eo copied to clipboard
#1063 eo-maven-plugin:clean
@Graur take a look, please
#1063
Added some logging:
Case with static method
try(Stream<Path> paths = Files.walk(this.targetDir.toPath())) {
paths.sorted(Comparator.reverseOrder())
.map(Path::toFile)
.forEach(dir -> {
purge(dir);
Logger.info(
this,
"purged %s",
dir.toString()
);
});
}
Logs:
[INFO] org.eolang.maven.CleanMojo: purged /var/folders/3f/gxppnjks1f1crcj40mh04c700000gn/T/junit11832602380216143546/target/some16270794897569917092.eo [INFO] org.eolang.maven.CleanMojo: purged /var/folders/3f/gxppnjks1f1crcj40mh04c700000gn/T/junit11832602380216143546/target/child/child.eo [INFO] org.eolang.maven.CleanMojo: purged /var/folders/3f/gxppnjks1f1crcj40mh04c700000gn/T/junit11832602380216143546/target/child [INFO] org.eolang.maven.CleanMojo: purged /var/folders/3f/gxppnjks1f1crcj40mh04c700000gn/T/junit11832602380216143546/target [INFO] org.eolang.maven.CleanMojo: Deleted target: /var/folders/3f/gxppnjks1f1crcj40mh04c700000gn/T/junit11832602380216143546/target
Case with Walk
class
new Walk(this.targetDir.toPath())
.stream()
.sorted(Comparator.reverseOrder())
.map(Path::toFile)
.forEach(
dir ->{
purge(dir);
Logger.info(
this,
"purged %s",
dir.toString()
);
}
);
Logs:
> [INFO] org.eolang.maven.CleanMojo: purged /var/folders/3f/gxppnjks1f1crcj40mh04c700000gn/T/junit5920592594147381947/target/some17529429556376472717.eo
> [INFO] org.eolang.maven.CleanMojo: Deleted target: /var/folders/3f/gxppnjks1f1crcj40mh04c700000gn/T/junit5920592594147381947/target
for some reason it's not iterates trough all dirs, @Graur do you have any idea what's causing this?
@Graur i'm found way to fix this, created new method in Walk
class and call it reversed()
, what do you think?
/**
* The reversed walk.
* @return New Walk reversed
* @throws IOException If fails
*/
Walk reversed() throws IOException {
return new Walk(
this.home,
Files.walk(this.home)
.sorted(Comparator.reverseOrder())
.collect(Collectors.toList())
);
}
@Graur take a look, please.
On my local machine the build succeeds, but on CI Save
does not exist?
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for eo 1.0-SNAPSHOT:
[INFO]
[INFO] eo ................................................. SUCCESS [ 1.309 s]
[INFO] eo-parser .......................................... SUCCESS [ 10.673 s]
[INFO] eo-maven-plugin .................................... SUCCESS [ 50.830 s]
[INFO] eo-runtime ......................................... SUCCESS [ 37.005 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:40 min
[INFO] Finished at: 2022-09-21T15:11:54+03:00
[INFO] ------------------------------------------------------------------------
@l3r8yJ Please, do merge from upstream/master branch to your local branch and try again
@Graur we passed, take a look, please)
@Graur fixed, take a look, please
@l3r8yJ I'm sorry about the delay. Please, check my comments above.
@yegor256 sure
@yegor256 have a look, please
@l3r8yJ @Graur not yet perfect, see above
@Graur have a look, please
@yegor256 have a look, please
@rultor merge
@l3r8yJ Thanks!