From a7238c213acfb24850b9ca588e3ac0ba6b0e81ba Mon Sep 17 00:00:00 2001 From: Clayton Walker Date: Sun, 2 Jun 2024 13:01:42 -0600 Subject: [PATCH] Upgrade bnd --- build.gradle.kts | 4 ++-- gradle/libs.versions.toml | 2 +- okio-fakefilesystem/build.gradle.kts | 7 ++++--- okio/build.gradle.kts | 13 +++++++------ 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index c9490faae0..e47e844f49 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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 @@ -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) allprojects { group = project.property("GROUP") as String diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 86f8a71769..8f4d08ca72 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -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" } diff --git a/okio-fakefilesystem/build.gradle.kts b/okio-fakefilesystem/build.gradle.kts index afebff16a4..e1816f8664 100644 --- a/okio-fakefilesystem/build.gradle.kts +++ b/okio-fakefilesystem/build.gradle.kts @@ -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 @@ -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) } } } diff --git a/okio/build.gradle.kts b/okio/build.gradle.kts index eea0f82119..901b38f1aa 100644 --- a/okio/build.gradle.kts +++ b/okio/build.gradle.kts @@ -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 @@ -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) } } }