Skip to content

Commit

Permalink
[Build] Generate OSGi metadata into MANIFEST.MF
Browse files Browse the repository at this point in the history
Co-authored-by: Jannis Weis <[email protected]>
  • Loading branch information
HannesWell and weisJ committed Dec 11, 2024
1 parent 033fd48 commit 42abc0f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import aQute.bnd.gradle.Bundle
import com.diffplug.spotless.extra.wtp.EclipseWtpFormatterStep
import com.github.vlsi.gradle.crlf.CrLfSpec
import com.github.vlsi.gradle.crlf.LineEndings
Expand All @@ -16,6 +17,7 @@ plugins {
id("com.github.vlsi.gradle-extensions")
id("com.github.vlsi.stage-vote-release")
id("net.ltgt.errorprone") apply false
id("biz.aQute.bnd.builder") apply false
}

val skipJavadoc by props()
Expand Down Expand Up @@ -261,6 +263,12 @@ allprojects {
}
}

apply(plugin = "biz.aQute.bnd.builder")
register<Bundle>("bundle") {
bundle {
}
}

withType<Jar>().configureEach {
manifest {
attributes["Bundle-License"] = "MIT"
Expand All @@ -271,6 +279,10 @@ allprojects {
attributes["Specification-Title"] = "JSVG"
attributes["Implementation-Vendor"] = "JSVG"
attributes["Implementation-Vendor-Id"] = "com.github.weisj"
// bnd instructions to generate OSGi metadata
attributes["Bundle-SymbolicName"] = "com.github.weisj.jsvg"
attributes["-exportcontents"] = "!*.impl.*,*"
attributes["-removeheaders"] = "Private-Package,Tool"
}

CrLfSpec(LineEndings.LF).run {
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ errorprone.version = 2.25.0
errorprone.compiler.version = 9+181-r4173-1
guava.version = 1.0
autoservice.version = 1.0.1
biz.aQute.bnd.lib.version = 7.0.0

#Sonarcloud
systemProp.sonar.host.url = https://sonarcloud.io
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pluginManagement {
idv("net.ltgt.errorprone")
idv("me.champeau.jmh")
idv("org.sonarqube")
idv("biz.aQute.bnd.builder", "biz.aQute.bnd.lib")
}
}

Expand Down

0 comments on commit 42abc0f

Please sign in to comment.