From ade2a9179fe1b3647784a76835b747e902325f38 Mon Sep 17 00:00:00 2001 From: Carlos Amengual Date: Wed, 31 Jul 2024 14:15:04 +0200 Subject: [PATCH] Remove xmlgraphics-commons Closes #99. --- README.md | 2 +- .../main/groovy/echosvg.java-conventions.gradle | 5 +++-- echosvg-all/build.gradle | 6 ------ echosvg-awt-util/build.gradle | 8 +------- .../echosvg/ext/awt/LinearGradientPaint.java | 3 +++ .../echosvg/ext/awt/color/NamedProfileCache.java | 3 +-- .../ext/awt/image/renderable/ProfileRable.java | 3 +-- .../ext/awt/image/rendered/ProfileRed.java | 2 +- .../ext/awt/image/spi/ImageTagRegistry.java | 3 +-- echosvg-awt-util/src/main/java/module-info.java | 6 +++--- echosvg-bridge/build.gradle | 8 +------- .../io/sf/carte/echosvg/bridge/PaintServer.java | 16 ++++++++-------- .../bridge/SVGColorProfileElementBridge.java | 4 ++-- .../echosvg/bridge/SVGImageElementBridge.java | 4 ++-- echosvg-bridge/src/main/java/module-info.java | 2 +- echosvg-dom/build.gradle | 7 ------- echosvg-parser/build.gradle | 7 ------- echosvg-test/build.gradle | 1 + gradle.properties | 4 ++-- settings.gradle | 1 - 20 files changed, 32 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index 914ee489c..772f16bf4 100644 --- a/README.md +++ b/README.md @@ -235,9 +235,9 @@ repositories { releasesOnly() } content { - includeGroup 'com.github.css4j' includeGroup 'io.sf.carte' includeGroup 'io.sf.jclf' + includeGroup 'io.sf.graphics' } } } diff --git a/buildSrc/src/main/groovy/echosvg.java-conventions.gradle b/buildSrc/src/main/groovy/echosvg.java-conventions.gradle index 8e13244be..c9d6c2484 100644 --- a/buildSrc/src/main/groovy/echosvg.java-conventions.gradle +++ b/buildSrc/src/main/groovy/echosvg.java-conventions.gradle @@ -16,8 +16,9 @@ repositories { releasesOnly() } content { - includeGroup "io.sf.carte" - includeGroup "io.sf.jclf" + includeGroup 'io.sf.carte' + includeGroup 'io.sf.graphics' + includeGroup 'io.sf.jclf' } } } diff --git a/echosvg-all/build.gradle b/echosvg-all/build.gradle index df0b54548..c4ece93c5 100644 --- a/echosvg-all/build.gradle +++ b/echosvg-all/build.gradle @@ -1,5 +1,4 @@ plugins { - id 'org.gradlex.extra-java-module-info' id 'org.ajoberstar.grgit' id 'echosvg.java-conventions' } @@ -18,11 +17,6 @@ dependencies { api project(':echosvg-svgrasterizer') } -extraJavaModuleInfo { - failOnMissingModuleInfo.set(false) - automaticModule('org.apache.xmlgraphics:xmlgraphics-commons', 'org.apache.xmlgraphics.commons') -} - publishing.publications.maven(MavenPublication).pom { description = "EchoSVG aggregate artifact" } diff --git a/echosvg-awt-util/build.gradle b/echosvg-awt-util/build.gradle index 820a7746c..f8b96614c 100644 --- a/echosvg-awt-util/build.gradle +++ b/echosvg-awt-util/build.gradle @@ -1,17 +1,11 @@ plugins { id 'echosvg.java-conventions' - id 'org.gradlex.extra-java-module-info' } dependencies { api project(':echosvg-util') + api "io.sf.graphics:legacy-colors:${legacyColorsVersion}" implementation project(':echosvg-i18n') - api "org.apache.xmlgraphics:xmlgraphics-commons:${xmlgraphicsCommonsVersion}" -} - -extraJavaModuleInfo { - failOnMissingModuleInfo.set(false) - automaticModule('org.apache.xmlgraphics:xmlgraphics-commons', 'org.apache.xmlgraphics.commons') } description = 'io.sf.carte:echosvg-awt-util' diff --git a/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/LinearGradientPaint.java b/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/LinearGradientPaint.java index 0091f5095..a4da5db07 100644 --- a/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/LinearGradientPaint.java +++ b/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/LinearGradientPaint.java @@ -28,6 +28,9 @@ import java.awt.geom.Rectangle2D; import java.awt.image.ColorModel; +import io.sf.carte.echosvg.ext.awt.MultipleGradientPaint.ColorSpaceEnum; +import io.sf.carte.echosvg.ext.awt.MultipleGradientPaint.CycleMethodEnum; + /** * The LinearGradientPaint class provides a way to fill a * {@link java.awt.Shape} with a linear color gradient pattern. The user may diff --git a/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/color/NamedProfileCache.java b/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/color/NamedProfileCache.java index bd092e9d7..aad84b2f4 100644 --- a/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/color/NamedProfileCache.java +++ b/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/color/NamedProfileCache.java @@ -19,9 +19,8 @@ package io.sf.carte.echosvg.ext.awt.color; -import org.apache.xmlgraphics.java2d.color.ICCColorSpaceWithIntent; - import io.sf.carte.echosvg.util.SoftReferenceCache; +import io.sf.graphics.java2d.color.ICCColorSpaceWithIntent; /** * This class manages a cache of soft references to named profiles that we have diff --git a/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/image/renderable/ProfileRable.java b/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/image/renderable/ProfileRable.java index 8054f9689..f2fbb4fb0 100644 --- a/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/image/renderable/ProfileRable.java +++ b/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/image/renderable/ProfileRable.java @@ -21,11 +21,10 @@ import java.awt.image.RenderedImage; import java.awt.image.renderable.RenderContext; -import org.apache.xmlgraphics.java2d.color.ICCColorSpaceWithIntent; - import io.sf.carte.echosvg.ext.awt.image.GraphicsUtil; import io.sf.carte.echosvg.ext.awt.image.rendered.CachableRed; import io.sf.carte.echosvg.ext.awt.image.rendered.ProfileRed; +import io.sf.graphics.java2d.color.ICCColorSpaceWithIntent; /** * Implements the interface expected from a color matrix operation diff --git a/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/image/rendered/ProfileRed.java b/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/image/rendered/ProfileRed.java index fa0a31b13..a214a5117 100644 --- a/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/image/rendered/ProfileRed.java +++ b/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/image/rendered/ProfileRed.java @@ -35,7 +35,7 @@ import java.awt.image.RenderedImage; import java.awt.image.WritableRaster; -import org.apache.xmlgraphics.java2d.color.ICCColorSpaceWithIntent; +import io.sf.graphics.java2d.color.ICCColorSpaceWithIntent; /** * This implementation of rendered image forces a color profile on its source diff --git a/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/image/spi/ImageTagRegistry.java b/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/image/spi/ImageTagRegistry.java index dbc0add31..b9004be94 100644 --- a/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/image/spi/ImageTagRegistry.java +++ b/echosvg-awt-util/src/main/java/io/sf/carte/echosvg/ext/awt/image/spi/ImageTagRegistry.java @@ -29,12 +29,11 @@ import java.util.ListIterator; import java.util.ServiceLoader; -import org.apache.xmlgraphics.java2d.color.ICCColorSpaceWithIntent; - import io.sf.carte.echosvg.ext.awt.image.URLImageCache; import io.sf.carte.echosvg.ext.awt.image.renderable.Filter; import io.sf.carte.echosvg.ext.awt.image.renderable.ProfileRable; import io.sf.carte.echosvg.util.ParsedURL; +import io.sf.graphics.java2d.color.ICCColorSpaceWithIntent; /** * This class handles the registered Image tag handlers. These are instances of diff --git a/echosvg-awt-util/src/main/java/module-info.java b/echosvg-awt-util/src/main/java/module-info.java index 21cc2c9b7..3e35e5480 100644 --- a/echosvg-awt-util/src/main/java/module-info.java +++ b/echosvg-awt-util/src/main/java/module-info.java @@ -37,9 +37,9 @@ requires transitive io.sf.carte.echosvg.util; requires io.sf.carte.echosvg.i18n; - // org.apache.xmlgraphics.commons should be a transitive dependency due to - // ICCColorSpaceWithIntent from commons being used in this module's API. - requires org.apache.xmlgraphics.commons; + // It is a transitive dependency due to + // ICCColorSpaceWithIntent being used in this module's API. + requires transitive io.sf.graphics.legacy.colors; requires java.desktop; diff --git a/echosvg-bridge/build.gradle b/echosvg-bridge/build.gradle index 670826b2b..d1c329ba0 100644 --- a/echosvg-bridge/build.gradle +++ b/echosvg-bridge/build.gradle @@ -1,19 +1,13 @@ plugins { id 'echosvg.java-conventions' - id 'org.gradlex.extra-java-module-info' } dependencies { api project(':echosvg-anim') api project(':echosvg-gvt') api project(':echosvg-script') + api "io.sf.graphics:legacy-colors:${legacyColorsVersion}" implementation "xml-apis:xml-apis:$xmlApisVersion" - api "org.apache.xmlgraphics:xmlgraphics-commons:${xmlgraphicsCommonsVersion}" -} - -extraJavaModuleInfo { - failOnMissingModuleInfo.set(false) - automaticModule('org.apache.xmlgraphics:xmlgraphics-commons', 'org.apache.xmlgraphics.commons') } description = 'io.sf.carte:echosvg-bridge' diff --git a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/PaintServer.java b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/PaintServer.java index 84bafa82f..7e6470540 100644 --- a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/PaintServer.java +++ b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/PaintServer.java @@ -26,14 +26,14 @@ import java.awt.color.ICC_Profile; import java.io.IOException; -import org.apache.xmlgraphics.java2d.color.CIELabColorSpace; -import org.apache.xmlgraphics.java2d.color.ColorSpaces; -import org.apache.xmlgraphics.java2d.color.ColorWithAlternatives; -import org.apache.xmlgraphics.java2d.color.DeviceCMYKColorSpace; -import org.apache.xmlgraphics.java2d.color.ICCColorSpaceWithIntent; -import org.apache.xmlgraphics.java2d.color.NamedColorSpace; -import org.apache.xmlgraphics.java2d.color.profile.NamedColorProfile; -import org.apache.xmlgraphics.java2d.color.profile.NamedColorProfileParser; +import io.sf.graphics.java2d.color.CIELabColorSpace; +import io.sf.graphics.java2d.color.ColorSpaces; +import io.sf.graphics.java2d.color.ColorWithAlternatives; +import io.sf.graphics.java2d.color.DeviceCMYKColorSpace; +import io.sf.graphics.java2d.color.ICCColorSpaceWithIntent; +import io.sf.graphics.java2d.color.NamedColorSpace; +import io.sf.graphics.java2d.color.profile.NamedColorProfile; +import io.sf.graphics.java2d.color.profile.NamedColorProfileParser; import org.w3c.dom.Element; import org.w3c.dom.css.CSSPrimitiveValue; import org.w3c.dom.css.CSSValue; diff --git a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGColorProfileElementBridge.java b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGColorProfileElementBridge.java index d2bb37a91..23a22bfd8 100644 --- a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGColorProfileElementBridge.java +++ b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGColorProfileElementBridge.java @@ -21,8 +21,8 @@ import java.awt.color.ICC_Profile; import java.io.IOException; -import org.apache.xmlgraphics.java2d.color.ICCColorSpaceWithIntent; -import org.apache.xmlgraphics.java2d.color.RenderingIntent; +import io.sf.graphics.java2d.color.ICCColorSpaceWithIntent; +import io.sf.graphics.java2d.color.RenderingIntent; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; diff --git a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGImageElementBridge.java b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGImageElementBridge.java index df2fd099a..0614ad29e 100644 --- a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGImageElementBridge.java +++ b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGImageElementBridge.java @@ -31,8 +31,8 @@ import java.util.ArrayList; import java.util.List; -import org.apache.xmlgraphics.java2d.color.ICCColorSpaceWithIntent; -import org.apache.xmlgraphics.java2d.color.RenderingIntent; +import io.sf.graphics.java2d.color.ICCColorSpaceWithIntent; +import io.sf.graphics.java2d.color.RenderingIntent; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.events.DocumentEvent; diff --git a/echosvg-bridge/src/main/java/module-info.java b/echosvg-bridge/src/main/java/module-info.java index 0c3b5a64c..9e6b59a7c 100644 --- a/echosvg-bridge/src/main/java/module-info.java +++ b/echosvg-bridge/src/main/java/module-info.java @@ -35,7 +35,7 @@ requires io.sf.carte.echosvg.parser; requires io.sf.carte.echosvg.xml; - requires org.apache.xmlgraphics.commons; + requires io.sf.graphics.legacy.colors; provides io.sf.carte.echosvg.script.InterpreterFactory with io.sf.carte.echosvg.bridge.RhinoInterpreterFactory; diff --git a/echosvg-dom/build.gradle b/echosvg-dom/build.gradle index 3ddc9f843..9f4351ad0 100644 --- a/echosvg-dom/build.gradle +++ b/echosvg-dom/build.gradle @@ -1,6 +1,5 @@ plugins { id 'echosvg.java-conventions' - id 'org.gradlex.extra-java-module-info' } dependencies { @@ -10,12 +9,6 @@ dependencies { implementation project(':echosvg-i18n') implementation "xml-apis:xml-apis:$xmlApisVersion" api "io.sf.carte:xml-dtd:${xmlDtdVersion}" - api "org.apache.xmlgraphics:xmlgraphics-commons:${xmlgraphicsCommonsVersion}" -} - -extraJavaModuleInfo { - failOnMissingModuleInfo.set(false) - automaticModule('org.apache.xmlgraphics:xmlgraphics-commons', 'org.apache.xmlgraphics.commons') } description = 'io.sf.carte:echosvg-dom' diff --git a/echosvg-parser/build.gradle b/echosvg-parser/build.gradle index 80e8f5efc..8061c42c8 100644 --- a/echosvg-parser/build.gradle +++ b/echosvg-parser/build.gradle @@ -1,6 +1,5 @@ plugins { id 'echosvg.java-conventions' - id 'org.gradlex.extra-java-module-info' } dependencies { @@ -8,12 +7,6 @@ dependencies { api project(':echosvg-xml') api project(':echosvg-i18n') api "io.sf.carte:svgom-api:${svgomVersion}" - api "org.apache.xmlgraphics:xmlgraphics-commons:${xmlgraphicsCommonsVersion}" -} - -extraJavaModuleInfo { - failOnMissingModuleInfo.set(false) - automaticModule('org.apache.xmlgraphics:xmlgraphics-commons', 'org.apache.xmlgraphics.commons') } description = 'io.sf.carte:echosvg-parser' diff --git a/echosvg-test/build.gradle b/echosvg-test/build.gradle index 05a0456be..f946d0001 100644 --- a/echosvg-test/build.gradle +++ b/echosvg-test/build.gradle @@ -40,6 +40,7 @@ dependencies { testRuntimeOnly 'org.junit.platform:junit-platform-launcher' testImplementation "org.mozilla:rhino:${rhinoVersion}" testImplementation "nu.validator:htmlparser:${htmlParserVersion}" + testImplementation "commons-io:commons-io:${commonsIOVersion}" if (!project.getPluginManager().hasPlugin('eclipse')) { testImplementation ("xml-apis:xml-apis:$xmlApisVersion") } diff --git a/gradle.properties b/gradle.properties index e1f854639..f0a6223f9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,14 +1,14 @@ # Dependency versions -extraJavaModuleInfoVersion=1.8 checkstyleVersion=10.17.0 grGitVersion=5.2.2 css4jVersion=4.2.2 css4jAwtVersion=4.0 xmlDtdVersion=4.3 rhinoVersion=1.7.15 +legacyColorsVersion=1.0 svgomVersion=1.0.1 xmlApisVersion=1.4.01 -xmlgraphicsCommonsVersion=[2.9,) +commonsIOVersion=2.16.1 htmlParserVersion=1.4.16 jclfTextVersion=5.0.1 junitVersion=5.10.3 diff --git a/settings.gradle b/settings.gradle index a4fa89bf8..9e9f09a59 100644 --- a/settings.gradle +++ b/settings.gradle @@ -3,7 +3,6 @@ pluginManagement { /* * plugin versions are declared at gradle.properties file */ - id 'org.gradlex.extra-java-module-info' version "${extraJavaModuleInfoVersion}" id 'org.ajoberstar.grgit' version "${grGitVersion}" } }