Skip to content

Commit

Permalink
Fix generate-test-hpl task dependency for running tests
Browse files Browse the repository at this point in the history
This issue was introduced in commit 7a565d3,
when lazily registering the task.
  • Loading branch information
darxriggs committed Jan 2, 2020
1 parent 77f4977 commit 7854ee0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,13 @@ class JpiPlugin implements Plugin<Project> {

// generate test hpl manifest for the current plugin, to be used during unit test
def outputDir = project.layout.buildDirectory.dir('generated-resources/test')
project.tasks.register('generate-test-hpl', GenerateTestHpl) {
testSourceSet.output.dir(outputDir)

def generateTestHplTask = project.tasks.register('generate-test-hpl', GenerateTestHpl) {
it.hplDir.set(outputDir)
}
testSourceSet.output.dir(outputDir)

project.tasks.named(JavaPlugin.TEST_CLASSES_TASK_NAME).configure { it.dependsOn(generateTestHplTask) }
}

private static void resolvePluginDependencies(Project project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class JpiIntegrationSpec extends IntegrationSpec {
'processTestResources' | ':resolveTestDependencies' | TaskOutcome.NO_SOURCE
'jpi' | ':war' | TaskOutcome.SUCCESS
'compileTestJava' | ':insertTest' | TaskOutcome.SKIPPED
'testClasses' | ':generate-test-hpl' | TaskOutcome.SUCCESS
'compileJava' | ':localizer' | TaskOutcome.SUCCESS
}

Expand Down

0 comments on commit 7854ee0

Please sign in to comment.