Skip to content

Commit

Permalink
Merge branch 'main' of github.com:freefair/gradle-plugins into fix/13…
Browse files Browse the repository at this point in the history
…02-java-fork-options-and-tmpdir
  • Loading branch information
larsgrefer committed Feb 25, 2025
2 parents 5ab2240 + 175d71c commit 180d55e
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
import org.gradle.api.file.FileVisitDetails;
import org.gradle.api.internal.plugins.DslObject;
import org.gradle.api.plugins.ExtraPropertiesExtension;
import org.gradle.api.problems.Problems;
import org.gradle.api.problems.Severity;
import org.gradle.api.problems.*;
import org.gradle.api.provider.ListProperty;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.*;
Expand All @@ -46,6 +45,8 @@
@CacheableTask
public abstract class SassCompile extends SourceTask {

public static final ProblemGroup PROBLEM_GROUP = ProblemGroup.create("sass", "Sass compiler");

public SassCompile() {
include("**/*.scss");
include("**/*.sass");
Expand Down Expand Up @@ -149,13 +150,12 @@ public void visitFile(@Nonnull FileVisitDetails fileVisitDetails) {

getLogger().error(sassError.getMessage());

throw getProblems().getReporter()
.throwing(problemSpec -> problemSpec
.id("sass-compilation-failed", "Sass Compilation Failed")
.lineInFileLocation(sassError.getSpan().getUrl(), sassError.getSpan().getStart().getLine(), sassError.getSpan().getStart().getColumn())
.withException(new RuntimeException(e))
.details(sassError.getFormatted())
.severity(Severity.ERROR));
ProblemId problemId = ProblemId.create("sass-compilation-failed", "Sass Compilation Failed", PROBLEM_GROUP);
throw getProblems().getReporter().throwing(e, problemId, problemSpec -> {
problemSpec.lineInFileLocation(sassError.getSpan().getUrl(), sassError.getSpan().getStart().getLine(), sassError.getSpan().getStart().getColumn());
problemSpec.details(sassError.getFormatted());
problemSpec.severity(Severity.ERROR);
});

} catch (IOException e) {
getLogger().error(e.getLocalizedMessage());
Expand Down
6 changes: 6 additions & 0 deletions examples/plantuml/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import io.freefair.gradle.plugins.plantuml.PlantumlTask

plugins {
id "base"
id "io.freefair.plantuml"
}

Expand All @@ -15,3 +16,8 @@ tasks.register("plantUml2", PlantumlTask) {
fileFormat = "SVG"
outputDirectory = layout.buildDirectory.dir("dist2")
}


tasks.withType(PlantumlTask).configureEach {
tasks.getByName("build").dependsOn(it)
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
import org.gradle.api.DefaultTask;
import org.gradle.api.GradleException;
import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.problems.ProblemGroup;
import org.gradle.api.problems.ProblemId;
import org.gradle.api.problems.Problems;
import org.gradle.api.problems.Severity;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.InputFile;
Expand All @@ -25,6 +28,8 @@
*/
public abstract class ValidateMavenPom extends DefaultTask implements VerificationTask {

public static final ProblemGroup PROBLEM_GROUP = ProblemGroup.create("validate-maven-pom", "Maven Pom Validation");

@Inject
public abstract Problems getProblems();

Expand Down Expand Up @@ -118,12 +123,12 @@ private void logError(String element) {
errorFound = true;
getLogger().error("No {} found in {}", element, getPomFile().getAsFile().get());
try {
getProblems()
.getReporter()
.reporting(problem -> problem.id("maven-pom", "Missing Element in Maven Pom")
.fileLocation(getPomFile().getAsFile().get().getPath())
.details("No " + element + " found")
);
ProblemId problemId = ProblemId.create("maven-pom", "Missing Element in Maven Pom", PROBLEM_GROUP);
getProblems().getReporter().report(problemId, problemSpec -> {
problemSpec.fileLocation(getPomFile().getAsFile().get().getPath());
problemSpec.details("No " + element + " found");
problemSpec.severity(Severity.ERROR);
});
} catch (LinkageError e) {
// https://github.com/freefair/gradle-plugins/issues/1299
getLogger().info("Incompatible Gradle Version", e);
Expand Down

0 comments on commit 180d55e

Please sign in to comment.