Skip to content

Commit

Permalink
Use target/ directory for default cachedir (#385)
Browse files Browse the repository at this point in the history
This closes #382
  • Loading branch information
ctubbsii authored Jul 30, 2020
1 parent 624231d commit 2965827
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main/java/net/revelc/code/formatter/FormatterMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,26 @@ public class FormatterMojo extends AbstractMojo implements ConfigurationSource {
private File basedir;

/**
* Projects cache directory. This file is a hash cache of the files in the project source. It can be preserved in
* source code such that it ensures builds are always fast by not unnecessarily writing files constantly. It can
* also be added to gitignore in case startup is not necessary. It further can be redirected to another location.
* Projects cache directory.
*
* <p>
* This file is a hash cache of the files in the project source. It can be preserved in source code such that it
* ensures builds are always fast by not unnecessarily writing files constantly. It can also be added to gitignore
* in case startup is not necessary. It further can be redirected to another location.
*
* <p>
* When stored in the repository, the cache if run on cross platforms will display the files multiple times due to
* line ending differences on the platform.
*
* <p>
* The cache itself has been part of formatter plugin for a long time but was hidden in target directory and did not
* survive clean phase when it should. This is not intended to be clean in that way as one would want as close to a
* no-op as possible when files are already all formatted and/or have not been otherwise touched. This is used based
* off the files in the project so it is as much part of the source as any other file is.
*
* @since 2.12.1
*/
@Parameter(defaultValue = "${project.basedir}/.cache")
@Parameter(defaultValue = "${project.build.directory}")
private File cachedir;

/**
Expand Down

0 comments on commit 2965827

Please sign in to comment.