@@ -54,6 +54,30 @@ task testMatlabAll(dependsOn: [
5454 testMatlabInteractive
5555])
5656
57+ // ////////
58+ // OSGI //
59+ // ////////
60+
61+ // delete the old manifest to ensure there's no caching or merging going on
62+ jar. doFirst {
63+ project. file(' META-INF/MANIFEST.MF' ). delete()
64+ }
65+
66+ jar. manifest {
67+ attributes (
68+ ' Bundle-Description' : " ${ project.description} " ,
69+ ' Bundle-DocURL' : " https://${ project.git_url} " ,
70+ ' Bundle-License' : " https://${ project.git_url} /blob/v${ version} /LICENSE" ,
71+ ' Bundle-ManifestVersion' : " ${ osgi_manifest_ver} " ,
72+ ' Bundle-SymbolicName' : " ${ project.group} .${ project.name} " ,
73+ ' Bundle-Vendor' : " ${ project.org} " ,
74+ ' Bundle-Version' : " ${ project.version} " ,
75+ ' Export-Package' : " matlabcontrol;version=\" ${ project.version} \" ,matlabcontrol.demo;version=\" ${ project.version} \" ,matlabcontrol.extensions;uses:=matlabcontrol;version=\" ${ project.version} \" ,matlabcontrol.internal;version=\" ${ project.version} \" ,matlabcontrol.link;uses:=matlabcontrol;version=\" ${ project.version} \" " ,
76+ ' Main-Class' : ' matlabcontrol.demo.DemoMain' ,
77+ ' Require-Capability' : ' osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.7))"'
78+ )
79+ }
80+
5781// //////////
5882// JAVA 6 //
5983// //////////
@@ -111,9 +135,23 @@ def JMI_STUB = 'com/mathworks/jmi/**'
111135
112136// make a source jar
113137task sourcesJar (type : Jar ) {
114- classifier = ' sources'
138+ archiveClassifier = ' sources'
115139 from sourceSets. main. allJava
116140 exclude(JMI_STUB )
141+ manifest {
142+ attributes (
143+ ' Bundle-Description' : " ${ project.description} " ,
144+ ' Bundle-DocURL' : " https://${ project.git_url} " ,
145+ ' Bundle-License' : " https://${ project.git_url} /blob/v${ version} /LICENSE" ,
146+ ' Bundle-ManifestVersion' : " ${ osgi_manifest_ver} " ,
147+ ' Bundle-SymbolicName' : " ${ project.group} .${ project.name} " ,
148+ ' Bundle-Vendor' : " ${ project.org} " ,
149+ ' Bundle-Version' : " ${ project.version} " ,
150+ ' Export-Package' : " matlabcontrol;version=\" ${ project.version} \" ,matlabcontrol.demo;version=\" ${ project.version} \" ,matlabcontrol.extensions;uses:=matlabcontrol;version=\" ${ project.version} \" ,matlabcontrol.internal;version=\" ${ project.version} \" ,matlabcontrol.link;uses:=matlabcontrol;version=\" ${ project.version} \" " ,
151+ ' Main-Class' : ' matlabcontrol.demo.DemoMain' ,
152+ ' Require-Capability' : ' osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.7))"'
153+ )
154+ }
117155}
118156
119157// Where it's possible to name parameters and methods clearly enough
@@ -131,10 +169,14 @@ javadoc {
131169}
132170
133171task javadocJar (type : Jar , dependsOn : javadoc) {
134- classifier = ' javadoc'
172+ archiveClassifier = ' javadoc'
135173 from javadoc. destinationDir
136174}
137175
176+ artifacts {
177+ archives sourcesJar
178+ }
179+
138180// it all needs to get published and formatted
139181apply from : 干. file(' base/maven.gradle' )
140182apply from : 干. file(' base/sonatype.gradle' )
0 commit comments