From 1bd969672c9733a95e80f3470120a712b4393ec6 Mon Sep 17 00:00:00 2001 From: Kash Raman Date: Fri, 20 Jan 2017 15:39:13 -0500 Subject: [PATCH] skipping log message when not needed --- .../maven/redline/RedlineMojo.groovy | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/groovy/com/riotgames/maven/redline/RedlineMojo.groovy b/src/main/groovy/com/riotgames/maven/redline/RedlineMojo.groovy index e221bcd..f977c1f 100644 --- a/src/main/groovy/com/riotgames/maven/redline/RedlineMojo.groovy +++ b/src/main/groovy/com/riotgames/maven/redline/RedlineMojo.groovy @@ -56,7 +56,7 @@ class RedlineMojo extends GroovyMojo { /** * The PGP/GPG signature of the rpm - * + * * If the private key information will be provided, * the RPM will be signed. * If not, it will just remain unsigned. @@ -113,7 +113,12 @@ class RedlineMojo extends GroovyMojo { * @parameter */ def boolean attach - + /** + * skip the logs + * + * @parameter + */ + def boolean skipLogs /** * @parameter expression="${project}" * @required @@ -277,14 +282,18 @@ class RedlineMojo extends GroovyMojo { sourceFileRoot = sourceFile.canonicalPath sourceFile.eachFileRecurse(FileType.FILES, {file -> absoluteRpmPath = directoryInRpm + file.canonicalPath.substring(sourceFileRoot.length()+1) - log.info("Adding file ${file.absolutePath} to rpm at path $absoluteRpmPath") + if(!skipLogs){ + log.info("Adding file ${file.absolutePath} to rpm at path $absoluteRpmPath") + } builder.addFile(absoluteRpmPath, file, mapping.filemode, mapping.dirmode, rpmDirective, mapping.username, mapping.groupname) }) } //else, only a single file was mapped else { absoluteRpmPath = directoryInRpm + sourceFile.name - log.info("Adding file $sourceFile to rpm at path $absoluteRpmPath") + if(!skipLogs){ + log.info("Adding file $sourceFile to rpm at path $absoluteRpmPath") + } builder.addFile(absoluteRpmPath, sourceFile, mapping.filemode, mapping.dirmode, rpmDirective, mapping.username, mapping.groupname) } } @@ -304,4 +313,4 @@ class RedlineMojo extends GroovyMojo { } } -} \ No newline at end of file +}