Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade bnd #1487

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import aQute.bnd.gradle.BundleTaskConvention
import aQute.bnd.gradle.BundleTaskExtension
import com.diffplug.gradle.spotless.SpotlessExtension
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
Expand Down Expand Up @@ -46,7 +46,7 @@ apply(plugin = "com.vanniktech.maven.publish.base")

// When scripts are applied the buildscript classes are not accessible directly therefore we save
// the class here to make it accessible.
ext.set("bndBundleTaskConventionClass", BundleTaskConvention::class.java)
ext.set("bndBundleTaskExtensionClass", BundleTaskExtension::class.java)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is necessary.


allprojects {
group = project.property("GROUP") as String
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jmh-core = { module = "org.openjdk.jmh:jmh-core", version.ref = "jmh" }
jmh-generator = { module = "org.openjdk.jmh:jmh-generator-annprocess", version.ref = "jmh" }
dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version = "1.9.20" }
spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version = "6.25.0" }
bnd = { module = "biz.aQute.bnd:biz.aQute.bnd.gradle", version = "6.4.0" }
bnd = { module = "biz.aQute.bnd:biz.aQute.bnd.gradle", version = "7.0.0" }
vanniktech-publish-plugin = { module = "com.vanniktech:gradle-maven-publish-plugin", version = "0.27.0" }
test-junit = { module = "junit:junit", version = "4.13.2" }
test-assertj = { module = "org.assertj:assertj-core", version = "3.25.3" }
Expand Down
7 changes: 4 additions & 3 deletions okio-fakefilesystem/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ tasks {
val jvmJar by getting(Jar::class) {
// BundleTaskConvention() crashes unless there's a 'main' source set.
sourceSets.create(SourceSet.MAIN_SOURCE_SET_NAME)
val bndConvention = aQute.bnd.gradle.BundleTaskConvention(this)
bndConvention.setBnd(
val bndExtension = aQute.bnd.gradle.BundleTaskExtension(this)
bndExtension.setBnd(
"""
Export-Package: okio.fakefilesystem
Automatic-Module-Name: okio.fakefilesystem
Expand All @@ -67,7 +67,8 @@ tasks {
)
// Call the convention when the task has finished to modify the jar to contain OSGi metadata.
doLast {
bndConvention.buildBundle()
bndExtension.buildAction()
.execute(this)
}
}
}
Expand Down
13 changes: 7 additions & 6 deletions okio/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import aQute.bnd.gradle.BundleTaskConvention
import aQute.bnd.gradle.BundleTaskExtension
import com.vanniktech.maven.publish.JavadocJar.Dokka
import com.vanniktech.maven.publish.KotlinMultiplatform
import com.vanniktech.maven.publish.MavenPublishBaseExtension
Expand Down Expand Up @@ -190,19 +190,20 @@ kotlin {

tasks {
val jvmJar by getting(Jar::class) {
// BundleTaskConvention() crashes unless there's a 'main' source set.
// BundleTaskExtension() crashes unless there's a 'main' source set.
sourceSets.create(SourceSet.MAIN_SOURCE_SET_NAME)
val bndConvention = BundleTaskConvention(this)
bndConvention.setBnd(
val bndExtension = BundleTaskExtension(this)
bndExtension.setBnd(
"""
Export-Package: okio
Automatic-Module-Name: okio
Bundle-SymbolicName: com.squareup.okio
""",
)
// Call the convention when the task has finished to modify the jar to contain OSGi metadata.
// Call the extension when the task has finished to modify the jar to contain OSGi metadata.
doLast {
bndConvention.buildBundle()
bndExtension.buildAction()
.execute(this)
}
}
}
Expand Down