Skip to content

Commit

Permalink
Gradle: use implementation instead of api in several places
Browse files Browse the repository at this point in the history
Using `implementation` is generally a bad idea, however there are specific places where it
could be convenient to have (like when importing i18n).

Some module-info files were reformatted but otherwise not modified.
  • Loading branch information
carlosame committed Jul 12, 2024
1 parent a0b9e42 commit e83ac4b
Show file tree
Hide file tree
Showing 40 changed files with 102 additions and 58 deletions.
5 changes: 3 additions & 2 deletions echosvg-all/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@
* Aggregate module.
*/
module io.sf.carte.echosvg {
requires transitive io.sf.carte.echosvg.apps.slideshow;
requires transitive io.sf.carte.echosvg.anim;
requires transitive io.sf.carte.echosvg.awt;
requires transitive io.sf.carte.echosvg.bridge;
requires transitive io.sf.carte.echosvg.constants;
requires transitive io.sf.carte.echosvg.css;
requires transitive io.sf.carte.echosvg.dom;
requires transitive io.sf.carte.echosvg.dom.svg;
requires transitive io.sf.carte.echosvg.external;
requires transitive io.sf.carte.echosvg.extension;
requires transitive io.sf.carte.echosvg.external;
requires transitive io.sf.carte.echosvg.gvt;
requires transitive io.sf.carte.echosvg.i18n;
requires transitive io.sf.carte.echosvg.parser;
Expand All @@ -40,6 +41,6 @@
requires transitive io.sf.carte.echosvg.util;
requires transitive io.sf.carte.echosvg.util.gui;
requires transitive io.sf.carte.echosvg.xml;
requires transitive io.sf.carte.echosvg.apps.slideshow;

requires transitive org.w3c.dom.svg;
}
6 changes: 4 additions & 2 deletions echosvg-anim/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
exports io.sf.carte.echosvg.anim.timing;

requires transitive io.sf.carte.echosvg.awt;
requires transitive io.sf.carte.echosvg.dom.svg;
requires io.sf.carte.echosvg.constants;
requires io.sf.carte.echosvg.external;
requires io.sf.carte.echosvg.i18n;
requires io.sf.carte.echosvg.constants;
requires transitive io.sf.carte.echosvg.dom.svg;

requires io.sf.carte.css4j;

