From 5c8b177a0dd035dc58ba80abbc34f11979ab7e60 Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Thu, 19 Sep 2024 02:48:44 +0200 Subject: [PATCH 01/46] Update to dart-sass 1.79.1 and embedded-protocol 3.0.0 --- gradle.properties | 4 +- sass-embedded-host/build.gradle | 3 + .../embedded/functions/ConversionService.java | 50 +- .../sass/embedded/functions/SassColor.java | 635 +++--------------- .../sass/embedded/util/ColorUtil.java | 140 ++-- .../sass/embedded/util/ColorValidator.java | 37 +- .../sass/embedded/util/ProtocolUtil.java | 16 +- .../sass/embedded/SassCompilerTest.java | 7 +- .../connection/ConnectionFactoryTest.java | 2 +- .../functions/ConversionServiceTest.java | 6 +- .../embedded/functions/SassColorTest.java | 37 +- .../sass/embedded/util/ColorUtilTest.java | 58 +- .../embedded/util/ColorValidatorTest.java | 46 +- 13 files changed, 292 insertions(+), 749 deletions(-) diff --git a/gradle.properties b/gradle.properties index b5371934..cbe7325f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -dartSassVersion=1.77.8 -embeddedProtocolVersion=2.7.1 +dartSassVersion=1.79.1 +embeddedProtocolVersion=3.0.0 spring5Verison=5.3.32 spring6Version=6.1.4 diff --git a/sass-embedded-host/build.gradle b/sass-embedded-host/build.gradle index 8c821dfe..309d1730 100644 --- a/sass-embedded-host/build.gradle +++ b/sass-embedded-host/build.gradle @@ -47,4 +47,7 @@ dependencies { tasks.named("processResources", ProcessResources) { expand(project.getProperties()) + inputs.property("projectVersion", project.version) + inputs.property("embeddedProtocolVersion", embeddedProtocolVersion) + inputs.property("dartSassVersion", dartSassVersion) } diff --git a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/functions/ConversionService.java b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/functions/ConversionService.java index f54a77da..2d19ef23 100644 --- a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/functions/ConversionService.java +++ b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/functions/ConversionService.java @@ -3,9 +3,7 @@ import com.sass_lang.embedded_protocol.SingletonValue; import com.sass_lang.embedded_protocol.Value; import com.sass_lang.embedded_protocol.Value.Calculation; -import com.sass_lang.embedded_protocol.Value.HslColor; -import com.sass_lang.embedded_protocol.Value.HwbColor; -import com.sass_lang.embedded_protocol.Value.RgbColor; +import com.sass_lang.embedded_protocol.Value.Color; import de.larsgrefer.sass.embedded.util.ColorUtil; import lombok.NonNull; import lombok.experimental.UtilityClass; @@ -88,12 +86,8 @@ static Value toSassValue(@Nullable Object object) { return value((Value.Number) object); } - if (object instanceof RgbColor) { - return value((RgbColor) object); - } - - if (object instanceof HslColor) { - return value((HslColor) object); + if (object instanceof Color) { + return value((Color) object); } if (object instanceof Value.List) { @@ -120,10 +114,6 @@ static Value toSassValue(@Nullable Object object) { return value((Value.ArgumentList) object); } - if (object instanceof HwbColor) { - return value((HwbColor) object); - } - if (object instanceof Calculation) { return value((Calculation) object); } @@ -174,39 +164,13 @@ static T toJavaValue(@NonNull Value value, Class targetType, Type paramet } else { throw new IllegalArgumentException("Cant convert sass Number to " + targetType); } - case RGB_COLOR: - RgbColor rgbColor = value.getRgbColor(); - if (targetType.isAssignableFrom(RgbColor.class)) { - return (T) rgbColor; - } else if (targetType.isAssignableFrom(HslColor.class)) { - return (T) ColorUtil.toHslColor(rgbColor); - } else if (targetType.isAssignableFrom(HwbColor.class)) { - return (T) ColorUtil.toHwbColor(rgbColor); + case COLOR: + Color color = value.getColor(); + if (targetType.isAssignableFrom(Color.class)) { + return (T) color; } else { throw new IllegalArgumentException("Cant convert sass RgbColor to " + targetType); } - case HSL_COLOR: - HslColor hslColor = value.getHslColor(); - if (targetType.isAssignableFrom(RgbColor.class)) { - return (T) ColorUtil.toRgbColor(hslColor); - } else if (targetType.isAssignableFrom(HslColor.class)) { - return (T) hslColor; - } else if (targetType.isAssignableFrom(HwbColor.class)) { - return (T) ColorUtil.toHwbColor(hslColor); - } else { - throw new IllegalArgumentException("Cant convert sass HslColor to " + targetType); - } - case HWB_COLOR: - HwbColor hwbColor = value.getHwbColor(); - if (targetType.isAssignableFrom(RgbColor.class)) { - return (T) ColorUtil.toRgbColor(hwbColor); - } else if (targetType.isAssignableFrom(HslColor.class)) { - return (T) ColorUtil.toHslColor(hwbColor); - } else if (targetType.isAssignableFrom(HwbColor.class)) { - return (T) hwbColor; - } else { - throw new IllegalArgumentException("Cant convert sass HwbColor to " + targetType); - } case LIST: Value.List sassList = value.getList(); if (targetType.isAssignableFrom(Value.List.class)) { diff --git a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/functions/SassColor.java b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/functions/SassColor.java index c3c6c847..a4a0580e 100644 --- a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/functions/SassColor.java +++ b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/functions/SassColor.java @@ -27,51 +27,14 @@ public class SassColor { * * @see adjust-hue */ - public static RgbColor adjustHue(RgbColorOrBuilder color, double hue) { - HslColor hslColor = ColorUtil.toHslColor(color); - return toRgbColor(adjustHue(hslColor, hue)); - } - - /** - * Increases or decreases color‘s hue. - *

- * The hue must be a number between -360deg and 360deg (inclusive) to add to $color’s hue. - * - * @see adjust-hue - */ - public static HslColor adjustHue(HslColor color, double hue) { - double newHue = color.getHue() + hue; - return color.toBuilder().setHue(normalizeHue(newHue)).build(); - } - - /** - * Increases or decreases color‘s hue. - *

- * The hue must be a number between -360deg and 360deg (inclusive) to add to $color’s hue. - * - * @see adjust-hue - */ - public static HwbColor adjustHue(HwbColor color, double hue) { - double newHue = color.getHue() + hue; - return color.toBuilder().setHue(normalizeHue(newHue)).build(); - } + public static Color adjustHue(Color color, double hue) { - /** - * Returns the alpha channel of $color as a number between 0 and 1. - * - * @see alpha - */ - public static double alpha(RgbColorOrBuilder color) { - return color.getAlpha(); - } + if ("hsl".equals(color.getSpace()) || "hwb".equals(color.getSpace())) { + double newHue = color.getChannel1() + hue; + return color.toBuilder().setChannel1(normalizeHue(newHue)).build(); + } - /** - * Returns the alpha channel of $color as a number between 0 and 1. - * - * @see alpha - */ - public static double alpha(HslColorOrBuilder color) { - return color.getAlpha(); + return adjustHue(toHslColor(color), hue); } /** @@ -79,7 +42,7 @@ public static double alpha(HslColorOrBuilder color) { * * @see alpha */ - public static double alpha(HwbColorOrBuilder color) { + public static double alpha(ColorOrBuilder color) { return color.getAlpha(); } @@ -88,35 +51,8 @@ public static double alpha(HwbColorOrBuilder color) { * * @see blackness */ - public static double blackness(RgbColorOrBuilder color) { - return blackness(toHwbColor(color)); - } - - /** - * Returns the HWB blackness of $color as a number between 0% and 100%. - * - * @see blackness - */ - public static double blackness(HslColorOrBuilder color) { - return blackness(toHwbColor(color)); - } - - /** - * Returns the HWB blackness of $color as a number between 0% and 100%. - * - * @see blackness - */ - public static double blackness(HwbColorOrBuilder color) { - return color.getBlackness(); - } - - /** - * Returns the blue channel of $color as a number between 0 and 255. - * - * @see blue - */ - public static int blue(RgbColorOrBuilder color) { - return color.getBlue(); + public static double blackness(Color color) { + return toHwbColor(color).getChannel3(); } /** @@ -124,28 +60,8 @@ public static int blue(RgbColorOrBuilder color) { * * @see blue */ - public static int blue(HslColorOrBuilder color) { - return blue(toRgbColor(color)); - } - - /** - * Returns the blue channel of $color as a number between 0 and 255. - * - * @see blue - */ - public static int blue(HwbColorOrBuilder color) { - return blue(toRgbColor(color)); - } - - /** - * Returns the RGB complement of $color. - *

- * This is identical to color.adjust($color, $hue: 180deg). - * - * @see complement - */ - public static RgbColor complement(RgbColorOrBuilder color) { - return adjustHue(color, 180); + public static int blue(Color color) { + return (int) toRgbColor(color).getChannel3(); } /** @@ -155,18 +71,7 @@ public static RgbColor complement(RgbColorOrBuilder color) { * * @see complement */ - public static HslColor complement(HslColor color) { - return adjustHue(color, 180); - } - - /** - * Returns the RGB complement of $color. - *

- * This is identical to color.adjust($color, $hue: 180deg). - * - * @see complement - */ - public static HwbColor complement(HwbColor color) { + public static Color complement(Color color) { return adjustHue(color, 180); } @@ -178,37 +83,15 @@ public static HwbColor complement(HwbColor color) { * * @see darken */ - public static RgbColor darken(RgbColorOrBuilder color, double amount) { - return toRgbColor(darken(toHslColor(color), amount)); - } + public static Color darken(Color color, double amount) { + color = toHslColor(color); - /** - * Makes $color darker. - *

- * The $amount must be a number between 0% and 100% (inclusive). - * Decreases the HSL lightness of $color by that amount. - * - * @see darken - */ - public static HslColor darken(HslColor color, double amount) { - double newLightness = color.getLightness() - amount; + double newLightness = color.getChannel3() - amount; return color.toBuilder() - .setLightness(normalize100(newLightness)) + .setChannel3(normalize100(newLightness)) .build(); } - /** - * Makes $color darker. - *

- * The $amount must be a number between 0% and 100% (inclusive). - * Decreases the HSL lightness of $color by that amount. - * - * @see darken - */ - public static HwbColor darken(HwbColorOrBuilder color, double amount) { - return toHwbColor(darken(toHslColor(color), amount)); - } - /** * Makes $color less saturated. *

@@ -217,48 +100,15 @@ public static HwbColor darken(HwbColorOrBuilder color, double amount) { * * @see desaturate */ - public static RgbColor desaturate(RgbColorOrBuilder color, double amount) { - return toRgbColor(desaturate(toHslColor(color), amount)); - } + public static Color desaturate(Color color, double amount) { + color = toHslColor(color); - /** - * Makes $color less saturated. - *

- * The $amount must be a number between 0% and 100% (inclusive). - * Decreases the HSL saturation of $color by that amount. - * - * @see desaturate - */ - public static HslColor desaturate(HslColor color, double amount) { - double newSaturation = color.getSaturation() - amount; + double newSaturation = color.getChannel2() - amount; return color.toBuilder() - .setSaturation(normalize100(newSaturation)) + .setChannel2(normalize100(newSaturation)) .build(); } - /** - * Makes $color less saturated. - *

- * The $amount must be a number between 0% and 100% (inclusive). - * Decreases the HSL saturation of $color by that amount. - * - * @see desaturate - */ - public static HwbColor desaturate(HwbColorOrBuilder color, double amount) { - return toHwbColor(desaturate(toHslColor(color), amount)); - } - - /** - * Returns a gray color with the same lightness as $color. - *

- * This is identical to color.change($color, $saturation: 0%). - * - * @see grayscale - */ - public static RgbColor grayscale(RgbColorOrBuilder color) { - return toRgbColor(grayscale(toHslColor(color))); - } - /** * Returns a gray color with the same lightness as $color. *

@@ -266,19 +116,9 @@ public static RgbColor grayscale(RgbColorOrBuilder color) { * * @see grayscale */ - public static HslColor grayscale(HslColor color) { - return color.toBuilder().setSaturation(0d).build(); - } - - /** - * Returns a gray color with the same lightness as $color. - *

- * This is identical to color.change($color, $saturation: 0%). - * - * @see grayscale - */ - public static HwbColor grayscale(HwbColorOrBuilder color) { - return toHwbColor(grayscale(toHslColor(color))); + public static Color grayscale(Color color) { + color = toHslColor(color); + return color.toBuilder().setChannel2(0d).build(); } /** @@ -286,35 +126,8 @@ public static HwbColor grayscale(HwbColorOrBuilder color) { * * @see green */ - public static int green(RgbColorOrBuilder color) { - return color.getGreen(); - } - - /** - * Returns the green channel of $color as a number between 0 and 255. - * - * @see green - */ - public static int green(HslColorOrBuilder color) { - return green(toRgbColor(color)); - } - - /** - * Returns the green channel of $color as a number between 0 and 255. - * - * @see green - */ - public static int green(HwbColorOrBuilder color) { - return green(toRgbColor(color)); - } - - /** - * Returns the hue of $color as a number between 0deg and 360deg. - * - * @see hue - */ - public double hue(RgbColorOrBuilder color) { - return hue(toHslColor(color)); + public static int green(Color color) { + return (int) toRgbColor(color).getChannel2(); } /** @@ -322,17 +135,11 @@ public double hue(RgbColorOrBuilder color) { * * @see hue */ - public double hue(HslColorOrBuilder color) { - return color.getHue(); - } - - /** - * Returns the hue of $color as a number between 0deg and 360deg. - * - * @see hue - */ - public double hue(HwbColorOrBuilder color) { - return color.getHue(); + public double hue(Color color) { + if (color.getSpace().equals("hsl") || color.getSpace().equals("hwb")) { + return color.getChannel1(); + } + return toHslColor(color).getChannel1(); } /** @@ -340,7 +147,7 @@ public double hue(HwbColorOrBuilder color) { * * @see hwb */ - public HwbColor hwb(double hue, double whiteness, double blackness) { + public Color hwb(double hue, double whiteness, double blackness) { return hwb(hue, whiteness, blackness, 1d); } @@ -349,11 +156,12 @@ public HwbColor hwb(double hue, double whiteness, double blackness) { * * @see hwb */ - public HwbColor hwb(double hue, double whiteness, double blackness, double alpha) { - return HwbColor.newBuilder() - .setHue(hue) - .setWhiteness(whiteness) - .setBlackness(blackness) + public Color hwb(double hue, double whiteness, double blackness, double alpha) { + return Color.newBuilder() + .setSpace("hwb") + .setChannel1(hue) + .setChannel2(whiteness) + .setChannel3(blackness) .setAlpha(alpha) .build(); } @@ -363,13 +171,20 @@ public HwbColor hwb(double hue, double whiteness, double blackness, double alpha * * @see ie-hex-str */ - public String ieHexStr(RgbColor rgbColor) { + public String ieHexStr(Color color) { + + Color rgbColor = toRgbColor(color); + int a = (int) Math.round(rgbColor.getAlpha() * 255d); + int red = (int) rgbColor.getChannel1(); + int green = (int) rgbColor.getChannel2(); + int blue = (int) rgbColor.getChannel3(); + int value = ((a & 0xFF) << 24) | - ((rgbColor.getRed() & 0xFF) << 16) | - ((rgbColor.getGreen() & 0xFF) << 8) | - ((rgbColor.getBlue() & 0xFF) << 0); + ((red & 0xFF) << 16) | + ((green & 0xFF) << 8) | + ((blue & 0xFF) << 0); return String.newBuilder() .setText("#" + Integer.toHexString(value).toUpperCase(Locale.ROOT)) @@ -377,48 +192,12 @@ public String ieHexStr(RgbColor rgbColor) { .build(); } - /** - * Returns an unquoted string that represents $color in the #AARRGGBB format expected by Internet Explorer’s -ms-filter property. - * - * @see ie-hex-str - */ - public String ieHexStr(HslColor color) { - return ieHexStr(toRgbColor(color)); - } - - /** - * Returns an unquoted string that represents $color in the #AARRGGBB format expected by Internet Explorer’s -ms-filter property. - * - * @see ie-hex-str - */ - public String ieHexStr(HwbColor color) { - return ieHexStr(toRgbColor(color)); - } - /** * Returns the inverse or negative of $color. * * @see invert */ - public RgbColor invert(RgbColor color) { - return invert(color, 1); - } - - /** - * Returns the inverse or negative of $color. - * - * @see invert - */ - public HslColor invert(HslColor color) { - return invert(color, 1); - } - - /** - * Returns the inverse or negative of $color. - * - * @see invert - */ - public HwbColor invert(HwbColor color) { + public Color invert(Color color) { return invert(color, 1); } @@ -431,46 +210,22 @@ public HwbColor invert(HwbColor color) { * * @see invert */ - public RgbColor invert(RgbColor color, double weight) { + public Color invert(Color color, double weight) { if (weight < 0 || weight > 1) { throw new IllegalArgumentException("weight must be between 0 and 1"); } - RgbColor inverse = color.toBuilder() - .setRed(255 - color.getRed()) - .setGreen(255 - color.getGreen()) - .setBlue(255 - color.getBlue()) + color = toRgbColor(color); + + Color inverse = color.toBuilder() + .setChannel1(255 - color.getChannel1()) + .setChannel2(255 - color.getChannel2()) + .setChannel3(255 - color.getChannel3()) .build(); return mix(inverse, color, weight); } - /** - * Returns the inverse or negative of $color. - *

- * The $weight must be a number between 0% and 100% (inclusive). - * A higher weight means the result will be closer to the negative, and a lower weight means it will be closer to $color. - * Weight 50% will always produce #808080. - * - * @see invert - */ - public HslColor invert(HslColor color, double weight) { - return toHslColor(invert(toRgbColor(color), weight)); - } - - /** - * Returns the inverse or negative of $color. - *

- * The $weight must be a number between 0% and 100% (inclusive). - * A higher weight means the result will be closer to the negative, and a lower weight means it will be closer to $color. - * Weight 50% will always produce #808080. - * - * @see invert - */ - public HwbColor invert(HwbColor color, double weight) { - return toHwbColor(invert(toRgbColor(color), weight)); - } - /** * Makes $color lighter. *

@@ -478,51 +233,14 @@ public HwbColor invert(HwbColor color, double weight) { * * @see lighten */ - public RgbColor lighten(RgbColor color, double amount) { - return toRgbColor(lighten(toHslColor(color), amount)); - } - - /** - * Makes $color lighter. - *

- * The $amount must be a number between 0% and 100% (inclusive). Increases the HSL lightness of $color by that amount. - * - * @see lighten - */ - public HslColor lighten(HslColor color, double amount) { + public Color lighten(Color color, double amount) { if (amount < 0 || amount > 100) throw new IllegalArgumentException("amount"); - return color.toBuilder() - .setLightness(normalize100(color.getLightness() + amount)) - .build(); - } - /** - * Makes $color lighter. - *

- * The $amount must be a number between 0% and 100% (inclusive). Increases the HSL lightness of $color by that amount. - * - * @see lighten - */ - public HwbColor lighten(HwbColor color, double amount) { - return toHwbColor(lighten(toHslColor(color), amount)); - } + color = toHslColor(color); - /** - * Returns the HSL lightness of $color as a number between 0% and 100%. - * - * @see lightness - */ - public double lightness(RgbColor color) { - return lightness(toHslColor(color)); - } - - /** - * Returns the HSL lightness of $color as a number between 0% and 100%. - * - * @see lightness - */ - public double lightness(HslColor color) { - return color.getLightness(); + return color.toBuilder() + .setChannel3(normalize100(color.getChannel3() + amount)) + .build(); } /** @@ -530,26 +248,8 @@ public double lightness(HslColor color) { * * @see lightness */ - public double lightness(HwbColor color) { - return lightness(toHslColor(color)); - } - - /** - * Returns a color that’s a mixture of $color1 and $color2. - * - * @see mix - */ - public RgbColor mix(RgbColor color1, RgbColor color2) { - return mix(color1, color2, 0.5); - } - - /** - * Returns a color that’s a mixture of $color1 and $color2. - * - * @see mix - */ - public HslColor mix(HslColor color1, HslColor color2) { - return mix(color1, color2, 0.5); + public double lightness(Color color) { + return toHslColor(color).getChannel3(); } /** @@ -557,7 +257,7 @@ public HslColor mix(HslColor color1, HslColor color2) { * * @see mix */ - public HwbColor mix(HwbColor color1, HwbColor color2) { + public Color mix(Color color1, Color color2) { return mix(color1, color2, 0.5); } @@ -570,7 +270,7 @@ public HwbColor mix(HwbColor color1, HwbColor color2) { * * @see mix */ - public RgbColor mix(RgbColor color1, RgbColor color2, double weight) { + public Color mix(Color color1, Color color2, double weight) { if (weight <= 0) { return color2; } else if (weight > 1) { @@ -587,55 +287,20 @@ public RgbColor mix(RgbColor color1, RgbColor color2, double weight) { double weight1 = (combinedWeight1 + 1) / 2; double weight2 = 1 - weight1; - int r = (int) Math.round(color1.getRed() * weight1 + color2.getRed() * weight2); - int g = (int) Math.round(color1.getGreen() * weight1 + color2.getGreen() * weight2); - int b = (int) Math.round(color1.getBlue() * weight1 + color2.getBlue() * weight2); + int r = (int) Math.round(red(color1) * weight1 + red(color2) * weight2); + int g = (int) Math.round(green(color1) * weight1 + green(color2) * weight2); + int b = (int) Math.round(blue(color1) * weight1 + blue(color2) * weight2); double a = color1.getAlpha() * weight + color2.getAlpha() * (1 - weight); - return RgbColor.newBuilder() - .setRed(r) - .setGreen(g) - .setBlue(b) + return Color.newBuilder() + .setSpace("rgb") + .setChannel1(r) + .setChannel2(g) + .setChannel3(b) .setAlpha(a) .build(); } - /** - * Returns a color that’s a mixture of $color1 and $color2. - *

- * Both the $weight and the relative opacity of each color determines how much of each color is in the result. - * The $weight must be a number between 0% and 100% (inclusive). - * A larger weight indicates that more of $color1 should be used, and a smaller weight indicates that more of $color2 should be used. - * - * @see mix - */ - public HslColor mix(HslColor color1, HslColor color2, double weight) { - RgbColor mix = mix( - toRgbColor(color1), - toRgbColor(color2), - weight - ); - return toHslColor(mix); - } - - /** - * Returns a color that’s a mixture of $color1 and $color2. - *

- * Both the $weight and the relative opacity of each color determines how much of each color is in the result. - * The $weight must be a number between 0% and 100% (inclusive). - * A larger weight indicates that more of $color1 should be used, and a smaller weight indicates that more of $color2 should be used. - * - * @see mix - */ - public HwbColor mix(HwbColor color1, HwbColor color2, double weight) { - RgbColor mix = mix( - toRgbColor(color1), - toRgbColor(color2), - weight - ); - return toHwbColor(mix); - } - /** * Makes $color more opaque. *

@@ -643,35 +308,7 @@ public HwbColor mix(HwbColor color1, HwbColor color2, double weight) { * * @see opacify */ - public RgbColor opacify(RgbColor color, double amount) { - if (amount < 0 || amount > 1) throw new IllegalArgumentException("amount"); - return color.toBuilder() - .setAlpha(normalize1(color.getAlpha() + amount)) - .build(); - } - - /** - * Makes $color more opaque. - *

- * The $amount must be a number between 0 and 1 (inclusive). Increases the alpha channel of $color by that amount. - * - * @see opacify - */ - public HslColor opacify(HslColor color, double amount) { - if (amount < 0 || amount > 1) throw new IllegalArgumentException("amount"); - return color.toBuilder() - .setAlpha(normalize1(color.getAlpha() + amount)) - .build(); - } - - /** - * Makes $color more opaque. - *

- * The $amount must be a number between 0 and 1 (inclusive). Increases the alpha channel of $color by that amount. - * - * @see opacify - */ - public HwbColor opacify(HwbColor color, double amount) { + public Color opacify(Color color, double amount) { if (amount < 0 || amount > 1) throw new IllegalArgumentException("amount"); return color.toBuilder() .setAlpha(normalize1(color.getAlpha() + amount)) @@ -683,26 +320,8 @@ public HwbColor opacify(HwbColor color, double amount) { * * @see red */ - public int red(RgbColor color) { - return color.getRed(); - } - - /** - * Returns the red channel of $color as a number between 0 and 255. - * - * @see red - */ - public int red(HslColor color) { - return red(toRgbColor(color)); - } - - /** - * Returns the red channel of $color as a number between 0 and 255. - * - * @see red - */ - public int red(HwbColor color) { - return red(toRgbColor(color)); + public int red(Color color) { + return (int) toRgbColor(color).getChannel1(); } /** @@ -712,88 +331,23 @@ public int red(HwbColor color) { * * @see saturate */ - public RgbColor saturate(RgbColor color, double amount) { - return toRgbColor(saturate(toHslColor(color), amount)); - } + public Color saturate(Color color, double amount) { + + color = toHslColor(color); - /** - * Makes $color more saturated. - *

- * The $amount must be a number between 0% and 100% (inclusive). Increases the HSL saturation of $color by that amount. - * - * @see saturate - */ - public HslColor saturate(HslColor color, double amount) { if (amount < 0 || amount > 100) throw new IllegalArgumentException("amount"); return color.toBuilder() - .setSaturation(normalize100(color.getSaturation() + amount)) + .setChannel2(normalize100(color.getChannel2() + amount)) .build(); } - /** - * Makes $color more saturated. - *

- * The $amount must be a number between 0% and 100% (inclusive). Increases the HSL saturation of $color by that amount. - * - * @see saturate - */ - public HwbColor saturate(HwbColor color, double amount) { - return toHwbColor(saturate(toHslColor(color), amount)); - } - /** * Returns the HSL saturation of $color as a number between 0% and 100%. * * @see saturation */ - public double saturation(RgbColor color) { - return saturation(toHslColor(color)); - } - - /** - * Returns the HSL saturation of $color as a number between 0% and 100%. - * - * @see saturation - */ - public double saturation(HslColor color) { - return color.getSaturation(); - } - - /** - * Returns the HSL saturation of $color as a number between 0% and 100%. - * - * @see saturation - */ - public double saturation(HwbColor color) { - return saturation(toHslColor(color)); - } - - /** - * Makes $color more transparent. - *

- * The $amount must be a number between 0 and 1 (inclusive). Decreases the alpha channel of $color by that amount. - * - * @see transparentize - */ - public RgbColor transparentize(RgbColor color, double amount) { - if (amount < 0 || amount > 1) throw new IllegalArgumentException("amount"); - return color.toBuilder() - .setAlpha(normalize1(color.getAlpha() - amount)) - .build(); - } - - /** - * Makes $color more transparent. - *

- * The $amount must be a number between 0 and 1 (inclusive). Decreases the alpha channel of $color by that amount. - * - * @see transparentize - */ - public HslColor transparentize(HslColor color, double amount) { - if (amount < 0 || amount > 1) throw new IllegalArgumentException("amount"); - return color.toBuilder() - .setAlpha(normalize1(color.getAlpha() - amount)) - .build(); + public double saturation(Color color) { + return toHslColor(color).getChannel2(); } /** @@ -803,39 +357,20 @@ public HslColor transparentize(HslColor color, double amount) { * * @see transparentize */ - public HwbColor transparentize(HwbColor color, double amount) { + public Color transparentize(Color color, double amount) { if (amount < 0 || amount > 1) throw new IllegalArgumentException("amount"); return color.toBuilder() .setAlpha(normalize1(color.getAlpha() - amount)) .build(); } - - /** - * Returns the HWB whiteness of $color as a number between 0% and 100%. - * - * @see whiteness - */ - public double whiteness(RgbColor color) { - return whiteness(toHwbColor(color)); - } - - /** - * Returns the HWB whiteness of $color as a number between 0% and 100%. - * - * @see whiteness - */ - public double whiteness(HslColor color) { - return whiteness(toHwbColor(color)); - } - /** * Returns the HWB whiteness of $color as a number between 0% and 100%. * * @see whiteness */ - public double whiteness(HwbColor color) { - return color.getWhiteness(); + public double whiteness(Color color) { + return toHwbColor(color).getChannel2(); } static double normalizeHue(double hue) { diff --git a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/ColorUtil.java b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/ColorUtil.java index ceebcf32..142a3899 100644 --- a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/ColorUtil.java +++ b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/ColorUtil.java @@ -15,85 +15,126 @@ @Nonnull public class ColorUtil { - public static final RgbColor white = rgba(255, 255, 255, 1); - public static final RgbColor black = rgba(0, 0, 0, 1); + public static final Color white = rgba(255, 255, 255, 1); + public static final Color black = rgba(0, 0, 0, 1); - public static RgbColor toRgbColor(HwbColorOrBuilder hwbColor) { + public static Color toRgbColor(Color color) { + if ("rgb".equals(color.getSpace())) { + return color; + } + + if ("hwb".equals(color.getSpace())) { + return toRgbColorFromHwb(color); + } + + if ("hsl".equals(color.getSpace())) { + return toRgbColorFromHsl(color); + } + + throw new IllegalArgumentException("Unsupported color space: " + color.getSpace()); + } + + public static Color toRgbColorFromHwb(ColorOrBuilder hwbColor) { + if (!"hwb".equals(hwbColor.getSpace())) { + throw new IllegalArgumentException("HWB color should be hwb"); + } assertValid(hwbColor); - double[] rgb = CssColorSpecUtil.hwbToRgb(hwbColor.getHue(), hwbColor.getWhiteness(), hwbColor.getBlackness()); + double[] rgb = CssColorSpecUtil.hwbToRgb(hwbColor.getChannel1(), hwbColor.getChannel2(), hwbColor.getChannel3()); - return RgbColor.newBuilder() - .setRed((int) Math.round(rgb[0] * 255d)) - .setGreen((int) Math.round(rgb[1] * 255d)) - .setBlue((int) Math.round(rgb[2] * 255d)) + return Color.newBuilder() + .setSpace("rgb") + .setChannel1((int) Math.round(rgb[0] * 255d)) + .setChannel2((int) Math.round(rgb[1] * 255d)) + .setChannel3((int) Math.round(rgb[2] * 255d)) .setAlpha(hwbColor.getAlpha()) .build(); } - public static RgbColor toRgbColor(HslColorOrBuilder hslColor) { + public static Color toRgbColorFromHsl(ColorOrBuilder hslColor) { + if (!"hsl".equals(hslColor.getSpace())) { + throw new IllegalArgumentException("HSL color should be hsl"); + } + assertValid(hslColor); - double[] rgb = CssColorSpecUtil.hslToRgb((int) hslColor.getHue(), hslColor.getSaturation(), hslColor.getLightness()); + double[] rgb = CssColorSpecUtil.hslToRgb((int) hslColor.getChannel1(), hslColor.getChannel2(), hslColor.getChannel3()); - return RgbColor.newBuilder() - .setRed((int) Math.round(rgb[0] * 255d)) - .setGreen((int) Math.round(rgb[1] * 255d)) - .setBlue((int) Math.round(rgb[2] * 255d)) + return Color.newBuilder() + .setSpace("rgb") + .setChannel1((int) Math.round(rgb[0] * 255d)) + .setChannel2((int) Math.round(rgb[1] * 255d)) + .setChannel3((int) Math.round(rgb[2] * 255d)) .setAlpha(hslColor.getAlpha()) .build(); } - public static HslColor toHslColor(HwbColorOrBuilder hwbColor) { - assertValid(hwbColor); - return toHslColor(toRgbColor(hwbColor)); - } + public static Color toHslColor(Color color) { + if ("hsl".equals(color.getSpace())) { + return color; + } + + if ("hwb".equals(color.getSpace())) { + color = toRgbColor(color); + } - public static HslColor toHslColor(RgbColorOrBuilder rgbColor) { - assertValid(rgbColor); + if (!"rgb".equals(color.getSpace())) { + throw new IllegalArgumentException("color space is not supported: " + color.getSpace()); + } - double red = rgbColor.getRed() / 255d; - double green = rgbColor.getGreen() / 255d; - double blue = rgbColor.getBlue() / 255d; + assertValid(color); + + double red = color.getChannel1() / 255d; + double green = color.getChannel2() / 255d; + double blue = color.getChannel3() / 255d; double[] hsl = CssColorSpecUtil.rgbToHsl(red, green, blue); - return HslColor.newBuilder() - .setHue(hsl[0]) - .setSaturation(hsl[1]) - .setLightness(hsl[2]) - .setAlpha(rgbColor.getAlpha()) + return Color.newBuilder() + .setSpace("hsl") + .setChannel1(hsl[0]) + .setChannel2(hsl[1]) + .setChannel3(hsl[2]) + .setAlpha(color.getAlpha()) .build(); } - public static HwbColor toHwbColor(HslColorOrBuilder hslColor) { - assertValid(hslColor); - return toHwbColor(toRgbColor(hslColor)); - } + public static Color toHwbColor(Color color) { + if ("hwb".equals(color.getSpace())) { + return color; + } + + if ("hsl".equals(color.getSpace())) { + color = toRgbColorFromHsl(color); + } + + if (!"rgb".equals(color.getSpace())) { + throw new IllegalArgumentException("color space is not supported: " + color.getSpace()); + } - public static HwbColor toHwbColor(RgbColorOrBuilder rgbColor) { - assertValid(rgbColor); + assertValid(color); - double red = rgbColor.getRed() / 255d; - double green = rgbColor.getGreen() / 255d; - double blue = rgbColor.getBlue() / 255d; + double red = color.getChannel1() / 255d; + double green = color.getChannel2() / 255d; + double blue = color.getChannel3() / 255d; double[] hwb = CssColorSpecUtil.rgbToHwb(red, green, blue); - return HwbColor.newBuilder() - .setHue(hwb[0]) - .setWhiteness(hwb[1]) - .setBlackness(hwb[2]) - .setAlpha(rgbColor.getAlpha()) + return Color.newBuilder() + .setSpace("hwb") + .setChannel1(hwb[0]) + .setChannel2(hwb[1]) + .setChannel3(hwb[2]) + .setAlpha(color.getAlpha()) .build(); } - public RgbColor rgb(int rgb) { + public Color rgb(int rgb) { return rgba(rgb, 1); } @SuppressWarnings("PointlessBitwiseExpression") - public RgbColor rgba(int rgb, double alpha) { + public Color rgba(int rgb, double alpha) { int r = (rgb >> 16) & 0xFF; int g = (rgb >> 8) & 0xFF; int b = (rgb >> 0) & 0xFF; @@ -101,11 +142,12 @@ public RgbColor rgba(int rgb, double alpha) { return rgba(r, g, b, alpha); } - public RgbColor rgba(int red, int green, int blue, double alpha) { - return RgbColor.newBuilder() - .setRed(red) - .setGreen(green) - .setBlue(blue) + public Color rgba(int red, int green, int blue, double alpha) { + return Color.newBuilder() + .setSpace("rgb") + .setChannel1(red) + .setChannel2(green) + .setChannel3(blue) .setAlpha(alpha) .build(); } diff --git a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/ColorValidator.java b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/ColorValidator.java index 5235e40b..5a89fedc 100644 --- a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/ColorValidator.java +++ b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/ColorValidator.java @@ -1,9 +1,8 @@ package de.larsgrefer.sass.embedded.util; -import com.sass_lang.embedded_protocol.Value.HslColorOrBuilder; -import com.sass_lang.embedded_protocol.Value.HwbColorOrBuilder; -import com.sass_lang.embedded_protocol.Value.RgbColorOrBuilder; +import com.sass_lang.embedded_protocol.Value; +import com.sass_lang.embedded_protocol.Value.ColorOrBuilder; import lombok.NonNull; import lombok.experimental.UtilityClass; @@ -14,18 +13,30 @@ @UtilityClass class ColorValidator { - static void assertValid(@NonNull RgbColorOrBuilder rgbColor) { - int red = rgbColor.getRed(); + static void assertValid(@NonNull ColorOrBuilder color) { + if ("rgb".equals(color.getSpace())) { + assertValidRgb(color); + } else if ("hsl".equals(color.getSpace())) { + assertValidHsl(color); + } else if ("hwb".equals(color.getSpace())) { + assertValidHwb(color); + } else { + throw new IllegalArgumentException("Unsupported color space: " + color.getSpace()); + } + } + + static void assertValidRgb(@NonNull ColorOrBuilder rgbColor) { + int red = (int) rgbColor.getChannel1(); if (red < 0 || red > 255) { throw new IllegalArgumentException("Red must be between 0 and 255."); } - int green = rgbColor.getGreen(); + int green = (int) rgbColor.getChannel2(); if (green < 0 || green > 255) { throw new IllegalArgumentException("Green must be between 0 and 255."); } - int blue = rgbColor.getBlue(); + int blue = (int) rgbColor.getChannel3(); if (blue < 0 || blue > 255) { throw new IllegalArgumentException("Blue must be between 0 and 255."); } @@ -36,13 +47,13 @@ static void assertValid(@NonNull RgbColorOrBuilder rgbColor) { } } - static void assertValid(@NonNull HslColorOrBuilder hslColor) { - double saturation = hslColor.getSaturation(); + static void assertValidHsl(@NonNull ColorOrBuilder hslColor) { + double saturation = hslColor.getChannel2(); if (saturation < 0 || saturation > 100) { throw new IllegalArgumentException("Saturation must be between 0 and 100."); } - double lightness = hslColor.getLightness(); + double lightness = hslColor.getChannel3(); if (lightness < 0 || lightness > 100) { throw new IllegalArgumentException("Lightness must be between 0 and 100."); } @@ -53,13 +64,13 @@ static void assertValid(@NonNull HslColorOrBuilder hslColor) { } } - static void assertValid(@NonNull HwbColorOrBuilder hwbColor) { - double whiteness = hwbColor.getWhiteness(); + static void assertValidHwb(@NonNull ColorOrBuilder hwbColor) { + double whiteness = hwbColor.getChannel2(); if (whiteness < 0 || whiteness > 100) { throw new IllegalArgumentException("Whiteness must be between 0 and 100."); } - double blackness = hwbColor.getBlackness(); + double blackness = hwbColor.getChannel3(); if (blackness < 0 || blackness > 100) { throw new IllegalArgumentException("Whiteness must be between 0 and 100."); } diff --git a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/ProtocolUtil.java b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/ProtocolUtil.java index f07290a5..95fd5360 100644 --- a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/ProtocolUtil.java +++ b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/ProtocolUtil.java @@ -62,15 +62,9 @@ public static Value value(Value.Number number) { .build(); } - public static Value value(Value.RgbColor rgbColor) { + public static Value value(Value.Color rgbColor) { return Value.newBuilder() - .setRgbColor(rgbColor) - .build(); - } - - public static Value value(Value.HslColor hslColor) { - return Value.newBuilder() - .setHslColor(hslColor) + .setColor(rgbColor) .build(); } @@ -110,12 +104,6 @@ public static Value value(Value.ArgumentList argumentList) { .build(); } - public static Value value(Value.HwbColor hwbColor) { - return Value.newBuilder() - .setHwbColor(hwbColor) - .build(); - } - public static Value value(Value.Calculation calculation) { return Value.newBuilder() .setCalculation(calculation) diff --git a/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/SassCompilerTest.java b/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/SassCompilerTest.java index a1b9bd26..ec5385fa 100644 --- a/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/SassCompilerTest.java +++ b/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/SassCompilerTest.java @@ -99,9 +99,10 @@ void customFunction() throws Exception { @Override public @NotNull Value invoke(List arguments) { return Value.newBuilder() - .setRgbColor(Value.RgbColor.newBuilder() - .setRed(255) - .setBlue(25) + .setColor(Value.Color.newBuilder() + .setSpace("rgb") + .setChannel1(255) + .setChannel3(25) .setAlpha(1d) .build()) .build(); diff --git a/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/connection/ConnectionFactoryTest.java b/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/connection/ConnectionFactoryTest.java index 34a741c7..799742b0 100644 --- a/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/connection/ConnectionFactoryTest.java +++ b/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/connection/ConnectionFactoryTest.java @@ -14,7 +14,7 @@ class ConnectionFactoryTest { void getExpectedProtocolVersion() { String expectedProtocolVersion = ConnectionFactory.getExpectedProtocolVersion(); - assertThat(expectedProtocolVersion).startsWith("2."); + assertThat(expectedProtocolVersion).startsWith("3."); } @Test diff --git a/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/functions/ConversionServiceTest.java b/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/functions/ConversionServiceTest.java index fed06146..3c4443c5 100644 --- a/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/functions/ConversionServiceTest.java +++ b/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/functions/ConversionServiceTest.java @@ -182,8 +182,7 @@ void mapConverstion() { void sassValueConversion() { assertThat(toSassValue(Value.String.getDefaultInstance()).getValueCase()).isEqualTo(ValueCase.STRING); assertThat(toSassValue(Value.Number.getDefaultInstance()).getValueCase()).isEqualTo(ValueCase.NUMBER); - assertThat(toSassValue(Value.RgbColor.getDefaultInstance()).getValueCase()).isEqualTo(ValueCase.RGB_COLOR); - assertThat(toSassValue(Value.HslColor.getDefaultInstance()).getValueCase()).isEqualTo(ValueCase.HSL_COLOR); + assertThat(toSassValue(Value.Color.getDefaultInstance()).getValueCase()).isEqualTo(ValueCase.COLOR); assertThat(toSassValue(Value.List.getDefaultInstance()).getValueCase()).isEqualTo(ValueCase.LIST); assertThat(toSassValue(Value.Map.getDefaultInstance()).getValueCase()).isEqualTo(ValueCase.MAP); assertThat(toSassValue(SingletonValue.NULL).getValueCase()).isEqualTo(ValueCase.SINGLETON); @@ -194,8 +193,7 @@ Stream sassValueConversion2() { return Stream.of( Value.String.getDefaultInstance(), Value.Number.getDefaultInstance(), - Value.RgbColor.getDefaultInstance(), - Value.HslColor.getDefaultInstance(), + Value.Color.getDefaultInstance(), Value.List.getDefaultInstance(), Value.Map.getDefaultInstance(), SingletonValue.NULL diff --git a/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/functions/SassColorTest.java b/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/functions/SassColorTest.java index 665f9dd1..ae4caacf 100644 --- a/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/functions/SassColorTest.java +++ b/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/functions/SassColorTest.java @@ -1,12 +1,11 @@ package de.larsgrefer.sass.embedded.functions; +import com.sass_lang.embedded_protocol.Value.Color; import org.assertj.core.data.Offset; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; -import com.sass_lang.embedded_protocol.Value.HwbColor; -import com.sass_lang.embedded_protocol.Value.RgbColor; import static de.larsgrefer.sass.embedded.util.ColorUtil.*; import static org.assertj.core.api.Assertions.assertThat; @@ -20,15 +19,15 @@ class SassColorTest { void adjustHue() { // Hue 222deg becomes 282deg. //@debug adjust-hue(#6b717f, 60deg); // #796b7f - assertThat(SassColor.adjustHue(rgb(0x6b717f), 60)).isEqualTo(rgb(0x796b7f)); + assertThat(toRgbColor(SassColor.adjustHue(rgb(0x6b717f), 60))).isEqualTo(rgb(0x796b7f)); // Hue 164deg becomes 104deg. //@debug adjust-hue(#d2e1dd, -60deg); // #d6e1d2 - assertThat(SassColor.adjustHue(rgb(0xd2e1dd), -60)).isEqualTo(rgb(0xd6e1d2)); + assertThat(toRgbColor(SassColor.adjustHue(rgb(0xd2e1dd), -60))).isEqualTo(rgb(0xd6e1d2)); // Hue 210deg becomes 255deg. //@debug adjust-hue(#036, 45); // #1a0066 - assertThat(SassColor.adjustHue(rgb(0x003366), 45)).isEqualTo(rgb(0x1a0066)); + assertThat(toRgbColor(SassColor.adjustHue(rgb(0x003366), 45))).isEqualTo(rgb(0x1a0066)); } @Test @@ -47,15 +46,15 @@ void blackness() { void complement() { // Hue 222deg becomes 42deg. //@debug color.complement(#6b717f); // #7f796b - assertThat(SassColor.complement(rgb(0x6b717f))).isEqualTo(rgb(0x7f796b)); + assertThat(toRgbColor(SassColor.complement(rgb(0x6b717f)))).isEqualTo(rgb(0x7f796b)); // Hue 164deg becomes 344deg. //@debug color.complement(#d2e1dd); // #e1d2d6 - assertThat(SassColor.complement(rgb(0xd2e1dd))).isEqualTo(rgb(0xe1d2d6)); + assertThat(toRgbColor(SassColor.complement(rgb(0xd2e1dd)))).isEqualTo(rgb(0xe1d2d6)); // Hue 210deg becomes 30deg. //@debug color.complement(#036); // #663300 - assertThat(SassColor.complement(rgb(0x003366))).isEqualTo(rgb(0x663300)); + assertThat(toRgbColor(SassColor.complement(rgb(0x003366)))).isEqualTo(rgb(0x663300)); } @Test @@ -78,27 +77,27 @@ void darken() { void desaturate() { // Saturation 100% becomes 80%. //@debug desaturate(#036, 20%); // #0a335c - assertThat(SassColor.desaturate(rgb(0x003366), 20)).isEqualTo(rgb(0x0a335c)); + assertThat(toRgbColor(SassColor.desaturate(rgb(0x003366), 20))).isEqualTo(rgb(0x0a335c)); // Saturation 35% becomes 15%. //@debug desaturate(#f2ece4, 20%); // #eeebe8 - assertThat(SassColor.desaturate(rgb(0xf2ece4), 20)).isEqualTo(rgb(0xeeebe8)); + assertThat(toRgbColor(SassColor.desaturate(rgb(0xf2ece4), 20))).isEqualTo(rgb(0xeeebe8)); // Saturation 20% becomes 0%. //@debug desaturate(#d2e1dd, 30%); // #dadada - assertThat(SassColor.desaturate(rgb(0xd2e1dd), 20)).isEqualTo(rgb(0xdadada)); + assertThat(toRgbColor(SassColor.desaturate(rgb(0xd2e1dd), 20))).isEqualTo(rgb(0xdadada)); } @Test void greyscale() { //@debug color.grayscale(#6b717f); // #757575 - assertThat(SassColor.grayscale(rgb(0x6b717f))).isEqualTo(rgb(0x757575)); + assertThat(toRgbColor(SassColor.grayscale(rgb(0x6b717f)))).isEqualTo(rgb(0x757575)); //@debug color.grayscale(#d2e1dd); // #dadada - assertThat(SassColor.grayscale(rgb(0xd2e1dd))).isEqualTo(rgb(0xdadada)); + assertThat(toRgbColor(SassColor.grayscale(rgb(0xd2e1dd)))).isEqualTo(rgb(0xdadada)); //@debug color.grayscale(#036); // #333333 - assertThat(SassColor.grayscale(rgb(0x003366))).isEqualTo(rgb(0x333333)); + assertThat(toRgbColor(SassColor.grayscale(rgb(0x003366)))).isEqualTo(rgb(0x333333)); } @Test @@ -129,8 +128,8 @@ void hue() { @Disabled void hwb() { //@debug color.hwb(210, 0%, 60%); // #036 - HwbColor actual = SassColor.hwb(210, 0, 60); - RgbColor expected = rgb(0x003366); + Color actual = SassColor.hwb(210, 0, 60); + Color expected = rgb(0x003366); assertThat(actual).isEqualTo(toHwbColor(expected)); assertThat(toRgbColor(actual)).isEqualTo(expected); @@ -175,15 +174,15 @@ void invert() { void lighten() { // Lightness 46% becomes 66%. //@debug lighten(#6b717f, 20%); // #a1a5af - assertThat(SassColor.lighten(rgb(0x6b717f), 20)).isEqualTo(rgb(0xa1a5af)); + assertThat(toRgbColor(SassColor.lighten(rgb(0x6b717f), 20))).isEqualTo(rgb(0xa1a5af)); // Lightness 20% becomes 80%. //@debug lighten(#036, 60%); // #99ccff - assertThat(SassColor.lighten(rgb(0x003366), 60)).isEqualTo(rgb(0x99ccff)); + assertThat(toRgbColor(SassColor.lighten(rgb(0x003366), 60))).isEqualTo(rgb(0x99ccff)); // Lightness 85% becomes 100%. //@debug lighten(#e1d7d2, 30%); // white - assertThat(SassColor.lighten(rgb(0xe1d7d2), 30)).isEqualTo(white); + assertThat(toRgbColor(SassColor.lighten(rgb(0xe1d7d2), 30))).isEqualTo(white); } @Test diff --git a/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/util/ColorUtilTest.java b/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/util/ColorUtilTest.java index 8afec3e3..88a75d9c 100644 --- a/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/util/ColorUtilTest.java +++ b/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/util/ColorUtilTest.java @@ -3,9 +3,7 @@ import org.junit.jupiter.api.DynamicTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestFactory; -import com.sass_lang.embedded_protocol.Value.HslColor; -import com.sass_lang.embedded_protocol.Value.HwbColor; -import com.sass_lang.embedded_protocol.Value.RgbColor; +import com.sass_lang.embedded_protocol.Value.Color; import java.util.stream.Stream; @@ -13,58 +11,64 @@ class ColorUtilTest { - private static final RgbColor rgbRed = RgbColor.newBuilder() - .setRed(255) + private static final Color rgbRed = Color.newBuilder() + .setSpace("rgb") + .setChannel1(255) .setAlpha(1d) .build(); - private static final RgbColor rgbBlack = RgbColor.newBuilder() + private static final Color rgbBlack = Color.newBuilder() + .setSpace("rgb") .setAlpha(1d) .build(); - private static final RgbColor rgbGrey = RgbColor.newBuilder() - .setRed(128) - .setGreen(128) - .setBlue(128) + private static final Color rgbGrey = Color.newBuilder() + .setSpace("rgb") + .setChannel1(128) + .setChannel2(128) + .setChannel3(128) .setAlpha(1d) .build(); @Test void toJavaColor_hwb_red() { - HwbColor red = HwbColor.newBuilder() - .setHue(0d) - .setWhiteness(0d) - .setBlackness(0d) + Color red = Color.newBuilder() + .setSpace("hwb") + .setChannel1(0d) + .setChannel2(0d) + .setChannel3(0d) .setAlpha(1d) .build(); - RgbColor javaRed = ColorUtil.toRgbColor(red); + Color javaRed = ColorUtil.toRgbColor(red); assertThat(javaRed).isEqualTo(rgbRed); } @Test void toJavaColor_hwb_black() { - HwbColor black = HwbColor.newBuilder() - .setHue(120d) - .setWhiteness(0d) - .setBlackness(100d) + Color black = Color.newBuilder() + .setSpace("hwb") + .setChannel1(120d) + .setChannel2(0d) + .setChannel3(100d) .setAlpha(1d) .build(); - RgbColor javaRed = ColorUtil.toRgbColor(black); + Color javaRed = ColorUtil.toRgbColor(black); assertThat(javaRed).isEqualTo(rgbBlack); } @Test void toJavaColor_hwb_grey() { - HwbColor grey = HwbColor.newBuilder() - .setHue(120d) - .setWhiteness(50d) - .setBlackness(50d) + Color grey = Color.newBuilder() + .setSpace("hwb") + .setChannel1(120d) + .setChannel2(50d) + .setChannel3(50d) .setAlpha(1d) .build(); - RgbColor javaRed = ColorUtil.toRgbColor(grey); + Color javaRed = ColorUtil.toRgbColor(grey); assertThat(javaRed).isEqualTo(rgbGrey); } @@ -73,8 +77,8 @@ Stream circle() { return Stream.of(rgbRed, rgbBlack, rgbGrey) .map(rgbColor -> DynamicTest.dynamicTest(rgbColor.toString(), () -> { - HwbColor hwbColor = ColorUtil.toHwbColor(rgbColor); - HslColor hslColor = ColorUtil.toHslColor(hwbColor); + Color hwbColor = ColorUtil.toHwbColor(rgbColor); + Color hslColor = ColorUtil.toHslColor(hwbColor); assertThat(ColorUtil.toRgbColor(hslColor)).isEqualTo(rgbColor); })); diff --git a/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/util/ColorValidatorTest.java b/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/util/ColorValidatorTest.java index 69d77ab2..88222163 100644 --- a/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/util/ColorValidatorTest.java +++ b/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/util/ColorValidatorTest.java @@ -1,9 +1,7 @@ package de.larsgrefer.sass.embedded.util; import org.junit.jupiter.api.Test; -import com.sass_lang.embedded_protocol.Value.HslColor; -import com.sass_lang.embedded_protocol.Value.HwbColor; -import com.sass_lang.embedded_protocol.Value.RgbColor; +import com.sass_lang.embedded_protocol.Value.Color; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -11,51 +9,51 @@ class ColorValidatorTest { @Test void assertValid_rgb() { - RgbColor rgbColor = RgbColor.newBuilder().build(); + Color rgbColor = Color.newBuilder().setSpace("rgb").build(); ColorValidator.assertValid(rgbColor); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid((RgbColor) null)); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid((Color) null)); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(rgbColor.toBuilder().setRed(500))); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(rgbColor.toBuilder().setRed(-1))); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(rgbColor.toBuilder().setGreen(500))); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(rgbColor.toBuilder().setGreen(-1))); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(rgbColor.toBuilder().setBlue(500))); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(rgbColor.toBuilder().setBlue(-1))); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(rgbColor.toBuilder().setChannel1(500))); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(rgbColor.toBuilder().setChannel1(-1))); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(rgbColor.toBuilder().setChannel2(500))); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(rgbColor.toBuilder().setChannel2(-1))); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(rgbColor.toBuilder().setChannel3(500))); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(rgbColor.toBuilder().setChannel3(-1))); assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(rgbColor.toBuilder().setAlpha(2.3d))); assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(rgbColor.toBuilder().setAlpha(-2.3d))); } @Test void assertValid_hsl() { - HslColor hslColor = HslColor.newBuilder().build(); + Color hslColor = Color.newBuilder().setSpace("hsl").build(); ColorValidator.assertValid(hslColor); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid((HslColor) null)); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid((Color) null)); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hslColor.toBuilder().setLightness(101))); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hslColor.toBuilder().setLightness(-1))); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hslColor.toBuilder().setSaturation(101))); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hslColor.toBuilder().setSaturation(-1))); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hslColor.toBuilder().setChannel3(101))); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hslColor.toBuilder().setChannel3(-1))); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hslColor.toBuilder().setChannel2(101))); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hslColor.toBuilder().setChannel2(-1))); assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hslColor.toBuilder().setAlpha(2.3d))); assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hslColor.toBuilder().setAlpha(-2.3d))); } @Test void assertValid_hwb() { - HwbColor hwbColor = HwbColor.newBuilder().build(); + Color hwbColor = Color.newBuilder().setSpace("hwb").build(); ColorValidator.assertValid(hwbColor); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid((HwbColor) null)); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid((Color) null)); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hwbColor.toBuilder().setWhiteness(101))); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hwbColor.toBuilder().setWhiteness(-1))); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hwbColor.toBuilder().setBlackness(101))); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hwbColor.toBuilder().setBlackness(-1))); - assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hwbColor.toBuilder().setWhiteness(51).setBlackness(51))); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hwbColor.toBuilder().setChannel2(101))); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hwbColor.toBuilder().setChannel2(-1))); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hwbColor.toBuilder().setChannel3(101))); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hwbColor.toBuilder().setChannel3(-1))); + assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hwbColor.toBuilder().setChannel2(51).setChannel3(51))); assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hwbColor.toBuilder().setAlpha(2.3d))); assertThrows(IllegalArgumentException.class, () -> ColorValidator.assertValid(hwbColor.toBuilder().setAlpha(-2.3d))); } From e54509a5487136ebc19495edd76b1c0b3e5e6180 Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Thu, 10 Oct 2024 23:10:46 +0200 Subject: [PATCH 02/46] Update to dart-sass 1.79.4 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index cbe7325f..a93e5098 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -dartSassVersion=1.79.1 +dartSassVersion=1.79.4 embeddedProtocolVersion=3.0.0 spring5Verison=5.3.32 From 9b03a8aaa449801c57267b823dd6030c941e31fa Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Sun, 13 Oct 2024 18:06:53 +0200 Subject: [PATCH 03/46] Update to dart-sass 1.79.5 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index d62130b3..d7f80f20 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -dartSassVersion=1.79.4 +dartSassVersion=1.79.5 embeddedProtocolVersion=3.0.0 spring5Verison=5.3.39 From a4f047f0f41d940c6f8a40a442e0c6c697f43900 Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Sun, 13 Oct 2024 18:11:47 +0200 Subject: [PATCH 04/46] Update to embedded protocol 3.1.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index d7f80f20..d4ee4ed8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ dartSassVersion=1.79.5 -embeddedProtocolVersion=3.0.0 +embeddedProtocolVersion=3.1.0 spring5Verison=5.3.39 spring6Version=6.1.13 From fc032973caa94b08ee5e943293ec38be3b1ccdc9 Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Sun, 13 Oct 2024 18:17:28 +0200 Subject: [PATCH 05/46] fix tests --- .../java/de/larsgrefer/sass/embedded/util/ColorUtilTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/util/ColorUtilTest.java b/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/util/ColorUtilTest.java index 88a75d9c..86038217 100644 --- a/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/util/ColorUtilTest.java +++ b/sass-embedded-host/src/test/java/de/larsgrefer/sass/embedded/util/ColorUtilTest.java @@ -14,11 +14,16 @@ class ColorUtilTest { private static final Color rgbRed = Color.newBuilder() .setSpace("rgb") .setChannel1(255) + .setChannel2(0) + .setChannel3(0) .setAlpha(1d) .build(); private static final Color rgbBlack = Color.newBuilder() .setSpace("rgb") + .setChannel1(0) + .setChannel2(0) + .setChannel3(0) .setAlpha(1d) .build(); From 3ce689311dfe4142e288fec31b3624bf449aecb9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 00:12:34 +0000 Subject: [PATCH 06/46] Bump org.jetbrains:annotations from 26.0.0 to 26.0.1 Bumps [org.jetbrains:annotations](https://github.com/JetBrains/java-annotations) from 26.0.0 to 26.0.1. - [Release notes](https://github.com/JetBrains/java-annotations/releases) - [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md) - [Commits](https://github.com/JetBrains/java-annotations/compare/26.0.0...26.0.1) --- updated-dependencies: - dependency-name: org.jetbrains:annotations dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- sass-embedded-host/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sass-embedded-host/build.gradle b/sass-embedded-host/build.gradle index ed42f903..48b537eb 100644 --- a/sass-embedded-host/build.gradle +++ b/sass-embedded-host/build.gradle @@ -28,7 +28,7 @@ dependencies { api project(":sass-embedded-bundled") api "org.slf4j:slf4j-api:1.7.36" - compileOnly 'org.jetbrains:annotations:26.0.0' + compileOnly 'org.jetbrains:annotations:26.0.1' compileOnly 'androidx.annotation:annotation-jvm:1.8.2' compileOnly 'com.google.code.findbugs:jsr305:3.0.2' compileOnly 'javax.servlet:javax.servlet-api:4.0.1' @@ -40,7 +40,7 @@ dependencies { springSupportApi "org.springframework:spring-core:$spring5Verison" springWebmvcSupportApi "org.springframework:spring-webmvc:$spring5Verison" - testCompileOnly 'org.jetbrains:annotations:26.0.0' + testCompileOnly 'org.jetbrains:annotations:26.0.1' testRuntimeOnly 'org.webjars:bootstrap:5.3.3' } From d7abb999704dd948d0bc69f3f5b0030d8d5ca3a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 00:57:44 +0000 Subject: [PATCH 07/46] Bump ch.qos.logback:logback-classic from 1.5.9 to 1.5.11 Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.9 to 1.5.11. - [Commits](https://github.com/qos-ch/logback/compare/v_1.5.9...v_1.5.11) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-classic dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index be6944bf..a87a86b4 100644 --- a/build.gradle +++ b/build.gradle @@ -50,7 +50,7 @@ allprojects { testImplementation 'org.junit.jupiter:junit-jupiter-api' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' - testImplementation 'ch.qos.logback:logback-classic:1.5.9' + testImplementation 'ch.qos.logback:logback-classic:1.5.11' } tasks.withType(Test).configureEach { From f49653aeed255c72014c3825c0272ecee52a6be0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 00:15:57 +0000 Subject: [PATCH 08/46] Bump org.junit:junit-bom from 5.11.2 to 5.11.3 Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.11.2 to 5.11.3. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.11.2...r5.11.3) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index a87a86b4..7c7cd6c5 100644 --- a/build.gradle +++ b/build.gradle @@ -46,7 +46,7 @@ allprojects { dependencies { testImplementation 'org.assertj:assertj-core:3.26.3' - testImplementation platform("org.junit:junit-bom:5.11.2") + testImplementation platform("org.junit:junit-bom:5.11.3") testImplementation 'org.junit.jupiter:junit-jupiter-api' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' From af9dfae6a401d13a83d723482ecf5996b4972311 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2024 00:50:23 +0000 Subject: [PATCH 09/46] Bump androidx.annotation:annotation from 1.8.2 to 1.9.1 Bumps androidx.annotation:annotation from 1.8.2 to 1.9.1. --- updated-dependencies: - dependency-name: androidx.annotation:annotation dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- sass-embedded-android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sass-embedded-android/build.gradle b/sass-embedded-android/build.gradle index fbec42a6..886fc98d 100644 --- a/sass-embedded-android/build.gradle +++ b/sass-embedded-android/build.gradle @@ -55,7 +55,7 @@ dependencies { } implementation 'org.slf4j:slf4j-android:1.7.36' - implementation 'androidx.annotation:annotation:1.8.2' + implementation 'androidx.annotation:annotation:1.9.1' dartSass "sass:dart-sass:$dartSassVersion:android-x64@tar.gz" dartSass "sass:dart-sass:$dartSassVersion:android-ia32@tar.gz" From 3c952239ed320dd0a292ff8a655506fbc34ef03c Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Sat, 16 Nov 2024 01:34:28 +0100 Subject: [PATCH 10/46] Improve error messages --- .../sass/embedded/connection/BundledPackageProvider.java | 8 +++++++- .../sass/embedded/connection/ConnectionFactory.java | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/connection/BundledPackageProvider.java b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/connection/BundledPackageProvider.java index ad67c642..2a69bb45 100644 --- a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/connection/BundledPackageProvider.java +++ b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/connection/BundledPackageProvider.java @@ -15,7 +15,13 @@ protected URL getPackageUrl() { String resourcePath = String.format("/de/larsgrefer/sass/embedded/bundled/dart-sass-%s", dartSassPackageSuffix); - return this.getClass().getResource(resourcePath); + URL bundledResource = this.getClass().getResource(resourcePath); + + if (bundledResource == null) { + throw new IllegalStateException("Could not find resource: " + resourcePath); + } + + return bundledResource; } diff --git a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/connection/ConnectionFactory.java b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/connection/ConnectionFactory.java index da40b730..a05efe39 100644 --- a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/connection/ConnectionFactory.java +++ b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/connection/ConnectionFactory.java @@ -55,7 +55,11 @@ public static ProcessConnection fromPackageProvider(DartSassPackageProvider dart * @throws IOException if the subprocess can not be started. */ public static ProcessConnection ofExecutable(File executable) throws IOException { - if (executable == null || !executable.isFile()) { + if (executable == null) { + throw new IllegalArgumentException("executable must not be null"); + } + + if (!executable.isFile()) { throw new IllegalArgumentException(executable + " is not a file"); } From c586ebb09596743fb1def5b1d98bb82f5be5d796 Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Sat, 16 Nov 2024 01:37:52 +0100 Subject: [PATCH 11/46] Update to Gradle 8.11 --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index df97d72b..94113f20 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From af96170309cc858613b7db8f6c2b41bfbd6a9c2e Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Sat, 16 Nov 2024 01:40:14 +0100 Subject: [PATCH 12/46] Update to dart-sass 1.81.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index d4ee4ed8..c8731723 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -dartSassVersion=1.79.5 +dartSassVersion=1.81.0 embeddedProtocolVersion=3.1.0 spring5Verison=5.3.39 From ed47f03ec178c3b7f0141753944da27069338b6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 16 Nov 2024 00:43:18 +0000 Subject: [PATCH 13/46] Bump androidx.annotation:annotation-jvm from 1.8.2 to 1.9.1 Bumps androidx.annotation:annotation-jvm from 1.8.2 to 1.9.1. --- updated-dependencies: - dependency-name: androidx.annotation:annotation-jvm dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- sass-embedded-host/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sass-embedded-host/build.gradle b/sass-embedded-host/build.gradle index 48b537eb..7e020e50 100644 --- a/sass-embedded-host/build.gradle +++ b/sass-embedded-host/build.gradle @@ -29,7 +29,7 @@ dependencies { api "org.slf4j:slf4j-api:1.7.36" compileOnly 'org.jetbrains:annotations:26.0.1' - compileOnly 'androidx.annotation:annotation-jvm:1.8.2' + compileOnly 'androidx.annotation:annotation-jvm:1.9.1' compileOnly 'com.google.code.findbugs:jsr305:3.0.2' compileOnly 'javax.servlet:javax.servlet-api:4.0.1' compileOnly 'jakarta.servlet:jakarta.servlet-api:6.0.0' From 7c1b1c6335748a5ed609a4ec1f8342600b97721e Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Sat, 16 Nov 2024 01:54:30 +0100 Subject: [PATCH 14/46] Update to AGP 8.7.2 --- settings.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/settings.gradle b/settings.gradle index 196db896..9a756092 100644 --- a/settings.gradle +++ b/settings.gradle @@ -5,8 +5,8 @@ pluginManagement { mavenCentral() } plugins { - id "com.android.library" version "8.5.2" - id "com.android.application" version "8.5.2" + id "com.android.library" version "8.7.2" + id "com.android.application" version "8.7.2" } } From 64a644c1d2518f015cc238ad8b5eff470fefddb2 Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Sat, 16 Nov 2024 01:55:01 +0100 Subject: [PATCH 15/46] Update Gradle Plugins --- settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index 9a756092..df251d4a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -13,7 +13,7 @@ pluginManagement { plugins { id 'io.freefair.settings.plugin-versions' version '8.10.2' id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' - id "com.gradle.develocity" version "3.18.1" + id "com.gradle.develocity" version "3.18.2" } rootProject.name = 'dart-sass-java' From b4be678b29eb0fa15ce6b9fd8ff69bee36d797d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 00:42:04 +0000 Subject: [PATCH 16/46] Bump io.freefair.settings.plugin-versions from 8.10.2 to 8.11 Bumps [io.freefair.settings.plugin-versions](https://github.com/freefair/gradle-plugins) from 8.10.2 to 8.11. - [Release notes](https://github.com/freefair/gradle-plugins/releases) - [Commits](https://github.com/freefair/gradle-plugins/compare/8.10.2...8.11) --- updated-dependencies: - dependency-name: io.freefair.settings.plugin-versions dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index df251d4a..55bcc5fe 100644 --- a/settings.gradle +++ b/settings.gradle @@ -11,7 +11,7 @@ pluginManagement { } plugins { - id 'io.freefair.settings.plugin-versions' version '8.10.2' + id 'io.freefair.settings.plugin-versions' version '8.11' id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' id "com.gradle.develocity" version "3.18.2" } From 2f35d6eab7be3b5dcd6d8ba8377d020e3ffdabb7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 00:42:10 +0000 Subject: [PATCH 17/46] Bump org.springframework.boot from 3.3.4 to 3.3.5 Bumps [org.springframework.boot](https://github.com/spring-projects/spring-boot) from 3.3.4 to 3.3.5. - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.3.4...v3.3.5) --- updated-dependencies: - dependency-name: org.springframework.boot dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- test-projects/spring-boot-resources/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-projects/spring-boot-resources/build.gradle b/test-projects/spring-boot-resources/build.gradle index 64c1d462..0aa85456 100644 --- a/test-projects/spring-boot-resources/build.gradle +++ b/test-projects/spring-boot-resources/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'org.springframework.boot' version '3.3.4' + id 'org.springframework.boot' version '3.3.5' id 'io.spring.dependency-management' version '1.1.6' id 'java' } From cbcdbfb11fe0b077adefd2ac9623dabef1d280ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 00:42:30 +0000 Subject: [PATCH 18/46] Bump ch.qos.logback:logback-classic from 1.5.11 to 1.5.12 Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.11 to 1.5.12. - [Commits](https://github.com/qos-ch/logback/compare/v_1.5.11...v_1.5.12) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-classic dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 7c7cd6c5..da9cc2ae 100644 --- a/build.gradle +++ b/build.gradle @@ -50,7 +50,7 @@ allprojects { testImplementation 'org.junit.jupiter:junit-jupiter-api' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' - testImplementation 'ch.qos.logback:logback-classic:1.5.11' + testImplementation 'ch.qos.logback:logback-classic:1.5.12' } tasks.withType(Test).configureEach { From 9425c4db3714b7d08e13a3f070a8800c9e6c255c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2024 00:57:56 +0000 Subject: [PATCH 19/46] Bump org.apache.logging.log4j:log4j-api from 2.24.1 to 2.24.2 Bumps org.apache.logging.log4j:log4j-api from 2.24.1 to 2.24.2. --- updated-dependencies: - dependency-name: org.apache.logging.log4j:log4j-api dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- sass-embedded-host/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sass-embedded-host/build.gradle b/sass-embedded-host/build.gradle index 7e020e50..2a8a7d52 100644 --- a/sass-embedded-host/build.gradle +++ b/sass-embedded-host/build.gradle @@ -33,7 +33,7 @@ dependencies { compileOnly 'com.google.code.findbugs:jsr305:3.0.2' compileOnly 'javax.servlet:javax.servlet-api:4.0.1' compileOnly 'jakarta.servlet:jakarta.servlet-api:6.0.0' - compileOnly 'org.apache.logging.log4j:log4j-api:2.24.1' + compileOnly 'org.apache.logging.log4j:log4j-api:2.24.2' webjarsSupportImplementation "org.webjars:webjars-locator-core:0.59" compileOnly "org.jboss:jboss-vfs:3.3.2.Final" From 3a29270bfac78d2f7ebf36eae0a33c92e4733d8b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2024 00:58:06 +0000 Subject: [PATCH 20/46] Bump org.springframework.boot from 3.3.5 to 3.4.0 Bumps [org.springframework.boot](https://github.com/spring-projects/spring-boot) from 3.3.5 to 3.4.0. - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.3.5...v3.4.0) --- updated-dependencies: - dependency-name: org.springframework.boot dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- test-projects/spring-boot-resources/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-projects/spring-boot-resources/build.gradle b/test-projects/spring-boot-resources/build.gradle index 0aa85456..bed2c0ad 100644 --- a/test-projects/spring-boot-resources/build.gradle +++ b/test-projects/spring-boot-resources/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'org.springframework.boot' version '3.3.5' + id 'org.springframework.boot' version '3.4.0' id 'io.spring.dependency-management' version '1.1.6' id 'java' } From a495356c3638c634c2909af07ab2e714dd242933 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 00:41:13 +0000 Subject: [PATCH 21/46] Bump codecov/codecov-action from 4.6.0 to 5.0.7 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.6.0 to 5.0.7. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v4.6.0...v5.0.7) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index ddbd64cd..ec14743f 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -46,7 +46,7 @@ jobs: - run: ./gradlew jacocoTestReport - name: Upload coverage report - uses: codecov/codecov-action@v4.6.0 + uses: codecov/codecov-action@v5.0.7 with: files: jacoco*.xml,*Jacoco*.xml From 0266201e99004ea2e64a7a43788dc33729ca6cac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 00:09:56 +0000 Subject: [PATCH 22/46] Bump protobufVersion from 4.28.2 to 4.29.0 Bumps `protobufVersion` from 4.28.2 to 4.29.0. Updates `com.google.protobuf:protobuf-java` from 4.28.2 to 4.29.0 - [Release notes](https://github.com/protocolbuffers/protobuf/releases) - [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl) - [Commits](https://github.com/protocolbuffers/protobuf/commits) Updates `com.google.protobuf:protoc` from 4.28.2 to 4.29.0 - [Release notes](https://github.com/protocolbuffers/protobuf/releases) - [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl) - [Commits](https://github.com/protocolbuffers/protobuf/commits) --- updated-dependencies: - dependency-name: com.google.protobuf:protobuf-java dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.google.protobuf:protoc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- sass-embedded-protocol/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sass-embedded-protocol/build.gradle b/sass-embedded-protocol/build.gradle index d66974c4..3af1b5f6 100644 --- a/sass-embedded-protocol/build.gradle +++ b/sass-embedded-protocol/build.gradle @@ -19,7 +19,7 @@ repositories { } } -def protobufVersion = "4.28.2" +def protobufVersion = "4.29.0" tasks.withType(com.google.protobuf.gradle.ProtobufExtract).configureEach { doFirst { From 3e06586ca9053171d853a7f824e9571a3ae5f418 Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Fri, 29 Nov 2024 01:06:33 +0100 Subject: [PATCH 23/46] Update to Gradle 8.11.1 --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 94113f20..e2847c82 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From aa9ab6223ef652d38ed5c0b2a148693118c00ffb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 00:20:33 +0000 Subject: [PATCH 24/46] Bump org.graalvm.buildtools.native from 0.10.3 to 0.10.4 Bumps [org.graalvm.buildtools.native](https://github.com/graalvm/native-build-tools) from 0.10.3 to 0.10.4. - [Release notes](https://github.com/graalvm/native-build-tools/releases) - [Commits](https://github.com/graalvm/native-build-tools/commits) --- updated-dependencies: - dependency-name: org.graalvm.buildtools.native dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- test-projects/graalvm/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-projects/graalvm/build.gradle b/test-projects/graalvm/build.gradle index 1494489f..cec7eb74 100644 --- a/test-projects/graalvm/build.gradle +++ b/test-projects/graalvm/build.gradle @@ -1,7 +1,7 @@ plugins { id "java" id "application" - id 'org.graalvm.buildtools.native' version '0.10.3' + id 'org.graalvm.buildtools.native' version '0.10.4' } java { From fe0ce1673d038140423287c9aafcb2152aa54f91 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 00:37:23 +0000 Subject: [PATCH 25/46] Bump protobufVersion from 4.29.0 to 4.29.1 Bumps `protobufVersion` from 4.29.0 to 4.29.1. Updates `com.google.protobuf:protobuf-java` from 4.29.0 to 4.29.1 - [Release notes](https://github.com/protocolbuffers/protobuf/releases) - [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl) - [Commits](https://github.com/protocolbuffers/protobuf/commits) Updates `com.google.protobuf:protoc` from 4.29.0 to 4.29.1 - [Release notes](https://github.com/protocolbuffers/protobuf/releases) - [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl) - [Commits](https://github.com/protocolbuffers/protobuf/commits) --- updated-dependencies: - dependency-name: com.google.protobuf:protobuf-java dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.google.protobuf:protoc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- sass-embedded-protocol/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sass-embedded-protocol/build.gradle b/sass-embedded-protocol/build.gradle index 3af1b5f6..50b4f76d 100644 --- a/sass-embedded-protocol/build.gradle +++ b/sass-embedded-protocol/build.gradle @@ -19,7 +19,7 @@ repositories { } } -def protobufVersion = "4.29.0" +def protobufVersion = "4.29.1" tasks.withType(com.google.protobuf.gradle.ProtobufExtract).configureEach { doFirst { From 367bd6dbfc3e3c2ae7e61e99929742798e29ae4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 00:20:24 +0000 Subject: [PATCH 26/46] Bump codecov/codecov-action from 5.0.7 to 5.1.1 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.0.7 to 5.1.1. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v5.0.7...v5.1.1) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index ec14743f..f2c0e079 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -46,7 +46,7 @@ jobs: - run: ./gradlew jacocoTestReport - name: Upload coverage report - uses: codecov/codecov-action@v5.0.7 + uses: codecov/codecov-action@v5.1.1 with: files: jacoco*.xml,*Jacoco*.xml From 8741b2076661ad609d963da4c16d7abf7416ff41 Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Mon, 9 Dec 2024 22:46:56 +0100 Subject: [PATCH 27/46] Always extract --- .../embedded/connection/DartSassPackageProvider.java | 10 ++++------ .../java/de/larsgrefer/sass/embedded/util/IOUtils.java | 9 --------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/connection/DartSassPackageProvider.java b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/connection/DartSassPackageProvider.java index 1266f77a..cd69b578 100644 --- a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/connection/DartSassPackageProvider.java +++ b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/connection/DartSassPackageProvider.java @@ -37,12 +37,10 @@ synchronized File extractPackage() throws IOException { Path targetPath = getTargetPath(); - if (IOUtils.isEmpty(targetPath)) { - try { - IOUtils.extract(dist, targetPath); - } catch (IOException e) { - throw new IOException(String.format("Failed to extract %s into %s", dist, targetPath), e); - } + try { + IOUtils.extract(dist, targetPath); + } catch (IOException e) { + throw new IOException(String.format("Failed to extract %s into %s", dist, targetPath), e); } File execDir = targetPath.resolve("dart-sass").toFile(); diff --git a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/IOUtils.java b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/IOUtils.java index 1d5ef93a..0cd5884b 100644 --- a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/IOUtils.java +++ b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/IOUtils.java @@ -109,13 +109,4 @@ private static void copy(InputStream inputStream, OutputStream os) throws IOExce } } - public static boolean isEmpty(Path path) throws IOException { - if (Files.isDirectory(path)) { - try (Stream entries = Files.list(path)) { - return !entries.findFirst().isPresent(); - } - } - - return false; - } } From 530a32a83798994941420b0d34278e69f6dd3e76 Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Mon, 9 Dec 2024 22:53:08 +0100 Subject: [PATCH 28/46] Update to dart-sass 1.82.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index c8731723..f7575ac1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -dartSassVersion=1.81.0 +dartSassVersion=1.82.0 embeddedProtocolVersion=3.1.0 spring5Verison=5.3.39 From c3bafe0a5df0f6f361d2399716a275c310ed5421 Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Mon, 9 Dec 2024 22:56:12 +0100 Subject: [PATCH 29/46] Update to AGP 8.7.3 --- settings.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/settings.gradle b/settings.gradle index 55bcc5fe..4ac5a600 100644 --- a/settings.gradle +++ b/settings.gradle @@ -5,8 +5,8 @@ pluginManagement { mavenCentral() } plugins { - id "com.android.library" version "8.7.2" - id "com.android.application" version "8.7.2" + id "com.android.library" version "8.7.3" + id "com.android.application" version "8.7.3" } } From 51119e0b4d3540e40bf6a64126986556b5bbdf0c Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Tue, 10 Dec 2024 00:11:18 +0100 Subject: [PATCH 30/46] Update to AGP 8.7.3 --- settings.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/settings.gradle b/settings.gradle index 55bcc5fe..4ac5a600 100644 --- a/settings.gradle +++ b/settings.gradle @@ -5,8 +5,8 @@ pluginManagement { mavenCentral() } plugins { - id "com.android.library" version "8.7.2" - id "com.android.application" version "8.7.2" + id "com.android.library" version "8.7.3" + id "com.android.application" version "8.7.3" } } From fc90b92735ebbaac2c2bd02469939a4b6a86ed5e Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Tue, 10 Dec 2024 00:22:42 +0100 Subject: [PATCH 31/46] Update Gradle Plugins --- settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index 4ac5a600..4d6f3790 100644 --- a/settings.gradle +++ b/settings.gradle @@ -12,7 +12,7 @@ pluginManagement { plugins { id 'io.freefair.settings.plugin-versions' version '8.11' - id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.9.0' id "com.gradle.develocity" version "3.18.2" } From d2944c526d87f5555b1cb821593e3c4a20d98b38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 00:39:56 +0000 Subject: [PATCH 32/46] Bump com.gradle.develocity from 3.18.2 to 3.19 Bumps com.gradle.develocity from 3.18.2 to 3.19. --- updated-dependencies: - dependency-name: com.gradle.develocity dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index 4d6f3790..4770abf6 100644 --- a/settings.gradle +++ b/settings.gradle @@ -13,7 +13,7 @@ pluginManagement { plugins { id 'io.freefair.settings.plugin-versions' version '8.11' id 'org.gradle.toolchains.foojay-resolver-convention' version '0.9.0' - id "com.gradle.develocity" version "3.18.2" + id "com.gradle.develocity" version "3.19" } rootProject.name = 'dart-sass-java' From a6f26828ff66ff0fb165e5352f79e3498d7280b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 00:49:37 +0000 Subject: [PATCH 33/46] Bump org.apache.logging.log4j:log4j-api from 2.24.2 to 2.24.3 Bumps org.apache.logging.log4j:log4j-api from 2.24.2 to 2.24.3. --- updated-dependencies: - dependency-name: org.apache.logging.log4j:log4j-api dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- sass-embedded-host/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sass-embedded-host/build.gradle b/sass-embedded-host/build.gradle index 2a8a7d52..db9c128c 100644 --- a/sass-embedded-host/build.gradle +++ b/sass-embedded-host/build.gradle @@ -33,7 +33,7 @@ dependencies { compileOnly 'com.google.code.findbugs:jsr305:3.0.2' compileOnly 'javax.servlet:javax.servlet-api:4.0.1' compileOnly 'jakarta.servlet:jakarta.servlet-api:6.0.0' - compileOnly 'org.apache.logging.log4j:log4j-api:2.24.2' + compileOnly 'org.apache.logging.log4j:log4j-api:2.24.3' webjarsSupportImplementation "org.webjars:webjars-locator-core:0.59" compileOnly "org.jboss:jboss-vfs:3.3.2.Final" From e0d139927be82e9edd5c5e6bce472b98cf958a75 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 00:17:22 +0000 Subject: [PATCH 34/46] Bump org.junit:junit-bom from 5.11.3 to 5.11.4 Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.11.3 to 5.11.4. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.11.3...r5.11.4) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index da9cc2ae..a478ab0e 100644 --- a/build.gradle +++ b/build.gradle @@ -46,7 +46,7 @@ allprojects { dependencies { testImplementation 'org.assertj:assertj-core:3.26.3' - testImplementation platform("org.junit:junit-bom:5.11.3") + testImplementation platform("org.junit:junit-bom:5.11.4") testImplementation 'org.junit.jupiter:junit-jupiter-api' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' From 391068a467708749facc5451a2cde4f76f54a8f9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 00:54:50 +0000 Subject: [PATCH 35/46] Bump io.spring.dependency-management from 1.1.6 to 1.1.7 Bumps [io.spring.dependency-management](https://github.com/spring-gradle-plugins/dependency-management-plugin) from 1.1.6 to 1.1.7. - [Release notes](https://github.com/spring-gradle-plugins/dependency-management-plugin/releases) - [Commits](https://github.com/spring-gradle-plugins/dependency-management-plugin/compare/v1.1.6...v1.1.7) --- updated-dependencies: - dependency-name: io.spring.dependency-management dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- test-projects/spring-boot-resources/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-projects/spring-boot-resources/build.gradle b/test-projects/spring-boot-resources/build.gradle index bed2c0ad..1c6d68a5 100644 --- a/test-projects/spring-boot-resources/build.gradle +++ b/test-projects/spring-boot-resources/build.gradle @@ -1,6 +1,6 @@ plugins { id 'org.springframework.boot' version '3.4.0' - id 'io.spring.dependency-management' version '1.1.6' + id 'io.spring.dependency-management' version '1.1.7' id 'java' } From 73ded9f16917ad5ea0b71fad3e48ff87d66241c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 00:37:45 +0000 Subject: [PATCH 36/46] Bump ch.qos.logback:logback-classic from 1.5.12 to 1.5.13 Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.12 to 1.5.13. - [Commits](https://github.com/qos-ch/logback/commits) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-classic dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index da9cc2ae..4c2ab1f6 100644 --- a/build.gradle +++ b/build.gradle @@ -50,7 +50,7 @@ allprojects { testImplementation 'org.junit.jupiter:junit-jupiter-api' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' - testImplementation 'ch.qos.logback:logback-classic:1.5.12' + testImplementation 'ch.qos.logback:logback-classic:1.5.13' } tasks.withType(Test).configureEach { From 36dc576ed20c781bffe4ca487b9c1a60bf0390c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 00:14:33 +0000 Subject: [PATCH 37/46] Bump org.springframework.boot from 3.4.0 to 3.4.1 Bumps [org.springframework.boot](https://github.com/spring-projects/spring-boot) from 3.4.0 to 3.4.1. - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.4.0...v3.4.1) --- updated-dependencies: - dependency-name: org.springframework.boot dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- test-projects/spring-boot-resources/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-projects/spring-boot-resources/build.gradle b/test-projects/spring-boot-resources/build.gradle index 1c6d68a5..cb08e2ea 100644 --- a/test-projects/spring-boot-resources/build.gradle +++ b/test-projects/spring-boot-resources/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'org.springframework.boot' version '3.4.0' + id 'org.springframework.boot' version '3.4.1' id 'io.spring.dependency-management' version '1.1.7' id 'java' } From 1dda006a7c3b75c08b8bf013faa62f8bf8777926 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 00:14:42 +0000 Subject: [PATCH 38/46] Bump protobufVersion from 4.29.1 to 4.29.2 Bumps `protobufVersion` from 4.29.1 to 4.29.2. Updates `com.google.protobuf:protobuf-java` from 4.29.1 to 4.29.2 - [Release notes](https://github.com/protocolbuffers/protobuf/releases) - [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl) - [Commits](https://github.com/protocolbuffers/protobuf/commits) Updates `com.google.protobuf:protoc` from 4.29.1 to 4.29.2 - [Release notes](https://github.com/protocolbuffers/protobuf/releases) - [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl) - [Commits](https://github.com/protocolbuffers/protobuf/commits) --- updated-dependencies: - dependency-name: com.google.protobuf:protobuf-java dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.google.protobuf:protoc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- sass-embedded-protocol/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sass-embedded-protocol/build.gradle b/sass-embedded-protocol/build.gradle index 50b4f76d..c890a323 100644 --- a/sass-embedded-protocol/build.gradle +++ b/sass-embedded-protocol/build.gradle @@ -19,7 +19,7 @@ repositories { } } -def protobufVersion = "4.29.1" +def protobufVersion = "4.29.2" tasks.withType(com.google.protobuf.gradle.ProtobufExtract).configureEach { doFirst { From 6ecc3e738acd3c6b5c9b317b8b54607c72ba1e6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 00:14:46 +0000 Subject: [PATCH 39/46] Bump ch.qos.logback:logback-classic from 1.5.13 to 1.5.14 Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.13 to 1.5.14. - [Commits](https://github.com/qos-ch/logback/compare/v_1.5.13...v_1.5.14) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-classic dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d6f094c7..a99f09ac 100644 --- a/build.gradle +++ b/build.gradle @@ -50,7 +50,7 @@ allprojects { testImplementation 'org.junit.jupiter:junit-jupiter-api' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' - testImplementation 'ch.qos.logback:logback-classic:1.5.13' + testImplementation 'ch.qos.logback:logback-classic:1.5.14' } tasks.withType(Test).configureEach { From b994b83c8fcef21f65ef5260debb698bebc59413 Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Sat, 21 Dec 2024 00:46:29 +0100 Subject: [PATCH 40/46] Update to Gradle 8.12 --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 3 +-- sass-embedded-android/build.gradle | 14 +++++++------- sass-embedded-bundled-ia32/build.gradle | 2 +- sass-embedded-bundled/build.gradle | 2 +- test-projects/android-app/build.gradle | 12 ++++++------ 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/build.gradle b/build.gradle index d6f094c7..005fb64e 100644 --- a/build.gradle +++ b/build.gradle @@ -87,7 +87,7 @@ allprojects { project.apply plugin: "signing" signing { - required { !version.endsWith('SNAPSHOT') && gradle.taskGraph.hasTask("publish") } + required = { !version.endsWith('SNAPSHOT') && gradle.taskGraph.hasTask("publish") } def signingKey = findProperty("signingKey") def signingPassword = findProperty("signingPassword") diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e2847c82..cea7a793 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index f5feea6d..f3b75f3b 100755 --- a/gradlew +++ b/gradlew @@ -86,8 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s -' "$PWD" ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/sass-embedded-android/build.gradle b/sass-embedded-android/build.gradle index 886fc98d..0aa72de5 100644 --- a/sass-embedded-android/build.gradle +++ b/sass-embedded-android/build.gradle @@ -7,16 +7,16 @@ plugins { description = "SASS Embedded Android" android { - compileSdk 34 - namespace "de.larsgrefer.sass.embedded.android" + compileSdk = 34 + namespace = "de.larsgrefer.sass.embedded.android" buildFeatures { - buildConfig true + buildConfig = true } defaultConfig { - minSdk 21 - targetSdk 34 + minSdk = 21 + targetSdk = 34 consumerProguardFiles 'lib-proguard-rules.pro' buildConfigField("String", "DART_SASS_VERSION", "\"$dartSassVersion\"") @@ -24,7 +24,7 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - packagingOptions.jniLibs.useLegacyPackaging true + packagingOptions.jniLibs.useLegacyPackaging = true } repositories { @@ -32,7 +32,7 @@ repositories { mavenCentral() ivy { //https://github.com/sass/dart-sass/releases/download/1.63.3/dart-sass-1.63.3-linux-x64.tar.gz - url "https://github.com" + url = "https://github.com" patternLayout { artifact "/[orgPath]/[artifact]/releases/download/[revision]/[artifact]-[revision](-[classifier])(.[ext])" } diff --git a/sass-embedded-bundled-ia32/build.gradle b/sass-embedded-bundled-ia32/build.gradle index e6c023fd..10905c8b 100644 --- a/sass-embedded-bundled-ia32/build.gradle +++ b/sass-embedded-bundled-ia32/build.gradle @@ -14,7 +14,7 @@ configurations { repositories { ivy { //https://github.com/sass/dart-sass/releases/download/1.63.3/dart-sass-1.63.3-linux-x64.tar.gz - url "https://github.com" + url = "https://github.com" patternLayout { artifact "/[orgPath]/[artifact]/releases/download/[revision]/[artifact]-[revision](-[classifier])(.[ext])" } diff --git a/sass-embedded-bundled/build.gradle b/sass-embedded-bundled/build.gradle index f7456f8a..bbff5639 100644 --- a/sass-embedded-bundled/build.gradle +++ b/sass-embedded-bundled/build.gradle @@ -17,7 +17,7 @@ configurations { repositories { ivy { //https://github.com/sass/dart-sass/releases/download/1.63.3/dart-sass-1.63.3-linux-x64.tar.gz - url "https://github.com" + url = "https://github.com" patternLayout { artifact "/[orgPath]/[artifact]/releases/download/[revision]/[artifact]-[revision](-[classifier])(.[ext])" } diff --git a/test-projects/android-app/build.gradle b/test-projects/android-app/build.gradle index 7d53af00..ac5a37ff 100644 --- a/test-projects/android-app/build.gradle +++ b/test-projects/android-app/build.gradle @@ -7,21 +7,21 @@ repositories { } android { - compileSdk 34 - namespace "de.larsgrefer.sass.embedded.android.demo" + compileSdk = 34 + namespace = "de.larsgrefer.sass.embedded.android.demo" defaultConfig { - targetSdk 34 - minSdk 21 + targetSdk = 34 + minSdk = 21 } - packagingOptions.jniLibs.useLegacyPackaging true + packagingOptions.jniLibs.useLegacyPackaging = true buildTypes { release { minifyEnabled true - shrinkResources true + shrinkResources = true proguardFiles getDefaultProguardFile( 'proguard-android-optimize.txt'), From f7dfd80ec58e0030aa692a5fe64b70539f7ce0d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 00:35:19 +0000 Subject: [PATCH 41/46] Bump ch.qos.logback:logback-classic from 1.5.14 to 1.5.15 Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.14 to 1.5.15. - [Commits](https://github.com/qos-ch/logback/compare/v_1.5.14...v_1.5.15) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-classic dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ab373f17..b20d4372 100644 --- a/build.gradle +++ b/build.gradle @@ -50,7 +50,7 @@ allprojects { testImplementation 'org.junit.jupiter:junit-jupiter-api' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' - testImplementation 'ch.qos.logback:logback-classic:1.5.14' + testImplementation 'ch.qos.logback:logback-classic:1.5.15' } tasks.withType(Test).configureEach { From 621fcd5b9493c5ed61108f1eab2eab42901a5298 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 00:45:07 +0000 Subject: [PATCH 42/46] Bump codecov/codecov-action from 5.1.1 to 5.1.2 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.1.1 to 5.1.2. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v5.1.1...v5.1.2) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index f2c0e079..af955bc0 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -46,7 +46,7 @@ jobs: - run: ./gradlew jacocoTestReport - name: Upload coverage report - uses: codecov/codecov-action@v5.1.1 + uses: codecov/codecov-action@v5.1.2 with: files: jacoco*.xml,*Jacoco*.xml From f69ee76a120c00d5429a7e412ea7b52623e6238e Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Sun, 5 Jan 2025 23:54:40 +0100 Subject: [PATCH 43/46] Fix Gradle Deprecation Warnings --- build.gradle | 10 +++++----- sass-embedded-host/build.gradle | 19 ++++--------------- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/build.gradle b/build.gradle index ab373f17..088ff5ee 100644 --- a/build.gradle +++ b/build.gradle @@ -56,11 +56,11 @@ allprojects { tasks.withType(Test).configureEach { useJUnitPlatform() testLogging { - exceptionFormat "full" - showExceptions true - showCauses true - showStackTraces true - showStandardStreams System.getenv("CI") == "true" + exceptionFormat = "full" + showExceptions = true + showCauses = true + showStackTraces = true + showStandardStreams = System.getenv("CI") == "true" } } diff --git a/sass-embedded-host/build.gradle b/sass-embedded-host/build.gradle index db9c128c..bc203d6e 100644 --- a/sass-embedded-host/build.gradle +++ b/sass-embedded-host/build.gradle @@ -2,6 +2,7 @@ plugins { id "java-library" id "io.freefair.maven-publish-java" id "io.freefair.lombok" + id "io.freefair.maven-optional" id "jacoco" } @@ -11,18 +12,6 @@ java.toolchain.languageVersion = JavaLanguageVersion.of(11) compileJava.options.release.set(8) -java { - registerFeature('webjarsSupport') { - usingSourceSet(sourceSets.main) - } - registerFeature('springSupport') { - usingSourceSet(sourceSets.main) - } - registerFeature('springWebmvcSupport') { - usingSourceSet(sourceSets.main) - } -} - dependencies { api project(":sass-embedded-protocol") api project(":sass-embedded-bundled") @@ -34,11 +23,11 @@ dependencies { compileOnly 'javax.servlet:javax.servlet-api:4.0.1' compileOnly 'jakarta.servlet:jakarta.servlet-api:6.0.0' compileOnly 'org.apache.logging.log4j:log4j-api:2.24.3' - webjarsSupportImplementation "org.webjars:webjars-locator-core:0.59" + optional "org.webjars:webjars-locator-core:0.59" compileOnly "org.jboss:jboss-vfs:3.3.2.Final" - springSupportApi "org.springframework:spring-core:$spring5Verison" - springWebmvcSupportApi "org.springframework:spring-webmvc:$spring5Verison" + optional "org.springframework:spring-core:$spring5Verison" + optional "org.springframework:spring-webmvc:$spring5Verison" testCompileOnly 'org.jetbrains:annotations:26.0.1' From 0523701912f49d0d61ea592e5999cd103efec22d Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Sun, 5 Jan 2025 23:59:24 +0100 Subject: [PATCH 44/46] Update to dart-sass 1.83.1 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index f7575ac1..73fff3f1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -dartSassVersion=1.82.0 +dartSassVersion=1.83.1 embeddedProtocolVersion=3.1.0 spring5Verison=5.3.39 From 76a4e01547ee17f6d1215af1d7db5fcde8a38142 Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Mon, 6 Jan 2025 00:03:30 +0100 Subject: [PATCH 45/46] Fix windows unzip --- .../main/java/de/larsgrefer/sass/embedded/util/IOUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/IOUtils.java b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/IOUtils.java index 0cd5884b..e911cb99 100644 --- a/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/IOUtils.java +++ b/sass-embedded-host/src/main/java/de/larsgrefer/sass/embedded/util/IOUtils.java @@ -11,8 +11,8 @@ import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.StandardCopyOption; import java.util.concurrent.TimeUnit; -import java.util.stream.Stream; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; @@ -50,7 +50,7 @@ void unzip(ZipInputStream zipInputStream, Path targetPath) throws IOException { } else { ensureDirectory(entryFile.getParentFile()); - Files.copy(zipInputStream, entryPath); + Files.copy(zipInputStream, entryPath, StandardCopyOption.REPLACE_EXISTING); } zipInputStream.closeEntry(); From db368bcebb0fc09555867ce075997d80f9629238 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 00:43:24 +0000 Subject: [PATCH 46/46] Bump ch.qos.logback:logback-classic from 1.5.15 to 1.5.16 Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.15 to 1.5.16. - [Commits](https://github.com/qos-ch/logback/compare/v_1.5.15...v_1.5.16) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-classic dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index b20d4372..47f10238 100644 --- a/build.gradle +++ b/build.gradle @@ -50,7 +50,7 @@ allprojects { testImplementation 'org.junit.jupiter:junit-jupiter-api' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' - testImplementation 'ch.qos.logback:logback-classic:1.5.15' + testImplementation 'ch.qos.logback:logback-classic:1.5.16' } tasks.withType(Test).configureEach {