Skip to content

Add OSGi Support #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 16 additions & 25 deletions batik-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<artifactId>batik-all</artifactId>
<name>${project.groupId}:${project.artifactId}</name>
<description>Batik aggregate artifact</description>
<packaging>pom</packaging>
<packaging>jar</packaging>

<parent>
<groupId>org.apache.xmlgraphics</groupId>
Expand Down Expand Up @@ -186,30 +186,21 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>package-all</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<addMavenDescriptor>false</addMavenDescriptor>
<appendAssemblyId>false</appendAssemblyId>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<mainClass>org.apache.batik.apps.svgbrowser.Main</mainClass>
</manifest>
</archive>
<descriptors>
<descriptor>src/tools/resources/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<bnd><![CDATA[
Export-Package: org.apache.batik.*

// May be renamed from 'extensions' to 'extension'
-privatepackage: \
org.apache.batik.extensions

Main-Class: org.apache.batik.apps.svgbrowser.Main

-includeresource: /META-INF/imports/script.txt=/${project.parent.basedir}/batik-script/src/main/resources/META-INF/imports/script.txt
]]></bnd>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
22 changes: 0 additions & 22 deletions batik-all/src/tools/resources/assembly/assembly.xml

This file was deleted.

29 changes: 7 additions & 22 deletions batik-anim/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@
<artifactId>batik-parser</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>batik-shared-resources</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>batik-svg-dom</artifactId>
Expand All @@ -85,23 +80,13 @@
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>${dependency.version}</version><!--$NO-MVN-MAN-VER$-->
<executions>
<execution>
<id>unpack-shared-resources</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>${project.groupId}</includeGroupIds>
<includeArtifactIds>batik-shared-resources</includeArtifactIds>
<includes>**/LICENSE,**/NOTICE</includes>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
</configuration>
</execution>
</executions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<bnd><![CDATA[
Export-Package: org.apache.batik.anim.*
]]></bnd>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
31 changes: 9 additions & 22 deletions batik-awt-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@
</parent>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>batik-shared-resources</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>batik-util</artifactId>
Expand All @@ -55,23 +50,15 @@
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>${dependency.version}</version><!--$NO-MVN-MAN-VER$-->
<executions>
<execution>
<id>unpack-shared-resources</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>${project.groupId}</includeGroupIds>
<includeArtifactIds>batik-shared-resources</includeArtifactIds>
<includes>**/LICENSE,**/NOTICE</includes>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
</configuration>
</execution>
</executions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<bnd><![CDATA[
Export-Package: \
org.apache.batik.ext.awt.*,\
org.apache.batik.ext.swing.*
]]></bnd>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,22 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import org.apache.batik.ext.awt.image.renderable.RedRable;
import org.apache.batik.util.ParsedURL;

import aQute.bnd.annotation.spi.ServiceProvider;

