All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
uk.ac.manchester.owl.owlapi.PrepareForRelease Maven / Gradle / Ivy
package uk.ac.manchester.owl.owlapi;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.stream.Collectors;
public class PrepareForRelease {
public static void main(String[] args) throws IOException {
String newVersion = "4.5.13";
String[] toReplace = new String[] {"4.5.12", "4.5.12-SNAPSHOT"};
treat(newVersion, toReplace,
"../api/src/main/java/org/semanticweb/owlapi/util/VersionInfo.java");
treat(newVersion, toReplace,
"../osgidistribution/src/test/java/org/semanticweb/owlapi/api/test/VerifyVersionInfoIntegrationTestCase.java");
treat(newVersion, toReplace, "../pom.xml");
treat(newVersion, toReplace, "../api/pom.xml");
treat(newVersion, toReplace, "../impl/pom.xml");
treat(newVersion, toReplace, "../tools/pom.xml");
treat(newVersion, toReplace, "../parsers/pom.xml");
treat(newVersion, toReplace, "../oboformat/pom.xml");
treat(newVersion, toReplace, "../fixers/pom.xml");
treat(newVersion, toReplace, "../rio/pom.xml");
treat(newVersion, toReplace, "../compatibility/pom.xml");
treat(newVersion, toReplace, "../apibinding/pom.xml");
treat(newVersion, toReplace, "../contract/pom.xml");
treat(newVersion, toReplace, "../distribution/pom.xml");
treat(newVersion, toReplace, "../osgidistribution/pom.xml");
}
protected static void treat(String newVersion, String[] toReplace, String fileName)
throws IOException, FileNotFoundException {
List lines = Files.readAllLines(Paths.get(fileName));
try (PrintStream out = new PrintStream(new File(fileName))) {
out.println(lines.stream().map(s -> replaceall(s, newVersion, toReplace))
.collect(Collectors.joining("\n")));
}
}
private static String replaceall(String in, String replacement, String... values) {
String toReturn = in;
for (String s : values) {
toReturn = toReturn.replace(s, replacement);
}
return toReturn;
}
}