Skip to content

Commit

Permalink
Fix integration tests
Browse files Browse the repository at this point in the history
Dependencies aren't tracked with Property<Directory>
  • Loading branch information
big-guy committed May 11, 2021
1 parent 53a3552 commit f5b1f43
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package org.gradle.playframework.application

import org.gradle.playframework.fixtures.ide.IdeaModuleFixture

import org.gradle.testkit.runner.BuildResult
import org.gradle.testkit.runner.TaskOutcome

import static org.gradle.playframework.fixtures.ide.IdeaFixtures.parseIml
import static org.gradle.playframework.fixtures.ide.IdeaFixtures.parseIpr

abstract class PlayIdeaPluginIntegrationTest extends PlayIdePluginIntegrationTest {

Expand Down Expand Up @@ -73,16 +72,13 @@ abstract class PlayIdeaPluginIntegrationTest extends PlayIdePluginIntegrationTes

def "IDEA metadata contains correct dependencies for RUNTIME, COMPILE, TEST"() {
applyIdePlugin()
build("assemble") // Need generated directories to exist

when:
build(ideTask)
then:

def externalLibs = parseIml(moduleFile).dependencies.libraries
def compileDeps = externalLibs.findAll({ it.scope == "COMPILE" }).collect { it.url }
compileDeps.any {
it.endsWith("build/classes/scala/main")
}
!compileDeps.empty

def runtimeDeps = externalLibs.findAll({ it.scope == "RUNTIME" })
!runtimeDeps.empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.gradle.api.Action;
import org.gradle.api.file.ConfigurableFileCollection;
import org.gradle.api.file.Directory;
import org.gradle.api.file.DirectoryProperty;
import org.gradle.api.file.FileTree;
import org.gradle.api.provider.ListProperty;
import org.gradle.api.provider.Property;
Expand Down Expand Up @@ -39,7 +40,7 @@ public class RoutesCompile extends SourceTask {
/**
* Target directory for the compiled route files.
*/
private final Property<Directory> outputDirectory;
private final DirectoryProperty outputDirectory;

/**
* Additional imports used for by generated files.
Expand Down Expand Up @@ -82,7 +83,7 @@ public FileTree getSource() {
* @return The output directory.
*/
@OutputDirectory
public Property<Directory> getOutputDirectory() {
public DirectoryProperty getOutputDirectory() {
return outputDirectory;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.gradle.api.Action;
import org.gradle.api.file.ConfigurableFileCollection;
import org.gradle.api.file.Directory;
import org.gradle.api.file.DirectoryProperty;
import org.gradle.api.file.FileTree;
import org.gradle.api.file.FileVisitDetails;
import org.gradle.api.file.FileVisitor;
Expand Down Expand Up @@ -49,7 +50,7 @@ public class TwirlCompile extends SourceTask {
/**
* Target directory for the compiled template files.
*/
private final Property<Directory> outputDirectory;
private final DirectoryProperty outputDirectory;

/**
* The default imports to use when compiling templates
Expand Down Expand Up @@ -89,7 +90,7 @@ public FileTree getSource() {
* @return The output directory.
*/
@OutputDirectory
public Property<Directory> getOutputDirectory() {
public DirectoryProperty getOutputDirectory() {
return outputDirectory;
}

Expand Down

0 comments on commit f5b1f43

Please sign in to comment.