eo icon indicating copy to clipboard operation
eo copied to clipboard

#1063 eo-maven-plugin:clean

Open l3r8yJ opened this issue 1 year ago • 6 comments

@Graur take a look, please

#1063

l3r8yJ avatar Sep 19 '22 17:09 l3r8yJ

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?

l3r8yJ avatar Sep 20 '22 12:09 l3r8yJ

@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())
        );
    }

l3r8yJ avatar Sep 21 '22 11:09 l3r8yJ

@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 avatar Sep 21 '22 12:09 l3r8yJ

@l3r8yJ Please, do merge from upstream/master branch to your local branch and try again

Graur avatar Sep 21 '22 12:09 Graur

@Graur we passed, take a look, please)

l3r8yJ avatar Sep 21 '22 12:09 l3r8yJ

@Graur fixed, take a look, please

l3r8yJ avatar Sep 21 '22 13:09 l3r8yJ

@l3r8yJ I'm sorry about the delay. Please, check my comments above.

yegor256 avatar Oct 10 '22 13:10 yegor256

@yegor256 sure

l3r8yJ avatar Oct 17 '22 17:10 l3r8yJ

@yegor256 have a look, please

l3r8yJ avatar Oct 19 '22 12:10 l3r8yJ

@l3r8yJ @Graur not yet perfect, see above

yegor256 avatar Oct 19 '22 12:10 yegor256

@Graur have a look, please

l3r8yJ avatar Oct 19 '22 12:10 l3r8yJ

@yegor256 have a look, please

l3r8yJ avatar Oct 19 '22 13:10 l3r8yJ

@rultor merge

yegor256 avatar Oct 19 '22 16:10 yegor256

@rultor merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

rultor avatar Oct 19 '22 16:10 rultor

@rultor merge

@yegor256 Done! FYI, the full log is here (took me 7min)

rultor avatar Oct 19 '22 16:10 rultor

@l3r8yJ Thanks!

Graur avatar Oct 19 '22 17:10 Graur