[GRADLE-2208] Provide a default config file for checkstyle plugin Created: 03/Apr/12 Updated: 10/Feb/17 Resolved: 10/Feb/17 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Improvement | ||
Reporter: | Gradle Forums | Assignee: | Unassigned |
Resolution: | Won't Fix | Votes: | 5 |
Description |
At the moment, if the user does not provide a config file the build will fail. We should provide a default. |
Comments |
Comment by Justin Ryan [ 23/Sep/13 ] |
In lieu of a pull request, this is what my Checkstyle wrapper plugin does to help in this regard, which might help other people who have this problem. package netflix.nebula.checkstyle import netflix.nebula.ClasspathHelper import netflix.nebula.GradleHelper import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.internal.IConventionAware import org.gradle.api.logging.Logger import org.gradle.api.logging.Logging import org.gradle.api.plugins.quality.CheckstyleExtension import org.gradle.api.plugins.quality.CheckstylePlugin class NebulaCheckstylePlugin implements Plugin<Project> { private static Logger logger = Logging.getLogger(NebulaCheckstylePlugin); protected Project project @Override void apply(Project project) { this.project = project project.plugins.apply(CheckstylePlugin) CheckstyleExtension extension = project.extensions.getByType(CheckstyleExtension) // This is what we have in extlib extension.ignoreFailures = true // extension.configFile requires a real filesystem. Ironically the ant task, underlying the Checkstyle task, // actually supports a String pointing to ClassLoader.getResource() // According to http://checkstyle.sourceforge.net/anttask.html extension.configFile = copyCheckstyleXml() } def copyCheckstyleXml() { File tmpDir = new GradleHelper(project).getTempDir('checkstyle') File to = new File(tmpDir, 'checkstyle.xml') return ClasspathHelper.copyResource('netflix/nebula/codequality/checkstyle.xml', to) } } And of course I have a src/main/resources/nebula/nebula/codequality/checkstyle.xml file, which is pretty stock Sun recommendations. |
Comment by Piotr Jagielski [ 22/Jan/16 ] |
There is an unfinished pull request that attempted to address it in case someone is interested in picking it up: https://github.com/gradle/gradle/pull/420. |
Comment by Benjamin Muschko [ 15/Nov/16 ] |
As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub. We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to. Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:
We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle! |
Comment by Benjamin Muschko [ 10/Feb/17 ] |
Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved. |