Skip to content

Commit

Permalink
set spotbugs tasks default heap size to 1g to mimic old behaviour in …
Browse files Browse the repository at this point in the history
…gradle 5 (#12)
  • Loading branch information
xvik committed Feb 16, 2019
1 parent ffdecf4 commit 5d864ad
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* Fix source files root detection (#13)
* Set spotbugs tasks default heap size to 1g to mimic old behaviour in [gradle 5](https://docs.gradle.org/5.0/userguide/upgrading_version_4.html#rel5.0:default_memory_settings) (#12)
* Update pmd 6.9.0 -> 6.11.0
* Update checkstyle 8.14 -> 8.17
* Update spotbugs 3.1.9 -> 3.1.11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ class QualityPlugin implements Plugin<Project> {
withMessages true
}
}
// in gradle 5 default 1g was changed and so spotbugs fails on large projects (recover behaviour),
// but not if value set manually
maxHeapSize = maxHeapSize ?: '1g'
}
}
configurePluginTasks(project, extension, SpotBugsTask, 'spotbugs', new SpotbugsReporter(configLoader))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package ru.vyarus.gradle.plugin.quality


import org.gradle.api.Project

/**
* @author Vyacheslav Rusakov
* @since 16.02.2019
*/
class SpotbugsHeapSizeSettingTest extends AbstractTest {

def "Check default max heap size set"() {

when: "apply plugin"
file('src/main/java').mkdirs()

Project project = project {
apply plugin: 'java'
apply plugin: 'ru.vyarus.quality'
}

then: "maxHeapSize set"
project.tasks.spotbugsMain.maxHeapSize == '1g'
}


def "Check manual max heap size not overridden"() {

when: "apply plugin"
file('src/main/java').mkdirs()

Project project = project {
apply plugin: 'java'
apply plugin: 'com.github.spotbugs'
apply plugin: 'ru.vyarus.quality'

spotbugsMain.maxHeapSize = '2g'
}

then: "maxHeapSize not overridden"
project.tasks.spotbugsMain.maxHeapSize == '2g'
}
}

0 comments on commit 5d864ad

Please sign in to comment.