コード例 #1
0
 @Override
 public Collection<String> validateChange(ProjectMetadata project, VersionChange change) {
   if (isBundle(project) && isProjectVersionChange(project, change)) {
     String error = Versions.validateOsgiVersion(change.getNewVersion(), getManifestFile(project));
     return error != null ? Collections.singleton(error) : null;
   }
   return null;
 }
コード例 #2
0
 @Override
 public Collection<String> validateChanges(
     ProjectMetadata project, VersionChangesDescriptor versionChangeContext) {
   if (isEclipseRepository(project)) {
     for (VersionChange change : versionChangeContext.getVersionChanges()) {
       ArrayList<String> errors = new ArrayList<>();
       for (Map.Entry<File, ProductConfiguration> entry :
           getProductConfigurations(project).entrySet()) {
         if (isSameProject(project, change.getProject())
             && change.getVersion().equals(entry.getValue().getVersion())) {
           String error = Versions.validateOsgiVersion(change.getNewVersion(), entry.getKey());
           if (error != null) {
             errors.add(error);
           }
         }
       }
       if (!errors.isEmpty()) {
         return errors;
       }
     }
   }
   return null;
 }