From ac1cef23a111d5c5db9cbd7557f6efb453e164fd Mon Sep 17 00:00:00 2001 From: BJ Hargrave Date: Tue, 12 Jul 2022 15:57:52 -0400 Subject: [PATCH 1/4] deps: Update osgi-test to 1.2.0 Signed-off-by: BJ Hargrave --- cnf/ext/junit.bnd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cnf/ext/junit.bnd b/cnf/ext/junit.bnd index 0f63560dc2..2093215574 100644 --- a/cnf/ext/junit.bnd +++ b/cnf/ext/junit.bnd @@ -17,7 +17,7 @@ hamcrest.version=2.2 mockito.version=4.6.0 bytebuddy.version=1.12.10 objenesis.version=3.2 -osgi-test.version=1.1.0 +osgi-test.version=1.2.0 junit: ${junit-osgi},\ org.osgi.dto;version='[1.0,1.1)',\ From 52dceb9e4b6396784da7c79fdd3e2c0300d45e22 Mon Sep 17 00:00:00 2001 From: BJ Hargrave Date: Tue, 12 Jul 2022 15:59:48 -0400 Subject: [PATCH 2/4] build: Use pluginManagement to configure plugin versions Signed-off-by: BJ Hargrave --- gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts | 2 +- gradle-plugins/settings.gradle.kts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts b/gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts index d47731abd4..898dcd38a6 100644 --- a/gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts +++ b/gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts @@ -3,7 +3,7 @@ import java.util.* plugins { groovy `kotlin-dsl` - id("com.gradle.plugin-publish") version "1.0.0" + id("com.gradle.plugin-publish") } interface Injected { diff --git a/gradle-plugins/settings.gradle.kts b/gradle-plugins/settings.gradle.kts index 08d5da9717..45f12b262f 100644 --- a/gradle-plugins/settings.gradle.kts +++ b/gradle-plugins/settings.gradle.kts @@ -1,2 +1,8 @@ +pluginManagement { + plugins { + id("com.gradle.plugin-publish") version "1.0.0" + } +} + rootProject.name = "gradle-plugins" include("biz.aQute.bnd.gradle") From 8b8868c34de96073b1747d8f7bf4a9896d5f3739 Mon Sep 17 00:00:00 2001 From: BJ Hargrave Date: Tue, 12 Jul 2022 16:22:13 -0400 Subject: [PATCH 3/4] build: Build script cleanups Signed-off-by: BJ Hargrave --- .../biz.aQute.bnd.gradle/build.gradle.kts | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts b/gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts index 898dcd38a6..73f4b16206 100644 --- a/gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts +++ b/gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts @@ -40,8 +40,9 @@ repositories { } // SourceSet for Kotlin DSL code so that it can be built after the main SourceSet +val dsl by sourceSets.registering sourceSets { - val dsl by registering { + dsl { compileClasspath += main.get().output runtimeClasspath += main.get().output } @@ -131,6 +132,15 @@ publishing { name.set(artifactId) description.set("The Bnd Gradle plugins.") } + val publication = this + tasks.register("generatePomPropertiesFor${publication.name.capitalize()}Publication") { + description = "Generates the Maven pom.properties file for publication '${publication.name}'." + group = PublishingPlugin.PUBLISH_TASK_GROUP + setOutputFile(layout.buildDirectory.file("publications/${publication.name}/pom-default.properties")) + property("groupId", provider { publication.groupId }) + property("artifactId", provider { publication.artifactId }) + property("version", provider { publication.version }) + } } // Configure pom metadata withType { @@ -167,15 +177,6 @@ publishing { } } } - val publication = this - tasks.register("generatePomPropertiesFor${publication.name.capitalize()}Publication") { - description = "Generates the Maven pom.properties file for publication '${publication.name}'." - group = PublishingPlugin.PUBLISH_TASK_GROUP - setOutputFile(layout.buildDirectory.file("publications/${publication.name}/pom-default.properties")) - property("groupId", provider { publication.groupId }) - property("artifactId", provider { publication.artifactId }) - property("version", provider { publication.version }) - } } } } @@ -209,12 +210,12 @@ tasks.withType().configureEach { tasks.pluginUnderTestMetadata { // Include dsl SourceSet - pluginClasspath.from(sourceSets["dsl"].output) + pluginClasspath.from(dsl.get().output) } tasks.jar { // Include dsl SourceSet - from(sourceSets["dsl"].output) + from(dsl.get().output) // META-INF/maven folder val metaInfMaven = publishing.publications.named("pluginMaven").map { "META-INF/maven/${it.groupId}/${it.artifactId}" @@ -233,7 +234,7 @@ tasks.jar { tasks.named("sourcesJar") { // Include dsl SourceSet - from(sourceSets["dsl"].allSource) + from(dsl.get().allSource) } val testresourcesOutput = layout.buildDirectory.dir("testresources") From 806915366d90a5aa8e41e7013cc227ba7f9974cd Mon Sep 17 00:00:00 2001 From: BJ Hargrave Date: Tue, 12 Jul 2022 16:22:35 -0400 Subject: [PATCH 4/4] build: Remove unneeded JPMS options Signed-off-by: BJ Hargrave --- .../biz.aQute.bnd.gradle/build.gradle.kts | 8 ------- gradle-plugins/build.gradle.kts | 22 ------------------- 2 files changed, 30 deletions(-) diff --git a/gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts b/gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts index 73f4b16206..eda880fc46 100644 --- a/gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts +++ b/gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts @@ -181,14 +181,6 @@ publishing { } } -// Handle JPMS options -val jpmsOptions: List? by rootProject.extra -jpmsOptions?.let { - tasks.withType().configureEach { - groovyOptions.fork(mapOf("jvmArgs" to it)) - } -} - // Disable gradle module metadata tasks.withType().configureEach { enabled = false diff --git a/gradle-plugins/build.gradle.kts b/gradle-plugins/build.gradle.kts index 690e08efc1..cf21ab0e87 100644 --- a/gradle-plugins/build.gradle.kts +++ b/gradle-plugins/build.gradle.kts @@ -1,25 +1,3 @@ -if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_1_9)) { - val jpmsOptions by extra(listOf( - "--add-opens=java.base/java.lang=ALL-UNNAMED", - "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED", - "--add-opens=java.base/java.lang.reflect=ALL-UNNAMED", - "--add-opens=java.base/java.io=ALL-UNNAMED", - "--add-opens=java.base/java.net=ALL-UNNAMED", - "--add-opens=java.base/java.nio=ALL-UNNAMED", - "--add-opens=java.base/java.util=ALL-UNNAMED", - "--add-opens=java.base/java.util.jar=ALL-UNNAMED", - "--add-opens=java.base/java.util.regex=ALL-UNNAMED", - "--add-opens=java.base/java.util.zip=ALL-UNNAMED", - "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED", - "--add-opens=java.base/sun.net.www.protocol.file=ALL-UNNAMED", - "--add-opens=java.base/sun.net.www.protocol.ftp=ALL-UNNAMED", - "--add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED", - "--add-opens=java.base/sun.net.www.protocol.https=ALL-UNNAMED", - "--add-opens=java.base/sun.net.www.protocol.jar=ALL-UNNAMED", - "--add-opens=java.base/sun.net.www.protocol.jrt=ALL-UNNAMED" - )) -} - val localrepo: String? = System.getProperty("maven.repo.local") localrepo?.let { var rootGradle: Gradle = gradle