Skip to content

Commit

Permalink
Make Bundle-Version OSGi conform and add OSGi manifest to skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirostar committed Apr 26, 2023
1 parent 7ddea29 commit 024bd02
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
14 changes: 10 additions & 4 deletions dcm4che-typeddicom-lib/dcm4che-typeddicom-lib-std/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,24 @@ tasks.test {
useJUnitPlatform()
}

// Remove non-numeric version info for Bundle version
val bundleVersion = "$version".replace(Regex(".*(\\d+\\.\\d+\\.\\d+).*"), "$1")

tasks.withType<Jar> {
manifest {
attributes["Manifest-Version"] = "1.0"
attributes["Bundle-ManifestVersion"] = "2"
attributes["Bundle-Name"] = "org.dcm4che.typeddicom"
attributes["Bundle-SymbolicName"] = "org.dcm4che.typeddicom;singleton:=true"
attributes["Bundle-Version"] = version
attributes["Bundle-Name"] = "org.dcm4che.dcm4che-typeddicom-lib-std"
attributes["Bundle-SymbolicName"] = "org.dcm4che.dcm4che-typeddicom-lib-std;singleton:=true"
attributes["Bundle-Version"] = bundleVersion
attributes["Bundle-Vendor"] = "dcm4che"
attributes["Bundle-ClassPath"] = "."
attributes["Bundle-ActivationPolicy"] = "lazy"
attributes["Require-Bundle"] =
"org.dcm4che.dcm4che-typeddicom-skeleton; bundle-version=\"${bundleVersion}\"; visibility:=reexport"
attributes["Export-Package"] =
"org.dcm4che.typeddicom, org.dcm4che.typeddicom.dataelements, org.dcm4che.typeddicom.iods, org.dcm4che.typeddicom.modules, org.dcm4che.typeddicom.valuerepresentations"
"org.dcm4che.typeddicom, org.dcm4che.typeddicom.dataelements, org.dcm4che.typeddicom.iods, " +
"org.dcm4che.typeddicom.modules, org.dcm4che.typeddicom.valuerepresentations"
attributes["Import-Package"] = "org.dcm4che3.data"
}
}
Expand Down
19 changes: 19 additions & 0 deletions dcm4che-typeddicom-skeleton/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@ tasks.getByName<Test>("test") {
useJUnitPlatform()
}

// Remove non-numeric version info for Bundle version
val bundleVersion = "$version".replace(Regex(".*(\\d+\\.\\d+\\.\\d+).*"), "$1")

tasks.withType<Jar> {
manifest {
attributes["Manifest-Version"] = "1.0"
attributes["Bundle-ManifestVersion"] = "2"
attributes["Bundle-Name"] = "org.dcm4che.dcm4che-typeddicom-skeleton"
attributes["Bundle-SymbolicName"] = "org.dcm4che.dcm4che-typeddicom-skeleton;singleton:=true"
attributes["Bundle-Version"] = bundleVersion
attributes["Bundle-Vendor"] = "dcm4che"
attributes["Bundle-ClassPath"] = "."
attributes["Bundle-ActivationPolicy"] = "lazy"
attributes["Export-Package"] =
"org.dcm4che.typeddicom, org.dcm4che.typeddicom.valuerepresentations"
attributes["Import-Package"] = "org.dcm4che3.data"
}
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand Down

0 comments on commit 024bd02

Please sign in to comment.