1111import lombok .Getter ;
1212import lombok .Setter ;
1313import org .gradle .api .GradleException ;
14- import org .gradle .api .Incubating ;
1514import org .gradle .api .UncheckedIOException ;
16- import org .gradle .api .file .*;
15+ import org .gradle .api .file .ConfigurableFileCollection ;
16+ import org .gradle .api .file .DirectoryProperty ;
17+ import org .gradle .api .file .EmptyFileVisitor ;
18+ import org .gradle .api .file .FileVisitDetails ;
1719import org .gradle .api .internal .plugins .DslObject ;
1820import org .gradle .api .plugins .ExtraPropertiesExtension ;
1921import org .gradle .api .provider .ListProperty ;
2527import sass .embedded_protocol .EmbeddedSass .OutboundMessage .VersionResponse ;
2628import sass .embedded_protocol .EmbeddedSass .OutputStyle ;
2729
30+ import javax .annotation .Nonnull ;
2831import java .io .File ;
2932import java .io .IOException ;
3033import java .net .URI ;
3841@ Getter
3942@ Setter
4043@ CacheableTask
41- @ Incubating
4244public abstract class SassCompile extends SourceTask {
4345
4446 public SassCompile () {
@@ -51,15 +53,7 @@ public SassCompile() {
5153 }
5254 }
5355
54- @ OutputFiles
55- protected FileTree getOutputFiles () {
56- ConfigurableFileTree files = getProject ().fileTree (getDestinationDir ());
57- files .include ("**/*.css" );
58- files .include ("**/*.css.map" );
59- return files ;
60- }
61-
62- @ Internal
56+ @ OutputDirectory
6357 public abstract DirectoryProperty getDestinationDir ();
6458
6559 @ TaskAction
@@ -91,14 +85,10 @@ public void compileSass() throws IOException {
9185 VersionResponse version = compiler .getVersion ();
9286 getLogger ().info ("{}" , version );
9387
94- getSource ().visit (new FileVisitor () {
95- @ Override
96- public void visitDir (FileVisitDetails fileVisitDetails ) {
97-
98- }
88+ getSource ().visit (new EmptyFileVisitor () {
9989
10090 @ Override
101- public void visitFile (FileVisitDetails fileVisitDetails ) {
91+ public void visitFile (@ Nonnull FileVisitDetails fileVisitDetails ) {
10292 String name = fileVisitDetails .getName ();
10393 if (name .startsWith ("_" ))
10494 return ;
0 commit comments