diff --git a/gradle.properties b/gradle.properties index 495b87b4..b4013c42 100644 --- a/gradle.properties +++ b/gradle.properties @@ -34,6 +34,7 @@ errorprone.version = 2.25.0 errorprone.compiler.version = 9+181-r4173-1 guava.version = 1.0 autoservice.version = 1.0.1 +biz.aQute.bnd.lib.version = 7.1.0 #Sonarcloud systemProp.sonar.host.url = https://sonarcloud.io diff --git a/jsvg/build.gradle.kts b/jsvg/build.gradle.kts index 93c5370c..83629a0f 100644 --- a/jsvg/build.gradle.kts +++ b/jsvg/build.gradle.kts @@ -5,6 +5,7 @@ plugins { `module-info-compile` id("me.champeau.jmh") jacoco + id("biz.aQute.bnd.builder") } dependencies { @@ -34,6 +35,41 @@ tasks { targetCompatibility = JavaVersion.VERSION_21.toString() } + jar { + bundle { + bnd( + """ + Bundle-SymbolicName: com.github.weisj.jsvg + -exportcontents: \ + com.github.weisj.jsvg,\ + com.github.weisj.jsvg.animation,\ + com.github.weisj.jsvg.attributes,\ + com.github.weisj.jsvg.attributes.font,\ + com.github.weisj.jsvg.attributes.paint,\ + com.github.weisj.jsvg.geometry.size,\ + com.github.weisj.jsvg.nodes,\ + com.github.weisj.jsvg.parser,\ + com.github.weisj.jsvg.parser.css,\ + com.github.weisj.jsvg.parser.resources,\ + com.github.weisj.jsvg.renderer,\ + com.github.weisj.jsvg.renderer.awt,\ + com.github.weisj.jsvg.ui,\ + + Import-Package: !com.google.errorprone.annotations,\ + * + + -jpms-module-info + -jpms-module-info-options: \ + com.google.errorprone.annotations;static="true";transitive="false",\ + org.jetbrains.annotations;static="true";transitive="false",\ + com.github.weisj.jsvg.annotations;static="true";transitive="false", + + -removeheaders: Private-Package,Tool + """, + ) + } + } + test { dependsOn(jar) doFirst { diff --git a/jsvg/src/main/module/module-info.java b/jsvg/src/main/module/module-info.java deleted file mode 100644 index 3e1e196e..00000000 --- a/jsvg/src/main/module/module-info.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2021 Jannis Weis - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ -module com.github.weisj.jsvg { - requires transitive java.desktop; - requires transitive java.logging; - - requires static org.jetbrains.annotations; - requires static com.google.errorprone.annotations; - requires static com.github.weisj.jsvg.annotations; - - exports com.github.weisj.jsvg; - exports com.github.weisj.jsvg.attributes; - exports com.github.weisj.jsvg.attributes.paint; - exports com.github.weisj.jsvg.geometry.size; - exports com.github.weisj.jsvg.nodes; - exports com.github.weisj.jsvg.parser; - exports com.github.weisj.jsvg.parser.css; - exports com.github.weisj.jsvg.parser.resources; - exports com.github.weisj.jsvg.ui; -} diff --git a/settings.gradle.kts b/settings.gradle.kts index 88909bf8..5a2ffd6f 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -18,6 +18,7 @@ pluginManagement { idv("net.ltgt.errorprone") idv("me.champeau.jmh") idv("org.sonarqube") + idv("biz.aQute.bnd.builder", "biz.aQute.bnd.lib") } }