Skip to content

Commit

Permalink
Merge pull request #4 from rspieldenner/reduce_memory
Browse files Browse the repository at this point in the history
restore signature of addPluginMessage
  • Loading branch information
rspieldenner authored Mar 22, 2017
2 parents 815201c + 713a531 commit 38f7992
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0.2.2 / 2017-03-22
==================

* Restore signature of `addPluginMessage`

0.2.1 / 2017-03-22
==================

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ class DependencyManagement {
if (shouldStoreReason) reasons.add(DefaultReason(configuration, coordinate, message))
}

fun addPluginMessage(message: String) {
if (shouldStoreReason) pluginMessages.add(message)
}
fun addPluginMessage(message: String) = if (shouldStoreReason) pluginMessages.add(message) else false

fun getReason(configuration: String, coordinate: String): String {
val recs = reasons.filter { it.configuration == configuration && it.coordinate == coordinate }.distinct().reversed()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,15 @@ class DependencyManagementSpec extends Specification {
then:
management.getReason("compile", coordinate) == "recommend 1.2.0 via OtherRecommender, forced"
}

def "plugin messages are stored"() {
given:
def management = new DependencyManagement()

when:
management.addPluginMessage("message 1")

then:
management.pluginMessages.size() == 1
}
}

0 comments on commit 38f7992

Please sign in to comment.