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 2009/07/24 10:40:53 UTC

svn commit: r797363 - in /felix/trunk/sigil/common/core/src/org/apache/felix/sigil: bnd/BundleBuilder.java config/BldProject.java config/IBldProject.java

Author: dsavage
Date: Fri Jul 24 08:40:53 2009
New Revision: 797363

URL: http://svn.apache.org/viewvc?rev=797363&view=rev
Log:
Tidied up some lingering cauldron.org references

Modified:
    felix/trunk/sigil/common/core/src/org/apache/felix/sigil/bnd/BundleBuilder.java
    felix/trunk/sigil/common/core/src/org/apache/felix/sigil/config/BldProject.java
    felix/trunk/sigil/common/core/src/org/apache/felix/sigil/config/IBldProject.java

Modified: felix/trunk/sigil/common/core/src/org/apache/felix/sigil/bnd/BundleBuilder.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/common/core/src/org/apache/felix/sigil/bnd/BundleBuilder.java?rev=797363&r1=797362&r2=797363&view=diff
==============================================================================
--- felix/trunk/sigil/common/core/src/org/apache/felix/sigil/bnd/BundleBuilder.java (original)
+++ felix/trunk/sigil/common/core/src/org/apache/felix/sigil/bnd/BundleBuilder.java Fri Jul 24 08:40:53 2009
@@ -40,7 +40,6 @@
 import org.apache.felix.sigil.config.BldAttr;
 import org.apache.felix.sigil.config.IBldProject;
 import org.apache.felix.sigil.config.IBldProject.IBldBundle;
-import org.apache.felix.sigil.core.internal.model.osgi.PackageImport;
 import org.apache.felix.sigil.core.repository.SystemRepositoryProvider;
 import org.apache.felix.sigil.model.common.VersionRange;
 import org.apache.felix.sigil.model.osgi.IPackageExport;
@@ -56,14 +55,6 @@
 
 public class BundleBuilder
 {
-    public static final String COMPONENT_ACTIVATOR_PKG = "XXX-FIXME-XXX";
-    public static final String COMPONENT_ACTIVATOR = COMPONENT_ACTIVATOR_PKG + ".Activator";
-    public static final String[] COMPONENT_ACTIVATOR_DEPS =
-        { "XXX-FIXME-XXX", "org.osgi.framework", "org.osgi.util.tracker" };
-    public static final String COMPONENT_DIR = "META-INF/XXX-FIXME-XXX";
-    public static final String COMPONENT_FLAG = "Installable-Component";
-    public static final String COMPONENT_LIST = "Installable-Component-Templates";
-
     private IBldProject project;
     private File[] classpath;
     private String destPattern;
@@ -455,7 +446,7 @@
         spec.setProperty( Constants.NOEXTRAHEADERS, "true" ); // Created-By,
         // Bnd-LastModified
         // and Tool
-        spec.setProperty( Constants.CREATED_BY, "sigil.codecauldron.org" );
+        spec.setProperty( Constants.CREATED_BY, "sigil.felix.apache.org" );
 
         Properties headers = bundle.getHeaders();
         // XXX: catch attempts to set headers that conflict with Bnd
@@ -473,7 +464,7 @@
 
         List<String> exports = addExports( bundle, spec );
 
-        String composites = addResources( bundle, spec );
+        addResources( bundle, spec );
 
         ArrayList<String> contents = new ArrayList<String>();
         contents.addAll( bundle.getContents() );
@@ -490,20 +481,6 @@
             }
         }
 
-        if ( composites.length() > 0 )
-        {
-            if ( spec.containsKey( Constants.BUNDLE_ACTIVATOR ) )
-                warnings.add( "-activator ignored when -composites specified." );
-            spec.setProperty( Constants.BUNDLE_ACTIVATOR, COMPONENT_ACTIVATOR );
-            spec.setProperty( COMPONENT_FLAG, "true" );
-            spec.setProperty( COMPONENT_LIST, composites );
-            // add activator pkg directly, to avoid needing to add jar to
-            // Bundle-ClassPath.
-            // split-package directive needed to stop Bnd whinging when using
-            // other bundles containing the component-activator.
-            contents.add( COMPONENT_ACTIVATOR_PKG + ";-split-package:=merge-first" );
-        }
-
         List<String> srcPkgs = addLibs( bundle, dest, spec );
 
         contents.addAll( srcPkgs );
