Skip to content

Commit

Permalink
gradle plugin: jar task rebuild for -dependson project's artifact cha…
Browse files Browse the repository at this point in the history
…nges

The jar task would rebuild if any of the -buildpath dependencies change
but when a -dependson dependency changes, the jar task would not rebuild.
The OSGi build uses -dependson for packaging projects like osgi.ct to
depend up on the various ct projects. But when a ct project rebuilt, the
osgi.ct project would not rebuild the packaging jar. This change means
that the jar task will rebuild the jar of any dependency in -buildpath
or -dependson changes.

Signed-off-by: BJ Hargrave <bj@bjhargrave.com>
  • Loading branch information
bjhargrave committed Jun 22, 2015
1 parent a0f4185 commit 48c9447
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions biz.aQute.bnd.gradle/src/aQute/bnd/gradle/BndPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import aQute.bnd.osgi.Constants
import org.gradle.api.GradleException
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.file.FileCollection
import org.gradle.api.logging.Logger

Expand Down Expand Up @@ -240,6 +241,10 @@ public class BndPlugin implements Plugin<Project> {
exclude sourceSets.test.output.files.collect { relativePath(it) }
exclude relativePath(buildDir)
}
/* project dependencies' artifacts should trigger jar task */
configurations.compile.dependencies.withType(ProjectDependency.class).each {
inputs.files it.dependencyProject.configurations.archives.artifacts.files
}
outputs.files configurations.archives.artifacts.files, new File(buildDir, Constants.BUILDFILES)
doLast {
def built
Expand Down

0 comments on commit 48c9447

Please sign in to comment.