public class GoProjectType extends Object
| Constructor and Description |
|---|
GoProjectType() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
check(File directory)
Checks if the go.mod config file exists at the root directory.
|
boolean |
createNewUpdateFile(String buildPath,
String buildTempPath,
com.github.zafarkhaja.semver.Version nextVersion,
boolean isIndented,
String[] matchingWords)
Write an updated temporary file with next version
then replace the project config file with it.
|
com.github.zafarkhaja.semver.Version |
getCurrentVersion(File directory,
ProcessHelper processHelper)
Gets the current version of the Go module as indicated by release tag on GitHub.
|
void |
writeVersion(File directory,
com.github.zafarkhaja.semver.Version nextVersion,
ProcessHelper processHelper)
Checks if there is a Go config file (go.mod) file in the directory.
|
public boolean check(File directory)
directory - The directory in which the go.mod file is searched for.public com.github.zafarkhaja.semver.Version getCurrentVersion(File directory, ProcessHelper processHelper) throws IOException, InterruptedException
directory - The directory in which the go.mod file is ideally found.processHelper - The helper to run the "go list" command.IOException - If an error is thrown while file is read.InterruptedException - If an error is thrown due to interruption.public void writeVersion(File directory, com.github.zafarkhaja.semver.Version nextVersion, ProcessHelper processHelper) throws IOException, InterruptedException, org.apache.commons.lang.NotImplementedException
directory - The directory to which the file is written.nextVersion - The next version to use.processHelper - The helper to run the command (not used here).org.apache.commons.lang.NotImplementedException - If not implemented means the Go project is not supported.IOException - If an error is thrown while file is read.InterruptedException - If an error is thrown due to interruption.public boolean createNewUpdateFile(String buildPath, String buildTempPath, com.github.zafarkhaja.semver.Version nextVersion, boolean isIndented, String[] matchingWords) throws IOException
buildPath - Path of the file updatedbuildTempPath - Path of a temporary file to replace buildPathnextVersion - Version to update config fileisIndented - Can the config file have indentationmatchingWords - Tab of word to match the versionIOException - If errors occurs when write the fileCopyright © 2016–2022. All rights reserved.