@@ -668,24 +645,9 @@
     }
 
 
-    private String addResources( IBldBundle bundle, Properties spec )
+    private void addResources( IBldBundle bundle, Properties spec )
     {
         Map<String, String> resources = bundle.getResources();
-        StringBuilder composites = new StringBuilder();
-
-        for ( String composite : bundle.getComposites() )
-        {
-            File path = bundle.resolve( composite );
-            String name = path.getName();
-
-            String bPath = COMPONENT_DIR + "/" + name;
-            resources.put( bPath, path.getPath() );
-
-            if ( composites.length() > 0 )
-                composites.append( "," );
-            composites.append( bPath );
-        }
-
         StringBuilder sb = new StringBuilder();
 
         for ( String bPath : resources.keySet() )
@@ -734,8 +696,6 @@
 
         if ( sb.length() > 0 )
             spec.setProperty( Constants.INCLUDE_RESOURCE, sb.toString() );
-
-        return composites.toString();
     }
 
 
@@ -749,22 +709,6 @@
             pkgs.add( pi.getPackageName() );
         }
 
-        // add component activator imports
-        if ( !bundle.getComposites().isEmpty() )
-        {
-            for ( String pkg : BundleBuilder.COMPONENT_ACTIVATOR_DEPS )
-            {
-                if ( pkgs.contains( pkg ) )
-                    continue;
-                PackageImport pi = new PackageImport();
-                pi.setPackageName( pkg );
-                String versions = project.getDefaultPackageVersion( pkg );
-                if ( versions != null )
-                    pi.setVersions( VersionRange.parseVersionRange( versions ) );
-                imports.add( pi );
-            }
-        }
-
         return imports;
     }
 

Modified: felix/trunk/sigil/common/core/src/org/apache/felix/sigil/config/BldProject.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/common/core/src/org/apache/felix/sigil/config/BldProject.java?rev=797363&r1=797362&r2=797363&view=diff
==============================================================================
--- felix/trunk/sigil/common/core/src/org/apache/felix/sigil/config/BldProject.java (original)
+++ felix/trunk/sigil/common/core/src/org/apache/felix/sigil/config/BldProject.java Fri Jul 24 08:40:53 2009
@@ -294,26 +294,6 @@
             }
         }
 
-        boolean containsComposite = false;
-
-        for ( IBldBundle bundle : getBundles() )
-        {
-            if ( !bundle.getComposites().isEmpty() )
-            {
-                containsComposite = true;
-                break;
-            }
-        }
-
-        // add dependency on component activator
-        if ( containsComposite )
-        {
-            PackageImport pi = new PackageImport();
-            pi.setPackageName( BundleBuilder.COMPONENT_ACTIVATOR_PKG );
-            pi.setOSGiImport( OSGiImport.NEVER );
-            dependencies.addImport( pi );
-        }
-
         return dependencies;
     }
 

Modified: felix/trunk/sigil/common/core/src/org/apache/felix/sigil/config/IBldProject.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/common/core/src/org/apache/felix/sigil/config/IBldProject.java?rev=797363&r1=797362&r2=797363&view=diff
==============================================================================
--- felix/trunk/sigil/common/core/src/org/apache/felix/sigil/config/IBldProject.java (original)
+++ felix/trunk/sigil/common/core/src/org/apache/felix/sigil/config/IBldProject.java Fri Jul 24 08:40:53 2009
@@ -216,12 +216,6 @@
 
 
         /**
-         * gets SCA composites.
-         */
-        List<String> getComposites();
-
-
-        /**
          * gets the additional resources.
          * @return map with key as path in bundle, value as path in file system.
          * Paths are resolved relative to location of project file and also from classpath.