]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/internal/Activator.java
(refs #7613) Removed some module sources as declarative services
[simantics/platform.git] / bundles / org.simantics.scl.osgi / src / org / simantics / scl / osgi / internal / Activator.java
old mode 100755 (executable)
new mode 100644 (file)
index ea11301..b629e08
@@ -4,11 +4,17 @@ import java.util.Hashtable;
 
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
+import org.simantics.scl.compiler.module.repository.ModuleRepository;
+import org.simantics.scl.compiler.module.repository.UpdateListener;
 import org.simantics.scl.compiler.source.repository.ModuleSourceRepository;
+import org.simantics.scl.compiler.source.repository.ProceduralModuleSourceRepository;
 import org.simantics.scl.compiler.source.repository.SourceRepositories;
+import org.simantics.scl.osgi.SCLOsgi;
 
 public class Activator implements BundleActivator {
 
+    public static final String PLUGIN_ID = "org.simantics.scl.osgi";
+
     private static BundleContext context;
 
     public static BundleContext getContext() {
@@ -23,6 +29,14 @@ public class Activator implements BundleActivator {
         bundleContext.registerService(ModuleSourceRepository.class,
                 SourceRepositories.BUILTIN_SOURCE_REPOSITORY,
                 properties);
+        bundleContext.registerService(ModuleSourceRepository.class,
+                new ProceduralModuleSourceRepository() {
+                    @Override
+                    protected ModuleRepository getModuleRepository(UpdateListener listener) {
+                        return SCLOsgi.MODULE_REPOSITORY;
+                    }
+                },
+                properties);
     }
 
     public void stop(BundleContext bundleContext) throws Exception {