Skip to content

Commit

Permalink
Ignore java source code for lombok config up-to-date checks
Browse files Browse the repository at this point in the history
see #549
  • Loading branch information
larsgrefer committed Sep 16, 2022
1 parent efbc32e commit 51a15c1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/lombok/lombok.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import dummy/foo.config
#import dummy/foo.config
config.stopbubbling = false
lombok.allArgsConstructor.flagUsage=WARNING
lombok.extern.findbugs.addSuppressFBWarnings = true
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.util.*;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -78,8 +79,7 @@ public class LombokConfig extends DefaultTask implements LombokTask {
/**
* Paths to java files or directories the configuration is to be printed for.
*/
@InputFiles
@PathSensitive(PathSensitivity.ABSOLUTE)
@Internal
private final ConfigurableFileCollection paths = getProject().getObjects().fileCollection();

@OutputFile
Expand All @@ -97,6 +97,14 @@ public LombokConfig(WorkerExecutor workerExecutor, FileSystemOperations fileSyst
getOutputs().upToDateWhen(t -> ((LombokConfig) t).getConfigFiles() != null);
}

@Input
protected List<String> getInputPaths() {
return getPaths().getFiles()
.stream()
.map(File::getPath)
.collect(Collectors.toList());
}

@InputFiles
@Optional
@Nullable
Expand Down Expand Up @@ -158,7 +166,7 @@ public void exec() throws IOException {
}

if (fork.getOrElse(false)) {
try (OutputStream out = new FileOutputStream(outputFile.getAsFile().get())) {
try (OutputStream out = Files.newOutputStream(outputFile.getAsFile().get().toPath())) {

execOperations.javaexec(config -> {
if (launcher.isPresent()) {
Expand Down

0 comments on commit 51a15c1

Please sign in to comment.