Repository: groovy
Updated Branches:
  refs/heads/master bf87f243f -> da64d1b7f


GROOVY-8766: Add manifest capability entries for OSGi spifly (closes #790)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/da64d1b7
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/da64d1b7
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/da64d1b7

Branch: refs/heads/master
Commit: da64d1b7f18b6d3dbb35d9f25ef32979d69465a7
Parents: bf87f24
Author: Benjamin Graf <benjamin.g...@gmx.net>
Authored: Thu Aug 30 20:28:53 2018 +0200
Committer: Paul King <pa...@asert.com.au>
Committed: Wed Nov 7 21:33:24 2018 +1000

----------------------------------------------------------------------
 gradle/assemble.gradle | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/da64d1b7/gradle/assemble.gradle
----------------------------------------------------------------------
diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index feb405a..29e4c2a 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -144,6 +144,17 @@ ext.subprojectOsgiManifest = {
     version = groovyBundleVersion
     instruction '-nouses', 'true'
     instruction 'Export-Package', "*;version=${groovyBundleVersion}"
+    def folder = new File( 
"${projectDir}/subprojects/${symbolicName}/src/main/resources/META-INF/services"
 )
+    if( folder.exists() ) {
+        if (folder.listFiles().count { it.name ==~ 
/^(?!(org.codehaus.groovy.transform.ASTTransformation)$).*$/ } > 0) {
+            instruction 'Require-Capability', 
'osgi.extender;filter:="(osgi.extender=osgi.serviceloader.registrar)"'
+            instruction 'Require-Capability', 
'osgi.extender;filter:="(osgi.extender=osgi.serviceloader.processor)"'
+            
folder.eachFileMatch(~/^(?!(org.codehaus.groovy.transform.ASTTransformation)$).*$/)
 {
+                instruction 'Require-Capability', 
"osgi.serviceloader;filter:=\"(osgi.serviceloader=${it.name})\";cardinality:=multiple"
+                instruction 'Provide-Capability', 
"osgi.serviceloader;osgi.serviceloader=\"${it.name}\""
+            }
+        }
+    }
     classpath = sourceSets.main.runtimeClasspath
 }
 

Reply via email to