Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skipping log message when not needed #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions src/main/groovy/com/riotgames/maven/redline/RedlineMojo.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -113,7 +113,12 @@ class RedlineMojo extends GroovyMojo {
* @parameter
*/
def boolean attach

/**
* skip the logs
*
* @parameter
*/
def boolean skipLogs
/**
* @parameter expression="${project}"
* @required
Expand Down Expand Up @@ -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)
}
}
Expand All @@ -304,4 +313,4 @@ class RedlineMojo extends GroovyMojo {
}
}

}
}