preparing to further git conversion
This commit is contained in:
parent
94ed4f25b8
commit
899a461098
Binary file not shown.
|
@ -9,22 +9,30 @@ import java.util.Date;
|
||||||
public class Version2Header {
|
public class Version2Header {
|
||||||
private static final String NL = "\n";//System.getProperty("line.separator");
|
private static final String NL = "\n";//System.getProperty("line.separator");
|
||||||
|
|
||||||
private static final String COMMAND = "svn info";
|
private static final String COMMAND = "svn info ";
|
||||||
private static final String VERSION_MARKER = "Last Changed Rev: ";
|
private static final String VERSION_MARKER = "Last Changed Rev: ";
|
||||||
private static final String HEADER_TAG = "VCS_VERSION";
|
private static final String HEADER_TAG = "VCS_VERSION";
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) throws IOException {
|
||||||
if (args.length!=1) {
|
if (args.length != 1 && args.length != 2) {
|
||||||
System.out.println("Version offset value is now a mandatory parameter!");
|
System.out.println("Version offset value is now a mandatory parameter!");
|
||||||
System.exit(-1);
|
System.exit(-1);
|
||||||
}
|
}
|
||||||
int versionOffsetValue = Integer.parseInt(args[0]);
|
int versionOffsetValue = Integer.parseInt(args[0]);
|
||||||
|
String url = args.length == 2 ? args[1] : "";
|
||||||
System.out.println("Hi, it's " + new Date());
|
System.out.println("Hi, it's " + new Date());
|
||||||
|
if (url.isEmpty()) {
|
||||||
|
System.out.println("Looking for local version");
|
||||||
|
} else {
|
||||||
|
System.out.println("Looking for remove version: " + url);
|
||||||
|
}
|
||||||
|
String command = COMMAND + url;
|
||||||
|
|
||||||
System.out.println("Working with " + NL.length() + " line ends, offset " + versionOffsetValue);
|
System.out.println("Working with " + NL.length() + " line ends, offset " + versionOffsetValue);
|
||||||
Process simulatorProcess = null;
|
Process simulatorProcess = null;
|
||||||
try {
|
try {
|
||||||
System.out.println("Executing [" + COMMAND + "]");
|
System.out.println("Executing [" + command + "]");
|
||||||
simulatorProcess = Runtime.getRuntime().exec(COMMAND);
|
simulatorProcess = Runtime.getRuntime().exec(command);
|
||||||
|
|
||||||
BufferedReader stdout =
|
BufferedReader stdout =
|
||||||
new BufferedReader(new InputStreamReader(simulatorProcess.getInputStream()));
|
new BufferedReader(new InputStreamReader(simulatorProcess.getInputStream()));
|
||||||
|
@ -32,7 +40,7 @@ public class Version2Header {
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
String line;
|
String line;
|
||||||
while ((line = stdout.readLine()) != null) {
|
while ((line = stdout.readLine()) != null) {
|
||||||
System.out.println("from " + COMMAND + ": " + line);
|
System.out.println("from " + command + ": " + line);
|
||||||
counter++;
|
counter++;
|
||||||
|
|
||||||
if (line.startsWith(VERSION_MARKER)) {
|
if (line.startsWith(VERSION_MARKER)) {
|
||||||
|
|
Loading…
Reference in New Issue