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)',\ diff --git a/gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts b/gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts index d47731abd4..eda880fc46 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 { @@ -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,27 +177,10 @@ 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 }) - } } } } -// 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 @@ -209,12 +202,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 +226,7 @@ tasks.jar { tasks.named("sourcesJar") { // Include dsl SourceSet - from(sourceSets["dsl"].allSource) + from(dsl.get().allSource) } val testresourcesOutput = layout.buildDirectory.dir("testresources") 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 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")