Return-Path: X-Original-To: apmail-buildr-commits-archive@www.apache.org Delivered-To: apmail-buildr-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 05D6510F9E for ; Wed, 31 Jul 2013 15:07:55 +0000 (UTC) Received: (qmail 19477 invoked by uid 500); 31 Jul 2013 15:07:53 -0000 Delivered-To: apmail-buildr-commits-archive@buildr.apache.org Received: (qmail 18764 invoked by uid 500); 31 Jul 2013 15:07:52 -0000 Mailing-List: contact commits-help@buildr.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@buildr.apache.org Delivered-To: mailing list commits@buildr.apache.org Received: (qmail 18098 invoked by uid 500); 31 Jul 2013 15:07:50 -0000 Delivered-To: apmail-incubator-buildr-commits@incubator.apache.org Received: (qmail 17865 invoked by uid 99); 31 Jul 2013 15:07:50 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Jul 2013 15:07:50 +0000 Date: Wed, 31 Jul 2013 15:07:50 +0000 (UTC) From: "Wim C (JIRA)" To: buildr-commits@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (BUILDR-672) Buildr checkstyle plugin is always returning a new instance of the properties Hash MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/BUILDR-672?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Wim C updated BUILDR-672: ------------------------- Description: If we use properties in the checkstyle configuration file (see snippt below), we can not set these properties on the checkstyle extension. The checkstyle.properties method is always returning a new instance of the properties Hash. {noformat} {noformat} Possible solution : {noformat} def properties @properties ||= original_properties end private def original_properties properties = {:basedir => self.project.base_dir} properties['checkstyle.suppressions.file'] = self.suppressions_file if File.exist?(self.suppressions_file) properties['checkstyle.import-control.file'] = self.import_control_file if File.exist?(self.import_control_file) properties end {noformat} was: If we use properties in the checkstyle configuration file (see snippt below), we can not set these properties on the checkstyle extension. The checkstyle.properties method is always returning a new instance of the properties Hash. {code:xml} {code} Possible solution : {code:ruby} def properties @properties ||= original_properties end private def original_properties properties = {:basedir => self.project.base_dir} properties['checkstyle.suppressions.file'] = self.suppressions_file if File.exist?(self.suppressions_file) properties['checkstyle.import-control.file'] = self.import_control_file if File.exist?(self.import_control_file) properties end {code} > Buildr checkstyle plugin is always returning a new instance of the properties Hash > ---------------------------------------------------------------------------------- > > Key: BUILDR-672 > URL: https://issues.apache.org/jira/browse/BUILDR-672 > Project: Buildr > Issue Type: Bug > Components: Extensions > Affects Versions: 1.4.12 > Reporter: Wim C > Priority: Minor > > If we use properties in the checkstyle configuration file (see snippt below), we can not set these properties on the checkstyle extension. > The checkstyle.properties method is always returning a new instance of the properties Hash. > {noformat} > > > > {noformat} > Possible solution : > {noformat} > def properties > @properties ||= original_properties > end > private > def original_properties > properties = {:basedir => self.project.base_dir} > properties['checkstyle.suppressions.file'] = self.suppressions_file if File.exist?(self.suppressions_file) > properties['checkstyle.import-control.file'] = self.import_control_file if File.exist?(self.import_control_file) > properties > end > {noformat} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira