Skip to content

Commit

Permalink
Add flatDir dependency unit test
Browse files Browse the repository at this point in the history
The test fails with my fix for #36, which passed the provided example
project, due to an NPE using the comparator. The test passes with the
fix provided by #59, validating @dbachelder's solution.
  • Loading branch information
ben-manes committed May 27, 2015
1 parent d882701 commit 2cbefb4
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Gradle Versions Plugin

In the spirit of the [Maven Versions Plugin](http://mojo.codehaus.org/versions-maven-plugin/),
In the spirit of the [Maven Versions Plugin](http://mojo.codehaus.org/versions-maven-plugin/),
this plugin provides a task to determine which dependencies have updates.

## Usage
Expand All @@ -15,14 +15,14 @@ buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.ben-manes:gradle-versions-plugin:0.9'
// classpath 'org.codehaus.groovy:groovy-backports-compat23:2.3.5' // uncomment if you're using Gradle 1.x
}
}
```
The current version is known to work with Gradle versions up to 2.4-rc-1.
The current version is known to work with Gradle versions up to 2.4.

## Tasks

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,33 @@ class DependencyUpdatesSpec extends Specification {
unresolved == 2
}

def 'Single project with flatDir repository'() {
given:
def project = singleProject()
project.repositories {
flatDir {
dirs getClass().getResource('/libs/')
}
}
project.configurations {
flat
}
project.dependencies {
flat(name: 'guice-4.0', ext: 'jar')
flat(name: 'guava-18.0', ext: 'jar')
}
when:
def reporter = evaluate(project)
reporter.write()
then:
with(reporter) {
unresolved.size() == 1
upgradeVersions.isEmpty()
upToDateVersions.size() == 1
downgradeVersions.isEmpty()
}
}

def singleProject() {
new ProjectBuilder().withName('single').build()
}
Expand Down
Binary file added src/test/resources/libs/guice-4.0.jar
Binary file not shown.

0 comments on commit 2cbefb4

Please sign in to comment.