Skip to content

Commit

Permalink
Added correct manifest entries for OSGI source bundle (Fixes #242)
Browse files Browse the repository at this point in the history
  • Loading branch information
hierynomus committed Apr 15, 2016
1 parent 317bbfa commit 1399781
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ jar {
}
}

sourceSets {
emptySet {
java {
srcDir "src/empty/java"
}
}
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
Expand All @@ -103,13 +111,15 @@ task javadocJar(type: Jar) {
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
manifest = osgiManifest {
classesDir = project.sourceSets.main.output.classesDir
classpath = project.sourceSets.main.runtimeClasspath
instruction "Bundle-ManifestVersion", "2"
instruction "Bundle-SymbolicName", "${project.group}.${project.name}.source"
instruction "Bundle-Version", project.version.toString()
instruction "Eclipse-SourceBundle", "${project.group}.${project.name};version=\"${project.version}\";roots:=\".\""
manifest {
attributes(
// Add the needed OSGI attributes
"Bundle-ManifestVersion": "2",
"Bundle-Name": "${project.jar.manifest.name} Source",
"Bundle-Version": project.jar.manifest.version,
"Eclipse-SourceBundle": "${project.jar.manifest.symbolicName};version=\"${project.jar.manifest.version}\";roots:=\".\"",
"Bundle-SymbolicName": "${project.jar.manifest.symbolicName}.source"
)
}
}

Expand Down

0 comments on commit 1399781

Please sign in to comment.