/**
* This Image tag registy entry is setup to wrap the core JDK
* Image stream tools.
*
* @version $Id$
*/
@ServiceProvider(value = RegistryEntry.class, attribute = {
"mimeTypes:List<String>='" + JDKRegistryEntry.MIMETYPE_IMAGE_GIF + "'",
"extensions:List<String>=''" })
public class JDKRegistryEntry extends AbstractRegistryEntry
implements URLRegistryEntry {

/**
protected static final String MIMETYPE_IMAGE_GIF = "image/gif";
/**
* The priority of this entry.
* This entry should in most cases be the last entry.
* but if one wishes one could set a priority higher and be called
Expand All @@ -54,7 +60,7 @@ public class JDKRegistryEntry extends AbstractRegistryEntry
1000*MagicNumberRegistryEntry.PRIORITY;

public JDKRegistryEntry() {
super ("JDK", PRIORITY, new String[0], new String [] {"image/gif"});
super ("JDK", PRIORITY, new String[0], new String [] {MIMETYPE_IMAGE_GIF});
}

/**
Expand Down
30 changes: 8 additions & 22 deletions batik-bridge/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@
<artifactId>batik-script</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>batik-shared-resources</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>batik-svg-dom</artifactId>
Expand Down Expand Up @@ -111,23 +106,14 @@
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>${dependency.version}</version><!--$NO-MVN-MAN-VER$-->
<executions>
<execution>
<id>unpack-shared-resources</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>${project.groupId}</includeGroupIds>
<includeArtifactIds>batik-shared-resources</includeArtifactIds>
<includes>**/LICENSE,**/NOTICE</includes>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
</configuration>
</execution>
</executions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<bnd><![CDATA[
Export-Package: \
org.apache.batik.bridge.*
]]></bnd>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,34 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import org.apache.batik.script.Interpreter;
import org.apache.batik.script.InterpreterFactory;

import aQute.bnd.annotation.spi.ServiceProvider;

/**
* Allows to create instances of <code>RhinoInterpreter</code> class.
*
* @author <a href="mailto:[email protected]">Christophe Jolif</a>
* @author <a href="mailto:[email protected]">Vincent Hardy</a>
* @version $Id$
*/
@ServiceProvider(value = InterpreterFactory.class, attribute = { "mimeTypes:List<String>='"
+ RhinoInterpreterFactory.MIMETYPE_TEXT_JAVASCRIPT + ","
+ RhinoInterpreterFactory.MIMETYPE_TEXT_ECMASCRIPT + ","
+ RhinoInterpreterFactory.MIMETYPE_APPLICATION_JAVASCRIPT + ","
+ RhinoInterpreterFactory.MIMETYPE_APPLICATION_ECMASCRIPT + "'" })
public class RhinoInterpreterFactory implements InterpreterFactory {

/**
protected static final String MIMETYPE_TEXT_JAVASCRIPT = "text/javascript";
protected static final String MIMETYPE_TEXT_ECMASCRIPT = "text/ecmascript";
protected static final String MIMETYPE_APPLICATION_JAVASCRIPT = "application/javascript";
protected static final String MIMETYPE_APPLICATION_ECMASCRIPT = "application/ecmascript";
/**
* The MIME types that Rhino can handle.
*/
public static final String[] RHINO_MIMETYPES = {
"application/ecmascript",
"application/javascript",
"text/ecmascript",
"text/javascript",
MIMETYPE_APPLICATION_ECMASCRIPT,
MIMETYPE_APPLICATION_JAVASCRIPT,
MIMETYPE_TEXT_ECMASCRIPT,
MIMETYPE_TEXT_JAVASCRIPT,
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import org.apache.batik.util.SVGConstants;
import org.w3c.dom.Element;

import aQute.bnd.annotation.spi.ServiceProvider;

/**
* This is a Service interface for classes that want to extend the
* functionality of the Bridge, to support new tags in the rendering tree.
*
* @author <a href="mailto:[email protected]">Thomas DeWeese</a>
* @version $Id$
*/
@ServiceProvider(value = BridgeExtension.class)
public class SVGBridgeExtension implements BridgeExtension {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,23 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.util.Iterator;

import org.apache.batik.bridge.BridgeContext;
import org.apache.batik.bridge.BridgeExtension;
import org.apache.batik.bridge.SVGBridgeExtension;
import org.apache.batik.util.SVGConstants;
import org.apache.batik.util.SVG12Constants;
import org.apache.batik.util.XBLConstants;
import org.w3c.dom.Element;

import aQute.bnd.annotation.spi.ServiceProvider;

/**
* This is a Service interface for classes that want to extend the
* functionality of the Bridge, to support new tags in the rendering tree.
*
* @author <a href="mailto:[email protected]">Thomas DeWeese</a>
* @version $Id$
*/
@ServiceProvider(value = BridgeExtension.class)
public class SVG12BridgeExtension extends SVGBridgeExtension {

/**
Expand Down

This file was deleted.

30 changes: 8 additions & 22 deletions batik-codec/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@
<artifactId>batik-bridge</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>batik-shared-resources</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>batik-transcoder</artifactId>
Expand All @@ -65,23 +60,14 @@
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>${dependency.version}</version><!--$NO-MVN-MAN-VER$-->
<executions>
<execution>
<id>unpack-shared-resources</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>${project.groupId}</includeGroupIds>
<includeArtifactIds>batik-shared-resources</includeArtifactIds>
<includes>**/LICENSE,**/NOTICE</includes>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
</configuration>
</execution>
</executions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<bnd><![CDATA[
Export-Package: \
org.apache.batik.awt.image.codec.*
]]></bnd>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Loading