You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ds...@apache.org on 2010/08/10 11:40:43 UTC
svn commit: r983901 - in /felix/trunk/sigil/common/core: ./ profiles/
src/org/apache/felix/sigil/common/bnd/
src/org/apache/felix/sigil/common/core/repository/
Author: dsavage
Date: Tue Aug 10 09:40:42 2010
New Revision: 983901
URL: http://svn.apache.org/viewvc?rev=983901&view=rev
Log:
update properties file form of jvm packages to use BldUtil.expand to reduce redundant information
Added:
felix/trunk/sigil/common/core/profiles/jvm-packages.properties
Removed:
felix/trunk/sigil/common/core/profiles/CDC-1.0_Foundation-1.0.profile
felix/trunk/sigil/common/core/profiles/CDC-1.1_Foundation-1.1.profile
felix/trunk/sigil/common/core/profiles/J2SE-1.2.profile
felix/trunk/sigil/common/core/profiles/J2SE-1.3.profile
felix/trunk/sigil/common/core/profiles/J2SE-1.4.profile
felix/trunk/sigil/common/core/profiles/J2SE-1.5.profile
felix/trunk/sigil/common/core/profiles/JavaSE-1.6.profile
felix/trunk/sigil/common/core/profiles/OSGi_Minimum-1.0.profile
felix/trunk/sigil/common/core/profiles/OSGi_Minimum-1.1.profile
felix/trunk/sigil/common/core/profiles/profile.list
Modified:
felix/trunk/sigil/common/core/sigil.properties
felix/trunk/sigil/common/core/src/org/apache/felix/sigil/common/bnd/BundleBuilder.java
felix/trunk/sigil/common/core/src/org/apache/felix/sigil/common/core/repository/SystemRepositoryProvider.java
Added: felix/trunk/sigil/common/core/profiles/jvm-packages.properties
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/common/core/profiles/jvm-packages.properties?rev=983901&view=auto
==============================================================================
--- felix/trunk/sigil/common/core/profiles/jvm-packages.properties (added)
+++ felix/trunk/sigil/common/core/profiles/jvm-packages.properties Tue Aug 10 09:40:42 2010
@@ -0,0 +1,182 @@
+# empty on purpose
+OSGI_MINIMUM-1.0.system:
+
+OSGI_MINIMUM-1.1.system: \
+ ${OSGI_MINIMUM-1.0.system}
+
+CDC-1.0_Foundation-1.0.system: \
+ javax.microedition.io
+
+CDC-1.1_Foundation-1.1.system: \
+ ${CDC-1.0_Foundation-1.0.system},\
+ javax.microedition.pki,\
+ javax.security.auth.x500
+
+J2SE-1.2.system: \
+ javax.accessibility,\
+ javax.swing,\
+ javax.swing.border,\
+ javax.swing.colorchooser,\
+ javax.swing.event,\
+ javax.swing.filechooser,\
+ javax.swing.plaf,\
+ javax.swing.plaf.basic,\
+ javax.swing.plaf.metal,\
+ javax.swing.plaf.multi,\
+ javax.swing.table,\
+ javax.swing.text,\
+ javax.swing.text.html,\
+ javax.swing.text.html.parser,\
+ javax.swing.text.rtf,\
+ javax.swing.tree,\
+ javax.swing.undo,\
+ org.omg.CORBA,\
+ org.omg.CORBA.DynAnyPackage,\
+ org.omg.CORBA.ORBPackage,\
+ org.omg.CORBA.portable,\
+ org.omg.CORBA.TypeCodePackage,\
+ org.omg.CosNaming,\
+ org.omg.CosNaming.NamingContextPackage
+
+J2SE-1.3.system: \
+ ${J2SE-1.2.system},\
+ javax.naming,\
+ javax.naming.directory,\
+ javax.naming.event,\
+ javax.naming.ldap,\
+ javax.naming.spi,\
+ javax.rmi,\
+ javax.rmi.CORBA,\
+ javax.sound.midi,\
+ javax.sound.midi.spi,\
+ javax.sound.sampled,\
+ javax.sound.sampled.spi,\
+ javax.transaction,\
+ org.omg.CORBA_2_3,\
+ org.omg.CORBA_2_3.portable,\
+ org.omg.SendingContext,\
+ org.omg.stub.java.rmi
+
+J2SE-1.4.system: \
+ ${J2SE-1.3.system}, \
+ javax.crypto,\
+ javax.crypto.interfaces,\
+ javax.crypto.spec,\
+ javax.imageio,\
+ javax.imageio.event,\
+ javax.imageio.metadata,\
+ javax.imageio.plugins.jpeg,\
+ javax.imageio.spi,\
+ javax.imageio.stream,\
+ javax.net,\
+ javax.net.ssl,\
+ javax.print,\
+ javax.print.attribute,\
+ javax.print.attribute.standard,\
+ javax.print.event,\
+ javax.security.auth,\
+ javax.security.auth.callback,\
+ javax.security.auth.kerberos,\
+ javax.security.auth.login,\
+ javax.security.auth.spi,\
+ javax.security.auth.x500,\
+ javax.security.cert,\
+ javax.sql,\
+ javax.transaction.xa,\
+ javax.xml.parsers,\
+ javax.xml.transform,\
+ javax.xml.transform.dom,\
+ javax.xml.transform.sax,\
+ javax.xml.transform.stream,\
+ org.ietf.jgss,\
+ org.omg.Dynamic,\
+ org.omg.DynamicAny,\
+ org.omg.DynamicAny.DynAnyFactoryPackage,\
+ org.omg.DynamicAny.DynAnyPackage,\
+ org.omg.IOP,\
+ org.omg.IOP.CodecFactoryPackage,\
+ org.omg.IOP.CodecPackage,\
+ org.omg.Messaging,\
+ org.omg.PortableInterceptor,\
+ org.omg.PortableInterceptor.ORBInitInfoPackage,\
+ org.omg.PortableServer,\
+ org.omg.PortableServer.CurrentPackage,\
+ org.omg.PortableServer.POAManagerPackage,\
+ org.omg.PortableServer.POAPackage,\
+ org.omg.PortableServer.portable,\
+ org.omg.PortableServer.ServantLocatorPackage,\
+ org.omg.stub.java.rmi,\
+ org.w3c.dom,\
+ org.w3c.dom.css,\
+ org.w3c.dom.events,\
+ org.w3c.dom.html,\
+ org.w3c.dom.stylesheets,\
+ org.w3c.dom.views ,\
+ org.xml.sax,\
+ org.xml.sax.ext,\
+ org.xml.sax.helpers
+
+J2SE-1.5.system: \
+ ${J2SE-1.4.system},\
+ javax.activity,\
+ javax.imageio.plugins.bmp,\
+ javax.management,\
+ javax.management.loading,\
+ javax.management.modelmbean,\
+ javax.management.monitor,\
+ javax.management.openmbean,\
+ javax.management.relation,\
+ javax.management.remote,\
+ javax.management.remote.rmi,\
+ javax.management.timer,\
+ javax.rmi.ssl,\
+ javax.security.sasl,\
+ javax.sql.rowset,\
+ javax.sql.rowset.serial,\
+ javax.sql.rowset.spi,\
+ javax.swing.plaf.synth,\
+ javax.xml,\
+ javax.xml.datatype,\
+ javax.xml.namespace,\
+ javax.xml.validation,\
+ org.w3c.dom.bootstrap,\
+ org.w3c.dom.ls,\
+ org.w3c.dom.ranges,\
+ org.w3c.dom.traversal
+
+JavaSE-1.6.system: \
+ ${J2SE-1.5.system},\
+ javax.activation,\
+ javax.annotation,\
+ javax.annotation.processing,\
+ javax.jws,\
+ javax.jws.soap,\
+ javax.lang.model,\
+ javax.lang.model.element,\
+ javax.lang.model.type,\
+ javax.lang.model.util,\
+ javax.script,\
+ javax.tools,\
+ javax.xml.bind,\
+ javax.xml.bind.annotation,\
+ javax.xml.bind.annotation.adapters,\
+ javax.xml.bind.attachment,\
+ javax.xml.bind.helpers,\
+ javax.xml.bind.util,\
+ javax.xml.crypto,\
+ javax.xml.crypto.dom,\
+ javax.xml.crypto.dsig,\
+ javax.xml.crypto.dsig.dom,\
+ javax.xml.crypto.dsig.keyinfo,\
+ javax.xml.crypto.dsig.spec,\
+ javax.xml.soap,\
+ javax.xml.stream,\
+ javax.xml.stream.events,\
+ javax.xml.stream.util,\
+ javax.xml.transform.stax,\
+ javax.xml.ws,\
+ javax.xml.ws.handler,\
+ javax.xml.ws.handler.soap,\
+ javax.xml.ws.http,\
+ javax.xml.ws.soap,\
+ javax.xml.ws.spi
\ No newline at end of file
Modified: felix/trunk/sigil/common/core/sigil.properties
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/common/core/sigil.properties?rev=983901&r1=983900&r2=983901&view=diff
==============================================================================
--- felix/trunk/sigil/common/core/sigil.properties (original)
+++ felix/trunk/sigil/common/core/sigil.properties Tue Aug 10 09:40:42 2010
@@ -20,17 +20,7 @@
org.apache.felix.sigil.common.progress*,
-resources: \
- profiles, \
- profiles/CDC-1.0_Foundation-1.0.profile, \
- profiles/CDC-1.1_Foundation-1.1.profile, \
- profiles/J2SE-1.2.profile, \
- profiles/J2SE-1.3.profile, \
- profiles/J2SE-1.4.profile, \
- profiles/J2SE-1.5.profile, \
- profiles/JavaSE-1.6.profile, \
- profiles/OSGi_Minimum-1.0.profile, \
- profiles/OSGi_Minimum-1.1.profile, \
- profiles/profile.list, \
+ profiles/jvm-packages.properties, \
-exports: \
org.apache.felix.sigil.common.bnd, \
Modified: felix/trunk/sigil/common/core/src/org/apache/felix/sigil/common/bnd/BundleBuilder.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/common/core/src/org/apache/felix/sigil/common/bnd/BundleBuilder.java?rev=983901&r1=983900&r2=983901&view=diff
==============================================================================
--- felix/trunk/sigil/common/core/src/org/apache/felix/sigil/common/bnd/BundleBuilder.java (original)
+++ felix/trunk/sigil/common/core/src/org/apache/felix/sigil/common/bnd/BundleBuilder.java Tue Aug 10 09:40:42 2010
@@ -31,6 +31,7 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
+import java.util.TreeSet;
import java.util.jar.Attributes;
import org.apache.felix.sigil.common.config.BldAttr;
@@ -112,9 +113,8 @@ public class BundleBuilder
try
{
- systemPkgs = new HashSet<String>();
- Properties profile = SystemRepositoryProvider.readProfile(null);
- String pkgs = profile.getProperty("org.osgi.framework.system.packages");
+ systemPkgs = new TreeSet<String>();
+ String pkgs = SystemRepositoryProvider.readSystemPackages(null);
for (String pkg : pkgs.split(",\\s*"))
{
systemPkgs.add(pkg);
@@ -190,6 +190,10 @@ public class BundleBuilder
if (log != null)
{
+ log.verbose("System packages:");
+ for (String pkg : systemPkgs) {
+ log.verbose(pkg);
+ }
log.verbose("Generated " + bundle.getSymbolicName());
log.verbose("-----------------------------");
for (Map.Entry<Object, Object> e : spec.entrySet())
Modified: felix/trunk/sigil/common/core/src/org/apache/felix/sigil/common/core/repository/SystemRepositoryProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/common/core/src/org/apache/felix/sigil/common/core/repository/SystemRepositoryProvider.java?rev=983901&r1=983900&r2=983901&view=diff
==============================================================================
--- felix/trunk/sigil/common/core/src/org/apache/felix/sigil/common/core/repository/SystemRepositoryProvider.java (original)
+++ felix/trunk/sigil/common/core/src/org/apache/felix/sigil/common/core/repository/SystemRepositoryProvider.java Tue Aug 10 09:40:42 2010
@@ -25,6 +25,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
+import org.apache.felix.sigil.common.config.BldUtil;
import org.apache.felix.sigil.common.repository.IBundleRepository;
import org.apache.felix.sigil.common.repository.IRepositoryProvider;
import org.apache.felix.sigil.common.repository.RepositoryException;
@@ -42,9 +43,12 @@ public class SystemRepositoryProvider im
try
{
- Properties p = readProfile(profile);
- String pkgs = p.getProperty("org.osgi.framework.system.packages") + ","
- + extraPkgs;
+ String pkgs = readSystemPackages(profile);
+
+ if ( extraPkgs != null ) {
+ pkgs += "," + extraPkgs;
+ }
+
return new SystemRepository(id, frameworkPath, pkgs);
}
catch (IOException e)
@@ -52,28 +56,42 @@ public class SystemRepositoryProvider im
throw new RepositoryException("Failed to load profile", e);
}
}
+
+ public static String readSystemPackages(String name) throws IOException {
+ Properties p = readProperties();
+
+ String key = systemPackagesKey(name);
+
+ return BldUtil.expand(p.getProperty(key), p);
+ }
- public static Properties readProfile(String name) throws IOException
+ public static Properties readProperties() throws IOException
{
- if (name == null)
- {
- String version = System.getProperty("java.specification.version");
- String[] split = version.split("\\.");
- String prefix = ("6".compareTo(split[1]) <= 0) ? "JavaSE-" : "J2SE-";
- name = prefix + version;
- }
- String profilePath = "profiles/" + name + ".profile";
+ String profilePath = "profiles/jvm-packages.properties";
InputStream in = SystemRepositoryProvider.class.getClassLoader().getResourceAsStream(
profilePath);
if (in == null)
- throw new IOException("No such profile: " + profilePath);
+ throw new IllegalStateException("Missing jvm packages: " + profilePath);
Properties p = new Properties();
+
p.load(in);
return p;
}
+
+ private static String systemPackagesKey(String name) {
+ if (name == null)
+ {
+ String version = System.getProperty("java.specification.version");
+ String[] split = version.split("\\.");
+ String prefix = ("6".compareTo(split[1]) <= 0) ? "JavaSE-" : "J2SE-";
+ name = prefix + version;
+ }
+
+ return name + ".system";
+ }
}