com.netflix.gradle.plugins.rpm.validation.RpmTaskPropertiesValidator.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-ospackage-plugin Show documentation
Show all versions of gradle-ospackage-plugin Show documentation
Provides a task similar to Tar and Zip for constructing RPM and DEB package files.
The newest version!
package com.netflix.gradle.plugins.rpm.validation
import com.netflix.gradle.plugins.packaging.validation.SystemPackagingAttributeValidator
import com.netflix.gradle.plugins.packaging.validation.SystemPackagingTaskPropertiesValidator
import com.netflix.gradle.plugins.rpm.Rpm
import org.gradle.api.InvalidUserDataException
class RpmTaskPropertiesValidator implements SystemPackagingTaskPropertiesValidator {
private final SystemPackagingAttributeValidator packageNameValidator = new RpmPackageNameAttributeValidator()
@Override
void validate(Rpm task) {
if(!packageNameValidator.validate(task.getPackageName())) {
throw new InvalidUserDataException(packageNameValidator.getErrorMessage(task.getPackageName()))
}
}
}