@@ -54,6 +54,31 @@ 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+ project. version = project. hasProperty(' ver' ) ? project[' ver' ] : ' none'
67+ jar. manifest {
68+ attributes (
69+ ' Bundle-Description' : " ${ project.description} " ,
70+ ' Bundle-DocURL' : " https://${ project.git_url} " ,
71+ ' Bundle-License' : " https://${ project.git_url} /blob/v${ version} /LICENSE" ,
72+ ' Bundle-ManifestVersion' : " ${ osgi_manifest_ver} " ,
73+ ' Bundle-SymbolicName' : " ${ project.group} .${ project.name} " ,
74+ ' Bundle-Vendor' : " ${ project.org} " ,
75+ ' Bundle-Version' : " ${ project.version} " ,
76+ ' 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} \" " ,
77+ ' Main-Class' : ' matlabcontrol.demo.DemoMain' ,
78+ ' Require-Capability' : ' osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.7))"'
79+ )
80+ }
81+
5782// //////////
5883// JAVA 6 //
5984// //////////
@@ -111,9 +136,23 @@ def JMI_STUB = 'com/mathworks/jmi/**'
111136
112137// make a source jar
113138task sourcesJar (type : Jar ) {
114- classifier = ' sources'
139+ archiveClassifier = ' sources'
115140 from sourceSets. main. allJava
116141 exclude(JMI_STUB )
142+ manifest {
143+ attributes (
144+ ' Bundle-Description' : " ${ project.description} " ,
145+ ' Bundle-DocURL' : " https://${ project.git_url} " ,
146+ ' Bundle-License' : " https://${ project.git_url} /blob/v${ version} /LICENSE" ,
147+ ' Bundle-ManifestVersion' : " ${ osgi_manifest_ver} " ,
148+ ' Bundle-SymbolicName' : " ${ project.group} .${ project.name} " ,
149+ ' Bundle-Vendor' : " ${ project.org} " ,
150+ ' Bundle-Version' : " ${ project.version} " ,
151+ ' 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} \" " ,
152+ ' Main-Class' : ' matlabcontrol.demo.DemoMain' ,
153+ ' Require-Capability' : ' osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.7))"'
154+ )
155+ }
117156}
118157
119158// Where it's possible to name parameters and methods clearly enough
@@ -131,10 +170,14 @@ javadoc {
131170}
132171
133172task javadocJar (type : Jar , dependsOn : javadoc) {
134- classifier = ' javadoc'
173+ archiveClassifier = ' javadoc'
135174 from javadoc. destinationDir
136175}
137176
177+ artifacts {
178+ archives sourcesJar
179+ }
180+
138181// it all needs to get published and formatted
139182apply from : 干. file(' base/maven.gradle' )
140183apply from : 干. file(' base/sonatype.gradle' )
0 commit comments