Skip to content

Commit

Permalink
Merge pull request #3512 from bjhargrave/gradle-6_0-support
Browse files Browse the repository at this point in the history
Gradle 6 0 support
  • Loading branch information
bjhargrave authored Oct 31, 2019
2 parents 8e71b0a + ddd73b1 commit 17f24db
Show file tree
Hide file tree
Showing 21 changed files with 142 additions and 213 deletions.
7 changes: 3 additions & 4 deletions biz.aQute.bnd.gradle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ specified in the Bnd Workspace's `cnf/build.bnd` file and each project's
`bnd.bnd` file to configure the Gradle projects and tasks.

The [`biz.aQute.bnd.gradle`][2] jar contains the Bnd Gradle Plugins.
These plugins requires at least Gradle 4.0 for Java 8, at least
Gradle 4.2.1 for Java 9, at least Gradle 4.7 for Java 10, and at
least Gradle 5.0 for Java 11.
These plugins requires at least Gradle 5.1 for Java 8 to Java 12, and at
least Gradle 6.0 for Java 13.

This README represents the capabilities and features of the Bnd Gradle Plugins in
the branch containing this README. So for the `master` branch, this will be
Expand Down Expand Up @@ -433,7 +432,7 @@ plus _${project.configurations.archives.artifacts.files}_.

The list of fully qualified names of test classes to run. If not set, or empty,
Then all the test classes listed in the `Test-Classes` manifest header are
run. In Gradle 4.6 and later, the `--tests` command line option can be used
run. The `--tests` command line option can be used
to set the fully qualified name of a test class to run. This can be repeated
multiple times to specify multiple test classes to run.

Expand Down
4 changes: 2 additions & 2 deletions biz.aQute.bnd.gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ repositories {
dependencies {
compileOnly localGroovy()
compileOnly gradleApi()
testCompile gradleTestKit()
testCompile('org.spockframework:spock-core:1.1-groovy-2.4') {
testImplementation gradleTestKit()
testImplementation('org.spockframework:spock-core:1.1-groovy-2.4') {
exclude module: 'groovy-all'
}
}
Expand Down
6 changes: 4 additions & 2 deletions biz.aQute.bnd.gradle/src/aQute/bnd/gradle/Baseline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
package aQute.bnd.gradle

import static aQute.bnd.gradle.BndUtils.builtBy
import static aQute.bnd.gradle.BndUtils.toTask

import aQute.bnd.differ.DiffPluginImpl
import aQute.bnd.header.Parameters
Expand All @@ -68,6 +67,7 @@ import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.OutputFile
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.TaskProvider

public class Baseline extends DefaultTask {
private ConfigurableFileCollection bundleCollection
Expand Down Expand Up @@ -214,7 +214,9 @@ public class Baseline extends DefaultTask {

Task getBundleTask() {
return bundleCollection.getBuiltBy().flatten().findResult { t ->
t = toTask(t)
if (t instanceof TaskProvider) {
t = t.get()
}
t instanceof Task && t.convention.findPlugin(BundleTaskConvention.class) ? t : null
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@

package aQute.bnd.gradle

import static aQute.bnd.gradle.BndUtils.configureTask
import static aQute.bnd.gradle.BndUtils.createTask

import org.gradle.api.GradleException
import org.gradle.api.Plugin
import org.gradle.api.Project
Expand All @@ -48,7 +45,7 @@ public class BndBuilderPlugin implements Plugin<Project> {
}
plugins.apply 'java'

def jar = configureTask(project, 'jar') { t ->
def jar = tasks.named('jar') { t ->
t.description 'Assembles a bundle containing the main classes.'
t.convention.plugins.bundle = new BundleTaskConvention(t)
def defaultBndfile = project.file('bnd.bnd')
Expand All @@ -72,7 +69,7 @@ public class BndBuilderPlugin implements Plugin<Project> {
}
}

createTask(project, 'baseline', Baseline.class) { t ->
tasks.register('baseline', Baseline.class) { t ->
t.description 'Baseline the project bundle.'
t.group 'release'
t.bundle jar
Expand Down
Loading

0 comments on commit 17f24db

Please sign in to comment.