requires java.xml;
requires jdk.xml.dom;
}
1 change: 1 addition & 0 deletions echosvg-awt-util/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {

dependencies {
api project(':echosvg-util')
implementation project(':echosvg-i18n')
api "org.apache.xmlgraphics:xmlgraphics-commons:${xmlgraphicsCommonsVersion}"
}

Expand Down
4 changes: 3 additions & 1 deletion echosvg-awt-util/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
exports io.sf.carte.echosvg.ext.awt.g2d;

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;
requires io.sf.carte.echosvg.i18n;

requires java.desktop;

uses io.sf.carte.echosvg.ext.awt.image.spi.ImageWriter;
Expand Down
2 changes: 1 addition & 1 deletion echosvg-bridge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ plugins {
}

dependencies {
api project(':echosvg-anim')
api project(':echosvg-gvt')
api project(':echosvg-script')
api project(':echosvg-svg-dom')
implementation "xml-apis:xml-apis:$xmlApisVersion"
api "org.apache.xmlgraphics:xmlgraphics-commons:${xmlgraphicsCommonsVersion}"
}
Expand Down
7 changes: 4 additions & 3 deletions echosvg-bridge/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@
exports io.sf.carte.echosvg.bridge;
exports io.sf.carte.echosvg.bridge.svg12;

requires transitive io.sf.carte.echosvg.anim;
requires transitive io.sf.carte.echosvg.external;
requires transitive io.sf.carte.echosvg.gvt;
requires transitive io.sf.carte.echosvg.script;
requires transitive io.sf.carte.echosvg.anim;
requires io.sf.carte.echosvg.parser;
requires io.sf.carte.echosvg.xml;
requires io.sf.carte.echosvg.constants;
requires io.sf.carte.echosvg.i18n;
requires io.sf.carte.echosvg.parser;
requires io.sf.carte.echosvg.xml;

requires org.apache.xmlgraphics.commons;

provides io.sf.carte.echosvg.script.InterpreterFactory
Expand Down
1 change: 1 addition & 0 deletions echosvg-codec/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {

dependencies {
api project(':echosvg-awt-util')
implementation project(':echosvg-i18n')
}

description = 'io.sf.carte:echosvg-codec'
Expand Down
2 changes: 1 addition & 1 deletion echosvg-constants/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
* Constants library.
*/
module io.sf.carte.echosvg.constants {
exports io.sf.carte.echosvg.constants;
exports io.sf.carte.echosvg.constants;
}
1 change: 1 addition & 0 deletions echosvg-css/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {

dependencies {
api project(':echosvg-util')
implementation project(':echosvg-i18n')
api "io.sf.carte:svgom-api:${svgomVersion}"
api "io.sf.carte:css4j:${css4jVersion}"
testImplementation "org.junit.jupiter:junit-jupiter:${junitVersion}"
Expand Down
4 changes: 3 additions & 1 deletion echosvg-css/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@

requires transitive io.sf.carte.echosvg.util;
requires io.sf.carte.echosvg.i18n;

requires transitive io.sf.carte.css4j;
requires io.sf.carte.util;
requires transitive org.w3c.dom.svg;

requires java.xml;
requires jdk.xml.dom;
requires transitive org.w3c.dom.svg;
}
1 change: 1 addition & 0 deletions echosvg-dom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies {
api project(':echosvg-css')
api project(':echosvg-ext')
api project(':echosvg-xml')
implementation project(':echosvg-i18n')
implementation "xml-apis:xml-apis:$xmlApisVersion"
api "io.sf.carte:xml-dtd:${xmlDtdVersion}"
api "org.apache.xmlgraphics:xmlgraphics-commons:${xmlgraphicsCommonsVersion}"
Expand Down
8 changes: 5 additions & 3 deletions echosvg-dom/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@
exports io.sf.carte.echosvg.dom.xbl;
exports io.sf.carte.echosvg.dom.events;

requires io.sf.carte.echosvg.constants;
requires transitive io.sf.carte.echosvg.css;
requires io.sf.carte.echosvg.constants;
requires io.sf.carte.echosvg.external;
requires io.sf.carte.echosvg.xml;
requires io.sf.carte.echosvg.i18n;
requires io.sf.carte.echosvg.xml;

requires io.sf.carte.xml.dtd;

requires transitive java.xml;
requires transitive jdk.xml.dom;
requires io.sf.carte.xml.dtd;

uses org.xml.sax.XMLReader;
uses io.sf.carte.echosvg.dom.DomExtension;
Expand Down
8 changes: 5 additions & 3 deletions echosvg-ext/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
* Interfaces to be used by external code.
*/
module io.sf.carte.echosvg.external {
exports io.sf.carte.echosvg.w3c.dom;
exports io.sf.carte.echosvg.w3c.dom.events;

requires transitive java.xml;
exports io.sf.carte.echosvg.w3c.dom;
exports io.sf.carte.echosvg.w3c.dom.events;

requires transitive java.xml;

}
3 changes: 2 additions & 1 deletion echosvg-extension/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
requires transitive io.sf.carte.echosvg.bridge;
requires io.sf.carte.echosvg.constants;

requires jdk.xml.dom;
requires transitive org.w3c.dom.svg;

requires jdk.xml.dom;

provides io.sf.carte.echosvg.bridge.BridgeExtension
with io.sf.carte.echosvg.extension.svg.EchoSVGBridgeExtension;

Expand Down
3 changes: 2 additions & 1 deletion echosvg-gui-util/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ plugins {
}

dependencies {
api project(':echosvg-xml')
api project(':echosvg-util')
implementation project(':echosvg-xml')
}

description = 'io.sf.carte:echosvg-gui-util'
Expand Down
15 changes: 9 additions & 6 deletions echosvg-gui-util/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@
* GUI utilities.
*/
module io.sf.carte.echosvg.util.gui {
exports io.sf.carte.echosvg.util.gui.resource;
exports io.sf.carte.echosvg.util.gui.xmleditor;
exports io.sf.carte.echosvg.util.gui;

requires io.sf.carte.echosvg.util;
requires io.sf.carte.echosvg.xml;
requires transitive java.desktop;
exports io.sf.carte.echosvg.util.gui.resource;
exports io.sf.carte.echosvg.util.gui.xmleditor;
exports io.sf.carte.echosvg.util.gui;

requires io.sf.carte.echosvg.util;
requires io.sf.carte.echosvg.xml;

requires transitive java.desktop;

}
20 changes: 11 additions & 9 deletions echosvg-gvt/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@
* Graphics Vector Tree (GVT).
*/
module io.sf.carte.echosvg.gvt {
exports io.sf.carte.echosvg.gvt.font;
exports io.sf.carte.echosvg.gvt.flow;
exports io.sf.carte.echosvg.gvt.event;
exports io.sf.carte.echosvg.gvt;
exports io.sf.carte.echosvg.gvt.renderer;
exports io.sf.carte.echosvg.gvt.text;
exports io.sf.carte.echosvg.gvt.filter;

requires transitive io.sf.carte.echosvg.awt;
requires transitive io.sf.carte.echosvg.util;
exports io.sf.carte.echosvg.gvt.font;
exports io.sf.carte.echosvg.gvt.flow;
exports io.sf.carte.echosvg.gvt.event;
exports io.sf.carte.echosvg.gvt;
exports io.sf.carte.echosvg.gvt.renderer;
exports io.sf.carte.echosvg.gvt.text;
exports io.sf.carte.echosvg.gvt.filter;

requires transitive io.sf.carte.echosvg.awt;
requires transitive io.sf.carte.echosvg.util;

}
4 changes: 3 additions & 1 deletion echosvg-i18n/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@
* i18n library.
*/
module io.sf.carte.echosvg.i18n {
exports io.sf.carte.echosvg.i18n;

exports io.sf.carte.echosvg.i18n;

}
1 change: 1 addition & 0 deletions echosvg-parser/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {
dependencies {
api project(':echosvg-awt-util')
api project(':echosvg-xml')
api project(':echosvg-i18n')
api "io.sf.carte:svgom-api:${svgomVersion}"
api "org.apache.xmlgraphics:xmlgraphics-commons:${xmlgraphicsCommonsVersion}"
}
Expand Down
4 changes: 3 additions & 1 deletion echosvg-parser/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
exports io.sf.carte.echosvg.parser;

requires io.sf.carte.echosvg.awt;
requires io.sf.carte.echosvg.xml;
requires io.sf.carte.echosvg.i18n;
requires io.sf.carte.echosvg.xml;

requires transitive org.w3c.dom.svg;

requires transitive java.desktop;
}
2 changes: 1 addition & 1 deletion echosvg-script/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

dependencies {
api project(':echosvg-anim')
implementation project(':echosvg-anim')
api "org.mozilla:rhino:${rhinoVersion}"
implementation "xml-apis:xml-apis:$xmlApisVersion"
}
Expand Down
4 changes: 3 additions & 1 deletion echosvg-script/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@

requires io.sf.carte.echosvg.anim;
requires io.sf.carte.echosvg.i18n;
requires transitive java.xml;

requires transitive org.mozilla.rhino;

requires transitive java.xml;

uses io.sf.carte.echosvg.script.InterpreterFactory;
}
1 change: 1 addition & 0 deletions echosvg-slideshow/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@

requires transitive io.sf.carte.echosvg.bridge;
requires io.sf.carte.echosvg.gvt;

requires transitive org.w3c.dom.svg;
}
4 changes: 2 additions & 2 deletions echosvg-svg-dom/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
exports io.sf.carte.echosvg.dom.svg12;
exports io.sf.carte.echosvg.dom.svg;

requires io.sf.carte.echosvg.awt;
requires transitive io.sf.carte.echosvg.css;
requires transitive io.sf.carte.echosvg.parser;
requires transitive io.sf.carte.echosvg.dom;
requires transitive io.sf.carte.echosvg.parser;
requires io.sf.carte.echosvg.awt;
}
1 change: 1 addition & 0 deletions echosvg-svggen/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {

dependencies {
api project(':echosvg-awt-util')
implementation project(':echosvg-i18n')
runtimeOnly project(':echosvg-codec')
}

Expand Down
1 change: 1 addition & 0 deletions echosvg-svggen/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
requires transitive io.sf.carte.echosvg.awt;
requires io.sf.carte.echosvg.constants;
requires io.sf.carte.echosvg.i18n;

requires java.xml;
}
2 changes: 1 addition & 1 deletion echosvg-svgpp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

dependencies {
api project(':echosvg-transcoder')
implementation project(':echosvg-transcoder')
}

description = 'io.sf.carte:echosvg-svgpp'
Expand Down
11 changes: 7 additions & 4 deletions echosvg-svgpp/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
* SVG Pretty Printer Application.
*/
module io.sf.carte.echosvg.svgpp {
exports io.sf.carte.echosvg.apps.svgpp;

requires io.sf.carte.echosvg.i18n;
requires io.sf.carte.echosvg.transcoder;
requires java.xml;
exports io.sf.carte.echosvg.apps.svgpp;

requires io.sf.carte.echosvg.i18n;
requires io.sf.carte.echosvg.transcoder;

requires java.xml;

}
2 changes: 0 additions & 2 deletions echosvg-svgrasterizer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ sourceSets {
}

dependencies {
api project(':echosvg-parser')
api project(':echosvg-transcoder')
api project(':echosvg-util')
testImplementation project(':echosvg-test')
testImplementation "org.junit.jupiter:junit-jupiter:${junitVersion}"
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
Expand Down
3 changes: 2 additions & 1 deletion echosvg-svgrasterizer/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
module io.sf.carte.echosvg.svgrasterizer {
exports io.sf.carte.echosvg.apps.rasterizer;

requires io.sf.carte.echosvg.i18n;
requires transitive io.sf.carte.echosvg.transcoder;
requires io.sf.carte.echosvg.i18n;

requires transitive java.desktop;
requires java.xml;
}
1 change: 0 additions & 1 deletion echosvg-swing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {

dependencies {
api project(':echosvg-bridge')
api project(':echosvg-ext')
api project(':echosvg-gui-util')
implementation "xml-apis:xml-apis:$xmlApisVersion"
}
Expand Down
5 changes: 3 additions & 2 deletions echosvg-swing/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@

requires transitive io.sf.carte.echosvg.bridge;
requires io.sf.carte.echosvg.constants;
requires io.sf.carte.echosvg.util.gui;
requires io.sf.carte.echosvg.gvt;
requires io.sf.carte.echosvg.dom.svg;
requires io.sf.carte.echosvg.gvt;
requires io.sf.carte.echosvg.i18n;
requires io.sf.carte.echosvg.util.gui;

requires java.datatransfer;
}
Loading

0 comments on commit e83ac4b

Please sign in to comment.