All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.sinch-sdk-java.1.3.1.source-code.SDKTemplate Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class VersionTemplating {

  static final String SDK_FILE_PATH = "client/src/main/com/sinch/sdk/SDK.java";

  public static void main(String[] args) throws IOException {

    String versionValue = args[0];

    Stream lines = Files.lines(Paths.get(SDK_FILE_PATH));
    String content = lines.collect(Collectors.joining("\n"));
    lines.close();

    System.out.println(
        content.replaceAll("VERSION = \".*\"", String.format("VERSION = \"%s\"", versionValue)));
    System.out.println("");
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy