Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
larsgrefer committed Aug 27, 2023
1 parent 539ec37 commit 008312d
Showing 1 changed file with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
import lombok.Getter;
import lombok.Setter;
import org.gradle.api.GradleException;
import org.gradle.api.Incubating;
import org.gradle.api.UncheckedIOException;
import org.gradle.api.file.*;
import org.gradle.api.file.ConfigurableFileCollection;
import org.gradle.api.file.DirectoryProperty;
import org.gradle.api.file.EmptyFileVisitor;
import org.gradle.api.file.FileVisitDetails;
import org.gradle.api.internal.plugins.DslObject;
import org.gradle.api.plugins.ExtraPropertiesExtension;
import org.gradle.api.provider.ListProperty;
Expand All @@ -25,6 +27,7 @@
import sass.embedded_protocol.EmbeddedSass.OutboundMessage.VersionResponse;
import sass.embedded_protocol.EmbeddedSass.OutputStyle;

import javax.annotation.Nonnull;
import java.io.File;
import java.io.IOException;
import java.net.URI;
Expand All @@ -38,7 +41,6 @@
@Getter
@Setter
@CacheableTask
@Incubating
public abstract class SassCompile extends SourceTask {

public SassCompile() {
Expand All @@ -51,15 +53,7 @@ public SassCompile() {
}
}

@OutputFiles
protected FileTree getOutputFiles() {
ConfigurableFileTree files = getProject().fileTree(getDestinationDir());
files.include("**/*.css");
files.include("**/*.css.map");
return files;
}

@Internal
@OutputDirectory
public abstract DirectoryProperty getDestinationDir();

@TaskAction
Expand Down Expand Up @@ -91,14 +85,10 @@ public void compileSass() throws IOException {
VersionResponse version = compiler.getVersion();
getLogger().info("{}", version);

getSource().visit(new FileVisitor() {
@Override
public void visitDir(FileVisitDetails fileVisitDetails) {

}
getSource().visit(new EmptyFileVisitor() {

@Override
public void visitFile(FileVisitDetails fileVisitDetails) {
public void visitFile(@Nonnull FileVisitDetails fileVisitDetails) {
String name = fileVisitDetails.getName();
if (name.startsWith("_"))
return;
Expand Down

0 comments on commit 008312d

Please sign in to comment.