From: Hannu Niemistö Date: Mon, 13 Nov 2017 10:43:16 +0000 (+0200) Subject: (refs #7613) Removed some module sources as declarative services X-Git-Tag: v1.31.0~45^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=1e6b0f31a45cfdb30ef8c28a0763eb05d705e6fb;p=simantics%2Fplatform.git (refs #7613) Removed some module sources as declarative services Change-Id: I5e7c8a2921c945d802d38baa458d784270373d93 --- diff --git a/bundles/org.simantics.scl.compiler/META-INF/MANIFEST.MF b/bundles/org.simantics.scl.compiler/META-INF/MANIFEST.MF index 105c28de9..a09f40cd5 100644 --- a/bundles/org.simantics.scl.compiler/META-INF/MANIFEST.MF +++ b/bundles/org.simantics.scl.compiler/META-INF/MANIFEST.MF @@ -75,6 +75,5 @@ Export-Package: org.cojen.classfile, org.simantics.scl.compiler.types.kinds, org.simantics.scl.compiler.types.util Bundle-ClassPath: . -Service-Component: OSGI-INF/org.simantics.scl.compiler.source.repository.BuiltinModuleSourceRepository.xml, - OSGI-INF/org.simantics.scl.compiler.elaboration.java.LoggingModule.xml Import-Package: org.osgi.service.component.annotations +Bundle-ActivationPolicy: lazy diff --git a/bundles/org.simantics.scl.compiler/OSGI-INF/org.simantics.scl.compiler.elaboration.java.LoggingModule.xml b/bundles/org.simantics.scl.compiler/OSGI-INF/org.simantics.scl.compiler.elaboration.java.LoggingModule.xml deleted file mode 100644 index bad60b1da..000000000 --- a/bundles/org.simantics.scl.compiler/OSGI-INF/org.simantics.scl.compiler.elaboration.java.LoggingModule.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/bundles/org.simantics.scl.compiler/OSGI-INF/org.simantics.scl.compiler.source.repository.BuiltinModuleSourceRepository.xml b/bundles/org.simantics.scl.compiler/OSGI-INF/org.simantics.scl.compiler.source.repository.BuiltinModuleSourceRepository.xml deleted file mode 100644 index 0faa31e11..000000000 --- a/bundles/org.simantics.scl.compiler/OSGI-INF/org.simantics.scl.compiler.source.repository.BuiltinModuleSourceRepository.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/bundles/org.simantics.scl.compiler/build.properties b/bundles/org.simantics.scl.compiler/build.properties index 4b829c259..ac7dca70e 100644 --- a/bundles/org.simantics.scl.compiler/build.properties +++ b/bundles/org.simantics.scl.compiler/build.properties @@ -2,7 +2,5 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ - OSGI-INF/org.simantics.scl.compiler.source.repository.BuiltinModuleSourceRepository.xml,\ - OSGI-INF/org.simantics.scl.compiler.elaboration.java.LoggingModule.xml,\ sclTests/,\ scl/ diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/java/LoggingModule.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/java/LoggingModule.java index 552c93f64..8ce399148 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/java/LoggingModule.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/java/LoggingModule.java @@ -23,7 +23,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.Marker; -@Component public class LoggingModule extends ConcreteModule { private static final String[] LOGGING_METHODS = new String[] { diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/java/ReflectionJavaModule.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/java/ReflectionJavaModule.java index dab0056ae..1ccc4af4d 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/java/ReflectionJavaModule.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/java/ReflectionJavaModule.java @@ -17,7 +17,6 @@ import org.simantics.scl.compiler.types.Type; import org.simantics.scl.compiler.types.Types; import org.simantics.scl.compiler.types.kinds.Kinds; -@Component public class ReflectionJavaModule extends ConcreteModule { public static ReflectionJavaModule INSTANCE = new ReflectionJavaModule(); diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/source/repository/BuiltinModuleSourceRepository.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/source/repository/BuiltinModuleSourceRepository.java index 650fa1d19..f3fd69740 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/source/repository/BuiltinModuleSourceRepository.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/source/repository/BuiltinModuleSourceRepository.java @@ -1,13 +1,11 @@ package org.simantics.scl.compiler.source.repository; -import org.osgi.service.component.annotations.Component; import org.simantics.scl.compiler.elaboration.java.Builtins; import org.simantics.scl.compiler.elaboration.java.JavaModule; import org.simantics.scl.compiler.elaboration.java.LoggingModule; import org.simantics.scl.compiler.elaboration.java.MinigraphModule; import org.simantics.scl.compiler.elaboration.java.ReflectionJavaModule; -@Component public class BuiltinModuleSourceRepository extends MapModuleSourceRepository implements ModuleSourceRepository { public BuiltinModuleSourceRepository() { super(Builtins.INSTANCE, diff --git a/bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/internal/ServiceBasedModuleSourceRepository.java b/bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/internal/ServiceBasedModuleSourceRepository.java index ac8384c24..e9d4abd4a 100644 --- a/bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/internal/ServiceBasedModuleSourceRepository.java +++ b/bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/internal/ServiceBasedModuleSourceRepository.java @@ -25,6 +25,7 @@ public class ServiceBasedModuleSourceRepository implements ModuleSourceRepositor public ModuleSource getModuleSource(String moduleName, UpdateListener listener) { ModuleSource result = null; + ModuleSourceRepository resultRepository = null; Object[] services = sourceRepositories.getServices(); if(services != null) for(Object sourceRepository_ : services) { @@ -37,10 +38,11 @@ public class ServiceBasedModuleSourceRepository implements ModuleSourceRepositor if(resultPriority > sourcePriority) continue; if(resultPriority == sourcePriority) - throw new RuntimeException("Module " + moduleName + " has two sources " + result + ", " + - source + " with the same priority."); + throw new RuntimeException("Module " + moduleName + " has two sources " + result + " (from "+resultRepository+"), " + + source + " (from "+sourceLoader+") with the same priority."); } result = source; + resultRepository = sourceLoader; } } return result;